@meethive/components 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/es/AutoComplete/AutoComplete.js +84 -0
  2. package/es/AutoComplete/index.js +7 -0
  3. package/es/BadgeStatus/Badge.js +51 -0
  4. package/es/BadgeStatus/color.js +14 -0
  5. package/es/BadgeStatus/index.js +8 -0
  6. package/es/CardSelect/CardSelect.js +141 -0
  7. package/es/CardSelect/index.js +7 -0
  8. package/es/CardSelect/style/index.js +29 -0
  9. package/es/CheckButton/CheckButton.js +122 -0
  10. package/es/CheckButton/index.js +7 -0
  11. package/es/CheckButton/style/index.js +44 -0
  12. package/es/ConfigProvider/ConfigProvider.js +73 -0
  13. package/es/ConfigProvider/context.js +26 -0
  14. package/es/ConfigProvider/index.js +9 -0
  15. package/es/DragModal/DragModal.js +212 -0
  16. package/es/DragModal/index.js +7 -0
  17. package/es/DragModal/style/index.js +86 -0
  18. package/es/EditTable/Body.js +189 -0
  19. package/es/EditTable/CellRender.js +12 -0
  20. package/es/EditTable/EditTable.js +434 -0
  21. package/es/EditTable/FormItem.js +169 -0
  22. package/es/EditTable/Group.js +204 -0
  23. package/es/EditTable/Header.js +63 -0
  24. package/es/EditTable/HeaderRender.js +12 -0
  25. package/es/EditTable/components/ContextMenu/Menu.js +86 -0
  26. package/es/EditTable/components/ContextMenu/index.js +96 -0
  27. package/es/EditTable/components/Search/Search.js +163 -0
  28. package/es/EditTable/components/Search/Sort.js +119 -0
  29. package/es/EditTable/components/Search/index.js +2 -0
  30. package/es/EditTable/consts.js +13 -0
  31. package/es/EditTable/context.js +88 -0
  32. package/es/EditTable/hooks/index.js +19 -0
  33. package/es/EditTable/hooks/useGroup.js +48 -0
  34. package/es/EditTable/hooks/useResizeObserver.js +27 -0
  35. package/es/EditTable/hooks/useValidate.js +112 -0
  36. package/es/EditTable/index.js +25 -0
  37. package/es/EditTable/props.js +60 -0
  38. package/es/EditTable/style/body.js +63 -0
  39. package/es/EditTable/style/form.js +33 -0
  40. package/es/EditTable/style/group.js +33 -0
  41. package/es/EditTable/style/header.js +72 -0
  42. package/es/EditTable/style/index.js +52 -0
  43. package/es/EditTable/style/menu.js +27 -0
  44. package/es/EditTable/style/table.js +46 -0
  45. package/es/EditTable/utils.js +110 -0
  46. package/es/Ellipsis/Ellipsis.js +148 -0
  47. package/es/Ellipsis/index.js +7 -0
  48. package/es/Ellipsis/style/index.js +26 -0
  49. package/es/Empty/Empty.js +63 -0
  50. package/es/Empty/image.js +3 -0
  51. package/es/Empty/index.js +7 -0
  52. package/es/FullPage/FullPage.js +19 -0
  53. package/es/FullPage/index.js +7 -0
  54. package/es/Icon/Icon.js +49 -0
  55. package/es/Icon/index.js +7 -0
  56. package/es/LocaleProvider/LocaleProvider.js +31 -0
  57. package/es/LocaleProvider/index.js +7 -0
  58. package/es/LocaleReciver/index.js +24 -0
  59. package/es/Markdown/Markdown.js +118 -0
  60. package/es/Markdown/index.js +7 -0
  61. package/es/PermissionButton/PermissionButton.js +118 -0
  62. package/es/PermissionButton/confirm.js +94 -0
  63. package/es/PermissionButton/index.js +9 -0
  64. package/es/PermissionButton/shared.js +1 -0
  65. package/es/ProLayout/Basic/BasicLayout.js +422 -0
  66. package/es/ProLayout/Basic/BasicLayoutStyle.js +51 -0
  67. package/es/ProLayout/Basic/Header.js +111 -0
  68. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  69. package/es/ProLayout/PageContainer/index.js +354 -0
  70. package/es/ProLayout/PageContainer/style.js +85 -0
  71. package/es/ProLayout/RouteContext.js +28 -0
  72. package/es/ProLayout/SiderMenu/BaseMenu.js +241 -0
  73. package/es/ProLayout/SiderMenu/SiderMenu.js +274 -0
  74. package/es/ProLayout/SiderMenu/index.js +2 -0
  75. package/es/ProLayout/SiderMenu/style.js +204 -0
  76. package/es/ProLayout/TopHeader/index.js +170 -0
  77. package/es/ProLayout/TopHeader/style.js +154 -0
  78. package/es/ProLayout/defaultSettings.js +113 -0
  79. package/es/ProLayout/index.js +10 -0
  80. package/es/ProLayout/style/index.js +14 -0
  81. package/es/ProLayout/util.js +58 -0
  82. package/es/ProTable/Alert.js +40 -0
  83. package/es/ProTable/Content.js +97 -0
  84. package/es/ProTable/Header.js +33 -0
  85. package/es/ProTable/Pagination.js +55 -0
  86. package/es/ProTable/ProTable.js +279 -0
  87. package/es/ProTable/hooks/index.js +2 -0
  88. package/es/ProTable/hooks/useTableInject.js +6 -0
  89. package/es/ProTable/hooks/useTableSelection.js +115 -0
  90. package/es/ProTable/index.js +8 -0
  91. package/es/ProTable/setting.js +138 -0
  92. package/es/ProTable/style/index.js +113 -0
  93. package/es/RadioButton/RadioButton.js +53 -0
  94. package/es/RadioButton/index.js +8 -0
  95. package/es/RadioButton/style/index.js +25 -0
  96. package/es/Scrollbar/Bar.js +76 -0
  97. package/es/Scrollbar/Scrollbar.js +161 -0
  98. package/es/Scrollbar/Thumb.js +150 -0
  99. package/es/Scrollbar/constants.js +1 -0
  100. package/es/Scrollbar/index.js +7 -0
  101. package/es/Scrollbar/scrollbarProps.js +100 -0
  102. package/es/Scrollbar/style/index.js +85 -0
  103. package/es/Scrollbar/thumbProps.js +10 -0
  104. package/es/Scrollbar/util.js +39 -0
  105. package/es/Search/Item.js +239 -0
  106. package/es/Search/Search.js +90 -0
  107. package/es/Search/hooks/index.js +117 -0
  108. package/es/Search/hooks/useRouteQuery.js +86 -0
  109. package/es/Search/hooks/useSearchItems.js +50 -0
  110. package/es/Search/hooks/useTermOptions.js +29 -0
  111. package/es/Search/index.js +10 -0
  112. package/es/Search/setting.js +245 -0
  113. package/es/Search/style/index.js +5 -0
  114. package/es/Search/style/item.js +40 -0
  115. package/es/Search/style/search.js +177 -0
  116. package/es/Search/util.js +270 -0
  117. package/es/Skeleton/Skeleton.js +27 -0
  118. package/es/Skeleton/components/DashBoardCard.js +27 -0
  119. package/es/Skeleton/components/DashBoardChart.js +27 -0
  120. package/es/Skeleton/components/Detail.js +27 -0
  121. package/es/Skeleton/components/Drawer.js +27 -0
  122. package/es/Skeleton/components/Item.js +54 -0
  123. package/es/Skeleton/components/List.js +27 -0
  124. package/es/Skeleton/components/ListCard.js +28 -0
  125. package/es/Skeleton/components/ListCardItem.js +20 -0
  126. package/es/Skeleton/components/ListTable.js +27 -0
  127. package/es/Skeleton/components/Page.js +26 -0
  128. package/es/Skeleton/components/Search.js +16 -0
  129. package/es/Skeleton/components/Tree.js +27 -0
  130. package/es/Skeleton/index.js +28 -0
  131. package/es/Skeleton/style/index.js +195 -0
  132. package/es/TimeFormat/TimeFormat.js +36 -0
  133. package/es/TimeFormat/index.js +7 -0
  134. package/es/Title/Title.js +26 -0
  135. package/es/Title/index.js +7 -0
  136. package/es/Title/style/index.js +34 -0
  137. package/es/ValueItem/ValueItem.js +113 -0
  138. package/es/ValueItem/index.js +7 -0
  139. package/es/ValueItem/util.js +17 -0
  140. package/es/VirtualTable/VirtualTable.js +271 -0
  141. package/es/VirtualTable/data.js +60 -0
  142. package/es/VirtualTable/index.js +7 -0
  143. package/es/VirtualTable/style/index.js +34 -0
  144. package/es/components.js +21 -0
  145. package/es/index.js +17 -0
  146. package/es/locale/en-US.js +120 -0
  147. package/es/locale/zh-CN.js +120 -0
  148. package/es/style/styleRegister.js +19 -0
  149. package/es/style/variable.js +4 -0
  150. package/es/style.js +1 -0
  151. package/es/utils/constants.js +10 -0
  152. package/lib/AutoComplete/AutoComplete.js +84 -0
  153. package/lib/AutoComplete/index.js +7 -0
  154. package/lib/BadgeStatus/Badge.js +51 -0
  155. package/lib/BadgeStatus/color.js +14 -0
  156. package/lib/BadgeStatus/index.js +8 -0
  157. package/lib/CardSelect/CardSelect.js +141 -0
  158. package/lib/CardSelect/index.js +7 -0
  159. package/lib/CardSelect/style/index.js +29 -0
  160. package/lib/CheckButton/CheckButton.js +122 -0
  161. package/lib/CheckButton/index.js +7 -0
  162. package/lib/CheckButton/style/index.js +44 -0
  163. package/lib/ConfigProvider/ConfigProvider.js +73 -0
  164. package/lib/ConfigProvider/context.js +26 -0
  165. package/lib/ConfigProvider/index.js +9 -0
  166. package/lib/DragModal/DragModal.js +212 -0
  167. package/lib/DragModal/index.js +7 -0
  168. package/lib/DragModal/style/index.js +86 -0
  169. package/lib/EditTable/Body.js +189 -0
  170. package/lib/EditTable/CellRender.js +12 -0
  171. package/lib/EditTable/EditTable.js +434 -0
  172. package/lib/EditTable/FormItem.js +169 -0
  173. package/lib/EditTable/Group.js +204 -0
  174. package/lib/EditTable/Header.js +63 -0
  175. package/lib/EditTable/HeaderRender.js +12 -0
  176. package/lib/EditTable/components/ContextMenu/Menu.js +86 -0
  177. package/lib/EditTable/components/ContextMenu/index.js +96 -0
  178. package/lib/EditTable/components/Search/Search.js +163 -0
  179. package/lib/EditTable/components/Search/Sort.js +119 -0
  180. package/lib/EditTable/components/Search/index.js +2 -0
  181. package/lib/EditTable/consts.js +13 -0
  182. package/lib/EditTable/context.js +88 -0
  183. package/lib/EditTable/hooks/index.js +19 -0
  184. package/lib/EditTable/hooks/useGroup.js +48 -0
  185. package/lib/EditTable/hooks/useResizeObserver.js +27 -0
  186. package/lib/EditTable/hooks/useValidate.js +112 -0
  187. package/lib/EditTable/index.js +25 -0
  188. package/lib/EditTable/props.js +60 -0
  189. package/lib/EditTable/style/body.js +63 -0
  190. package/lib/EditTable/style/form.js +33 -0
  191. package/lib/EditTable/style/group.js +33 -0
  192. package/lib/EditTable/style/header.js +72 -0
  193. package/lib/EditTable/style/index.js +52 -0
  194. package/lib/EditTable/style/menu.js +27 -0
  195. package/lib/EditTable/style/table.js +46 -0
  196. package/lib/EditTable/utils.js +110 -0
  197. package/lib/Ellipsis/Ellipsis.js +148 -0
  198. package/lib/Ellipsis/index.js +7 -0
  199. package/lib/Ellipsis/style/index.js +26 -0
  200. package/lib/Empty/Empty.js +63 -0
  201. package/lib/Empty/image.js +3 -0
  202. package/lib/Empty/index.js +7 -0
  203. package/lib/FullPage/FullPage.js +19 -0
  204. package/lib/FullPage/index.js +7 -0
  205. package/lib/Icon/Icon.js +49 -0
  206. package/lib/Icon/index.js +7 -0
  207. package/lib/LocaleProvider/LocaleProvider.js +31 -0
  208. package/lib/LocaleProvider/index.js +7 -0
  209. package/lib/LocaleReciver/index.js +24 -0
  210. package/lib/Markdown/Markdown.js +118 -0
  211. package/lib/Markdown/index.js +7 -0
  212. package/lib/PermissionButton/PermissionButton.js +118 -0
  213. package/lib/PermissionButton/confirm.js +94 -0
  214. package/lib/PermissionButton/index.js +9 -0
  215. package/lib/PermissionButton/shared.js +1 -0
  216. package/lib/ProLayout/Basic/BasicLayout.js +422 -0
  217. package/lib/ProLayout/Basic/BasicLayoutStyle.js +51 -0
  218. package/lib/ProLayout/Basic/Header.js +111 -0
  219. package/lib/ProLayout/Basic/HeaderStyle.js +10 -0
  220. package/lib/ProLayout/PageContainer/index.js +354 -0
  221. package/lib/ProLayout/PageContainer/style.js +85 -0
  222. package/lib/ProLayout/RouteContext.js +28 -0
  223. package/lib/ProLayout/SiderMenu/BaseMenu.js +241 -0
  224. package/lib/ProLayout/SiderMenu/SiderMenu.js +274 -0
  225. package/lib/ProLayout/SiderMenu/index.js +2 -0
  226. package/lib/ProLayout/SiderMenu/style.js +204 -0
  227. package/lib/ProLayout/TopHeader/index.js +170 -0
  228. package/lib/ProLayout/TopHeader/style.js +154 -0
  229. package/lib/ProLayout/defaultSettings.js +113 -0
  230. package/lib/ProLayout/index.js +10 -0
  231. package/lib/ProLayout/style/index.js +14 -0
  232. package/lib/ProLayout/util.js +58 -0
  233. package/lib/ProTable/Alert.js +40 -0
  234. package/lib/ProTable/Content.js +97 -0
  235. package/lib/ProTable/Header.js +33 -0
  236. package/lib/ProTable/Pagination.js +55 -0
  237. package/lib/ProTable/ProTable.js +279 -0
  238. package/lib/ProTable/hooks/index.js +2 -0
  239. package/lib/ProTable/hooks/useTableInject.js +6 -0
  240. package/lib/ProTable/hooks/useTableSelection.js +115 -0
  241. package/lib/ProTable/index.js +8 -0
  242. package/lib/ProTable/setting.js +138 -0
  243. package/lib/ProTable/style/index.js +113 -0
  244. package/lib/RadioButton/RadioButton.js +53 -0
  245. package/lib/RadioButton/index.js +8 -0
  246. package/lib/RadioButton/style/index.js +25 -0
  247. package/lib/Scrollbar/Bar.js +76 -0
  248. package/lib/Scrollbar/Scrollbar.js +161 -0
  249. package/lib/Scrollbar/Thumb.js +150 -0
  250. package/lib/Scrollbar/constants.js +1 -0
  251. package/lib/Scrollbar/index.js +7 -0
  252. package/lib/Scrollbar/scrollbarProps.js +100 -0
  253. package/lib/Scrollbar/style/index.js +85 -0
  254. package/lib/Scrollbar/thumbProps.js +10 -0
  255. package/lib/Scrollbar/util.js +39 -0
  256. package/lib/Search/Item.js +239 -0
  257. package/lib/Search/Search.js +90 -0
  258. package/lib/Search/hooks/index.js +117 -0
  259. package/lib/Search/hooks/useRouteQuery.js +86 -0
  260. package/lib/Search/hooks/useSearchItems.js +50 -0
  261. package/lib/Search/hooks/useTermOptions.js +29 -0
  262. package/lib/Search/index.js +10 -0
  263. package/lib/Search/setting.js +245 -0
  264. package/lib/Search/style/index.js +5 -0
  265. package/lib/Search/style/item.js +40 -0
  266. package/lib/Search/style/search.js +177 -0
  267. package/lib/Search/util.js +270 -0
  268. package/lib/Skeleton/Skeleton.js +27 -0
  269. package/lib/Skeleton/components/DashBoardCard.js +27 -0
  270. package/lib/Skeleton/components/DashBoardChart.js +27 -0
  271. package/lib/Skeleton/components/Detail.js +27 -0
  272. package/lib/Skeleton/components/Drawer.js +27 -0
  273. package/lib/Skeleton/components/Item.js +54 -0
  274. package/lib/Skeleton/components/List.js +27 -0
  275. package/lib/Skeleton/components/ListCard.js +28 -0
  276. package/lib/Skeleton/components/ListCardItem.js +20 -0
  277. package/lib/Skeleton/components/ListTable.js +27 -0
  278. package/lib/Skeleton/components/Page.js +26 -0
  279. package/lib/Skeleton/components/Search.js +16 -0
  280. package/lib/Skeleton/components/Tree.js +27 -0
  281. package/lib/Skeleton/index.js +28 -0
  282. package/lib/Skeleton/style/index.js +195 -0
  283. package/lib/TimeFormat/TimeFormat.js +36 -0
  284. package/lib/TimeFormat/index.js +7 -0
  285. package/lib/Title/Title.js +26 -0
  286. package/lib/Title/index.js +7 -0
  287. package/lib/Title/style/index.js +34 -0
  288. package/lib/ValueItem/ValueItem.js +113 -0
  289. package/lib/ValueItem/index.js +7 -0
  290. package/lib/ValueItem/util.js +17 -0
  291. package/lib/VirtualTable/VirtualTable.js +271 -0
  292. package/lib/VirtualTable/data.js +60 -0
  293. package/lib/VirtualTable/index.js +7 -0
  294. package/lib/VirtualTable/style/index.js +34 -0
  295. package/lib/components.js +21 -0
  296. package/lib/index.js +17 -0
  297. package/lib/locale/en-US.js +120 -0
  298. package/lib/locale/zh-CN.js +120 -0
  299. package/lib/style/styleRegister.js +19 -0
  300. package/lib/style/variable.js +4 -0
  301. package/lib/style.js +1 -0
  302. package/lib/utils/constants.js +10 -0
  303. package/package.json +164 -0
@@ -0,0 +1,72 @@
1
+ export const genEditTableHeaderStyle = (config) => {
2
+ const { token } = config
3
+ return {
4
+ '.jetlinks-edit-table-header-container': {
5
+ height: '100%',
6
+ position: 'relative',
7
+ '.jetlinks-edit-table-header-cell': {
8
+ height: '100%',
9
+ display: 'inline-flex',
10
+ alignItems: 'center',
11
+ float: 'left',
12
+ overflow: 'visible',
13
+ position: 'absolute',
14
+ top: 0,
15
+ '.jetlinks-edit-table-header-cell-box': {
16
+ padding: '0 12px',
17
+ width: '100%',
18
+ '&.header-cell-box-tool': {
19
+ display: 'flex',
20
+ justifyContent: 'space-between',
21
+ alignItems: 'center'
22
+ },
23
+ '.table-header-cell-title': {
24
+ flex: 1,
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ fontWeight: 600,
28
+ gap: 4,
29
+ '.cell-title-box': {
30
+ flex: '1 1 auto'
31
+ }
32
+ },
33
+ '.header-cell-required': {
34
+ color: token.colorError,
35
+ paddingLeft: 8,
36
+ transform: 'translateY(3px)',
37
+ fontWeight: 500
38
+ },
39
+ '&::before': {
40
+ position: 'absolute',
41
+ top: '50%',
42
+ right: '1px',
43
+ width: '1px',
44
+ height: '1.6em',
45
+ pointerEvents: 'none',
46
+ backgroundColor: 'rgba(0,0,0,.06)',
47
+ transform: 'translateY(-50%)',
48
+ transition: 'background-color .3s',
49
+ content: '""'
50
+ },
51
+ '&:not(:last-child)': {
52
+ '&::before': {
53
+ backgroundColor: 'transparent'
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ '.jetlinks-table-search': {
60
+ '.jetlinks-table-search-header': {
61
+ display: 'flex',
62
+ justifyContent: 'space-between',
63
+ '.jetlinks-drag-modal-footer': {
64
+ display: 'none'
65
+ },
66
+ '.jetlinks-table-search-result-total': {
67
+ color: token.colorPrimary
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,52 @@
1
+ import { genEditTableBodyStyle } from './body'
2
+ import { genEditTableFormItemStyle } from './form'
3
+ import { genEditTableGroupStyle } from './group'
4
+ import { genEditTableHeaderStyle } from './header'
5
+ import { genTableStyle } from './table'
6
+ import { genMenuStyle } from './menu'
7
+ import genComponentStyle from '../../style/styleRegister'
8
+
9
+ const genEditTableStyle = (config) => {
10
+ const { token } = config
11
+ return {
12
+ '.edit-table-search-header': {
13
+ display: 'flex',
14
+ justifyContent: 'space-between'
15
+ },
16
+ '.edit-table-search-result-total': {
17
+ color: token.colorPrimary
18
+ },
19
+ '.jetlinks-edit-table-horizontal-scroll': {
20
+ height: 17,
21
+ width: 100,
22
+ display: 'flex',
23
+ position: 'relative',
24
+ zIndex: 4,
25
+ '.jetlinks-edit-table-horizontal-scroll-viewport': {
26
+ overflowY: 'hidden',
27
+ overflowX: 'scroll',
28
+ position: 'relative',
29
+ flex: '1 1 0',
30
+ height: '17px',
31
+ width: '100%',
32
+ '> div': {
33
+ height: '17px'
34
+ }
35
+ },
36
+ '.jetlinks-edit-table-horizontal-scroll-hidden': {
37
+ height: '100%',
38
+ overflowX: 'hidden'
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ export default genComponentStyle([
45
+ genEditTableStyle,
46
+ genEditTableBodyStyle,
47
+ genEditTableFormItemStyle,
48
+ genEditTableGroupStyle,
49
+ genEditTableHeaderStyle,
50
+ genTableStyle,
51
+ genMenuStyle
52
+ ])
@@ -0,0 +1,27 @@
1
+ export const genMenuStyle = (config) => {
2
+ const { token } = config
3
+ return {
4
+ '.jetlinks-edit-table-context-menu': {
5
+ position: 'fixed',
6
+ boxShadow: '0 0 12px rgba(0, 0, 0 ,.2)',
7
+ borderRadius: '4px',
8
+ overflow: 'hidden',
9
+ width: '192px',
10
+ padding: '4px',
11
+ backgroundColor: '#fff',
12
+ '.ant-menu': {
13
+ borderRight: 'none',
14
+ '.ant-menu-item': {
15
+ margin: 0,
16
+ height: '32px',
17
+ '&.danger': {
18
+ color: token.colorError
19
+ }
20
+ }
21
+ },
22
+ '.ant-menu-item-active': {
23
+ backgroundColor: 'var(--ant-primary-1)'
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,46 @@
1
+ export const genTableStyle = (config) => {
2
+ const { token } = config
3
+ return {
4
+ '.jetlinks-edit-table-wrapper': {
5
+ background: '#fff',
6
+ height: '100%',
7
+ position: 'relative',
8
+ '&.table-full-screen': {
9
+ padding: 24
10
+ },
11
+ '.jetlinks-edit-table': {
12
+ display: 'flex',
13
+ flexDirection: 'column',
14
+ flexGrow: 0,
15
+ flexShrink: 0,
16
+ background: '#fafafa',
17
+ transition: 'background-color .3s ease',
18
+ overflow: 'auto hidden',
19
+ '.jetlinks-edit-table-header': {
20
+ overflow: 'hidden',
21
+ width: '100%'
22
+ },
23
+ '.jetlinks-edit-table-body': {
24
+ backgroundColor: '#fff',
25
+ overflowY: 'hidden',
26
+ position: 'relative',
27
+ height: '100%',
28
+ width: '100%',
29
+ flex: '1 1 auto',
30
+ flexDirection: 'row'
31
+ },
32
+ '.jetlinks-table-horizontal-scroll': {
33
+ width: '100%',
34
+ height: '15px',
35
+ minHeight: '15px',
36
+ maxHeight: '15px',
37
+ display: 'flex',
38
+ '.jetlinks-table-horizontal-scroll-bar': {
39
+ height: '100%',
40
+ overflowX: 'scroll'
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,110 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }import { cloneDeep, omit } from 'lodash-es'
2
+
3
+ /**
4
+ * 规则收集器,收集columns中的rules和watch
5
+ * @param columns
6
+ */
7
+ export const collectValidateRules = (columns) => {
8
+ const rules = {}
9
+ columns.forEach((item) => {
10
+ if (_optionalChain([item, 'access', _ => _.form, 'optionalAccess', _2 => _2.rules])) {
11
+ let currentLevel = rules // 从最顶层开始构建
12
+ const field = item.form.field || item.dataIndex
13
+ const parts = Array.isArray(field) ? field : String(field).split(',')
14
+ for (let i = 0; i < parts.length; i++) {
15
+ const part = parts[i]
16
+ if (i === parts.length - 1) {
17
+ // 这是最深层的叶子节点
18
+ currentLevel[part] = [...item.form.rules]
19
+ } else {
20
+ // 这是中间的父节点(例如 'prop1' 或 'type')
21
+ if (!currentLevel[part]) {
22
+ // 如果当前层级还没有这个属性,就把它定义为一个对象
23
+ currentLevel[part] = {
24
+ type: 'object',
25
+ fields: {}
26
+ }
27
+ } else if (currentLevel[part].type !== 'object') {
28
+ // 如果已经存在但不是对象类型,可能是之前被错误定义为叶子节点,修正它
29
+ console.warn(
30
+ `Warning: '${parts.slice(0, i + 1).join('.')}' was expected to be an object but has other rules. Overwriting.`
31
+ )
32
+ currentLevel[part] = {
33
+ type: 'object',
34
+ fields: {}
35
+ }
36
+ }
37
+ // 进入下一层级,继续构建 `fields`
38
+ currentLevel = currentLevel[part].fields
39
+ }
40
+ }
41
+ }
42
+ })
43
+ return rules
44
+ }
45
+
46
+ export const handlePureRecord = (record) => {
47
+ if (!record) return {}
48
+ return omit(record, ['__serial', '__index', '__top', '__selected', '__key', '__dataIndex'])
49
+ }
50
+
51
+ export const handleColumnsWidth = (columns, warpWidth) => {
52
+ const newColumns = cloneDeep(columns)
53
+ let noWidthLen = 0 // 没有width属性的长度
54
+ let hasWidthCount = 0 // 有width属性的合计
55
+ let average = 0 // 每个column宽度
56
+ let parseAverage = 0 // 取整宽度
57
+ let decimalCount = 0 // 收集每个取整后的小数
58
+ let lastNoWidthIndex = undefined // 最后一个没有width属性的位置
59
+
60
+ newColumns.forEach((item) => {
61
+ if (item.width) {
62
+ hasWidthCount += item.width
63
+ } else {
64
+ noWidthLen += 1
65
+ }
66
+ })
67
+
68
+ if (noWidthLen) {
69
+ average = (warpWidth - hasWidthCount) / noWidthLen // 剩余平分分配宽度
70
+ parseAverage = Math.trunc(average)
71
+ decimalCount = (average - parseAverage) * noWidthLen
72
+ }
73
+
74
+ newColumns.forEach((item, index) => {
75
+ if (!item.width) {
76
+ lastNoWidthIndex = index
77
+ }
78
+ })
79
+
80
+ return newColumns.map((item, index) => {
81
+ let _width = item.width
82
+ let left = 0
83
+
84
+ if (!item.width) {
85
+ _width = parseAverage
86
+ }
87
+
88
+ if (index === lastNoWidthIndex) {
89
+ _width = Math.trunc(decimalCount) + parseAverage
90
+ }
91
+
92
+ if (index !== 0) {
93
+ left = newColumns[index - 1].width + newColumns[index - 1].left
94
+ }
95
+
96
+ item.width = _width
97
+ item.left = left
98
+ return item
99
+ })
100
+ }
101
+
102
+ export const isFullScreen = () => {
103
+ return !!(
104
+ (document ).fullscreen ||
105
+ (document ).mozFullScreen ||
106
+ (document ).webkitIsFullScreen ||
107
+ (document ).webkitFullScreen ||
108
+ (document ).msFullScreen
109
+ )
110
+ }
@@ -0,0 +1,148 @@
1
+
2
+ import { defineComponent, computed, ref, useAttrs, mergeProps } from 'vue'
3
+ import { Tooltip } from 'ant-design-vue'
4
+ import useEllipsisStyle from './style'
5
+
6
+ const jEllipsis = 'j-ellipsis'
7
+ const jEllipsisCursorClass = 'j-ellipsis-cursor'
8
+ const jEllipsisLineClampClass = 'j-ellipsis-line-clamp'
9
+
10
+ export default defineComponent({
11
+ name: 'JEllipsis',
12
+ components: { Tooltip },
13
+ props: {
14
+ expandTrigger: {
15
+ type: String,
16
+ default: undefined
17
+ },
18
+ /** multiline ellipsis */
19
+ lineClamp: {
20
+ type: [Number, String],
21
+ default: 1
22
+ },
23
+ tooltip: {
24
+ type: [Boolean, Object],
25
+ default: true
26
+ }
27
+ },
28
+ setup(props) {
29
+ const prefixCls = computed(() => 'j-ellipsis')
30
+ const [wrapSSR, hashId] = useEllipsisStyle(prefixCls)
31
+
32
+ // define class name
33
+ const expandedRef = ref(false)
34
+ const tooltipRef = ref(null)
35
+ const triggerRef = ref(null)
36
+ const visible = ref(false)
37
+ const attrs = useAttrs()
38
+
39
+ const handleClickRef = computed(() => {
40
+ return props.expandTrigger === 'click'
41
+ ? () => {
42
+ const { value: expanded } = expandedRef
43
+ expandedRef.value = !expanded
44
+ }
45
+ : undefined
46
+ })
47
+
48
+ const ellipsisStyleRef = computed(() => {
49
+ const { lineClamp } = props
50
+ const { value: expanded } = expandedRef
51
+ if (lineClamp !== undefined) {
52
+ return {
53
+ textOverflow: '',
54
+ '-webkit-line-clamp': expanded ? '' : lineClamp
55
+ }
56
+ } else {
57
+ return {
58
+ textOverflow: expanded ? '' : 'ellipsis',
59
+ '-webkit-line-clamp': ''
60
+ }
61
+ }
62
+ })
63
+
64
+ function triggerAttrs() {
65
+ return {
66
+ ...mergeProps(attrs, {
67
+ class: [
68
+ jEllipsis,
69
+ props.lineClamp !== undefined ? jEllipsisLineClampClass : undefined,
70
+ props.expandTrigger === 'click' ? jEllipsisCursorClass : undefined,
71
+ hashId.value
72
+ ],
73
+ style: ellipsisStyleRef.value
74
+ })
75
+ }
76
+ }
77
+
78
+ const showTooltip = () => {
79
+ const { value: trigger } = triggerRef
80
+ if (trigger) {
81
+ visible.value = trigger.scrollHeight > trigger.offsetHeight
82
+ }
83
+ }
84
+
85
+ const syncTriggerClass = (trigger, styleClass, action) => {
86
+ if (action === 'add') {
87
+ if (!trigger.classList.contains(styleClass)) {
88
+ trigger.classList.add(styleClass)
89
+ }
90
+ } else {
91
+ if (trigger.classList.contains(styleClass)) {
92
+ trigger.classList.remove(styleClass)
93
+ }
94
+ }
95
+ }
96
+
97
+ const syncEllipsisStyle = (trigger) => {
98
+ if (!trigger) return
99
+ const latestStyle = ellipsisStyleRef.value
100
+ const lineClampClass = jEllipsisLineClampClass
101
+ if (props.lineClamp !== undefined) {
102
+ syncTriggerClass(trigger, lineClampClass, 'add')
103
+ } else {
104
+ syncTriggerClass(trigger, lineClampClass, 'remove')
105
+ }
106
+ for (const key in latestStyle) {
107
+ if ((trigger.style )[key] !== (latestStyle )[key]) {
108
+ ;(trigger.style )[key] = (latestStyle )[key]
109
+ }
110
+ }
111
+ }
112
+
113
+ const syncCursorStyle = (trigger, tooltipDisabled) => {
114
+ if (props.expandTrigger === 'click' && !tooltipDisabled) {
115
+ syncTriggerClass(trigger, jEllipsisCursorClass, 'add')
116
+ } else {
117
+ syncTriggerClass(trigger, jEllipsisCursorClass, 'remove')
118
+ }
119
+ }
120
+
121
+ const getTooltipDisabled = () => {
122
+ let tooltipDisabled = false
123
+ const { value: expanded } = expandedRef
124
+ if (expanded) return true
125
+ const { value: trigger } = triggerRef
126
+ if (trigger) {
127
+ syncEllipsisStyle(trigger)
128
+ tooltipDisabled = trigger.scrollHeight <= trigger.offsetHeight
129
+ syncCursorStyle(trigger, tooltipDisabled)
130
+ }
131
+ return tooltipDisabled
132
+ }
133
+
134
+ return {
135
+ jEllipsis,
136
+ jEllipsisCursorClass,
137
+ jEllipsisLineClampClass,
138
+ hashId,
139
+ tooltipRef,
140
+ triggerRef,
141
+ visible,
142
+ handleClickRef,
143
+ triggerAttrs,
144
+ showTooltip,
145
+ getTooltipDisabled
146
+ }
147
+ }
148
+ })
@@ -0,0 +1,7 @@
1
+ import Ellipsis from './Ellipsis.js'
2
+
3
+ Ellipsis.install = function (app) {
4
+ app.component(Ellipsis.name, Ellipsis)
5
+ }
6
+
7
+ export default Ellipsis
@@ -0,0 +1,26 @@
1
+ import genComponentStyle from '../../style/styleRegister'
2
+
3
+ const genEllipsisStyle = (config) => {
4
+ const { token } = config
5
+ return {
6
+ '.j-ellipsis': {
7
+ overflow: 'hidden',
8
+ verticalAlign: 'bottom'
9
+ },
10
+ '.j-ellipsis-cursor': {
11
+ cursor: 'pointer'
12
+ },
13
+ '.j-ellipsis-line-clamp': {
14
+ display: '-webkit-box',
15
+ '-webkit-box-orient': 'vertical',
16
+ wordBreak: 'break-all'
17
+ },
18
+ '.j-ellipsis-deep': {
19
+ maxHeight: '380px',
20
+ '-webkit-line-clamp': 17,
21
+ textOverflow: 'ellipsis'
22
+ }
23
+ }
24
+ }
25
+
26
+ export default genComponentStyle([genEllipsisStyle])
@@ -0,0 +1,63 @@
1
+ import { defineComponent as _defineComponent } from 'vue'
2
+ import { unref as _unref, renderSlot as _renderSlot, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue"
3
+
4
+ import { useSlots } from 'vue'
5
+ import { Empty } from 'ant-design-vue'
6
+ import NoData from './image'
7
+ import { omit } from 'lodash-es'
8
+ import { useLocaleReceiver } from '../LocaleReciver'
9
+ import LocaleProvider from '../LocaleProvider'
10
+
11
+
12
+ const __sfc_main__ = _defineComponent({
13
+ ...{
14
+ name: 'JEmpty'
15
+ },
16
+ __name: 'Empty',
17
+ props: {
18
+ description: {
19
+ type: String
20
+ },
21
+ image: {
22
+ type: String,
23
+ default: NoData
24
+ },
25
+ imageStyle: {
26
+ type: Object,
27
+ default: () => {
28
+ return { height: '60px' }
29
+ }
30
+ }
31
+ },
32
+ setup(__props) {
33
+
34
+
35
+
36
+ const props = __props
37
+
38
+ const slots = useSlots()
39
+ const renderArr = Object.keys(slots)
40
+ const [contextLocale] = useLocaleReceiver('Empty')
41
+ const baseProps = omit({ ...props, description: props.description || contextLocale.value.description }, ...renderArr)
42
+
43
+ return (_ctx,_cache) => {
44
+ return (_openBlock(), _createBlock(_unref(LocaleProvider), null, {
45
+ default: _withCtx(() => [
46
+ _createVNode(_unref(Empty), _normalizeProps(_guardReactiveProps(_unref(baseProps))), _createSlots({ _: 2 /* DYNAMIC */ }, [
47
+ _renderList(_unref(renderArr), (item) => {
48
+ return {
49
+ name: item,
50
+ fn: _withCtx((scope) => [
51
+ _renderSlot(_ctx.$slots, item, { scope: scope })
52
+ ])
53
+ }
54
+ })
55
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */)
56
+ ]),
57
+ _: 3 /* FORWARDED */
58
+ }))
59
+ }
60
+ }
61
+
62
+ })
63
+ export default __sfc_main__;
@@ -0,0 +1,3 @@
1
+ const img = 'data:image/png;base64,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'
2
+
3
+ export default img
@@ -0,0 +1,7 @@
1
+ import Empty from './Empty.js'
2
+
3
+ Empty.install = function (app) {
4
+ app.component(Empty.name, Empty)
5
+ }
6
+
7
+ export default Empty
@@ -0,0 +1,19 @@
1
+
2
+ import { defineComponent, ref, inject } from 'vue'
3
+ import { useElementBounding } from '@vueuse/core'
4
+ import { FullPageConfig } from '../utils/constants'
5
+
6
+ export default defineComponent({
7
+ name: 'JFullPage',
8
+ setup() {
9
+ const config = inject(FullPageConfig, { reduceHeight: 24 })
10
+ const fullPage = ref(null)
11
+ const { y } = useElementBounding(fullPage)
12
+
13
+ return {
14
+ config,
15
+ fullPage,
16
+ y
17
+ }
18
+ }
19
+ })
@@ -0,0 +1,7 @@
1
+ import FullPage from './FullPage.js'
2
+
3
+ FullPage.install = function (app) {
4
+ app.component(FullPage.name, FullPage)
5
+ }
6
+
7
+ export default FullPage
@@ -0,0 +1,49 @@
1
+
2
+ import { defineComponent, watchEffect, inject, h } from 'vue'
3
+ import * as aIcon from '@ant-design/icons-vue'
4
+ import { createFromIconfontCN } from '@ant-design/icons-vue'
5
+ import { ComponentsEnum } from '../utils/constants'
6
+
7
+ let MyIcon = createFromIconfontCN({
8
+ scriptUrl: '//at.alicdn.com/t/c/font_3183515_i7oma42he.js' // 在 iconfont.cn 上生成
9
+ })
10
+
11
+ const AntdIcon = (props) => {
12
+ return h((aIcon )[props.type])
13
+ }
14
+
15
+ const Icon = (props) => {
16
+ return Object.keys(aIcon).includes(props.type)
17
+ ? h(AntdIcon, props)
18
+ : h(MyIcon, props)
19
+ }
20
+
21
+ export default defineComponent({
22
+ name: 'AIcon',
23
+ props: ['type', 'scriptUrl', 'class'],
24
+ emits: ['click'],
25
+ setup(props, { emit, attrs }) {
26
+ const config = inject(ComponentsEnum.Icon, {})
27
+
28
+ watchEffect(() => {
29
+ const url = props.scriptUrl || config.scriptUrl
30
+ if (url) {
31
+ MyIcon = createFromIconfontCN({
32
+ scriptUrl: url
33
+ })
34
+ }
35
+ })
36
+
37
+ const click = () => {
38
+ emit('click')
39
+ }
40
+
41
+ return () => {
42
+ return h(Icon, {
43
+ ...props,
44
+ style: attrs.style,
45
+ onClick: click
46
+ })
47
+ }
48
+ }
49
+ })
@@ -0,0 +1,7 @@
1
+ import AIcon from './Icon.js'
2
+
3
+ AIcon.install = function (app) {
4
+ app.component(AIcon.name, AIcon)
5
+ }
6
+
7
+ export default AIcon
@@ -0,0 +1,31 @@
1
+
2
+ import { defineComponent, provide, reactive, watch } from 'vue'
3
+ import defaultLocal from '../locale/zh-CN'
4
+
5
+ export default defineComponent({
6
+ name: 'JLocaleProvider',
7
+ props: {
8
+ locale: {
9
+ type: Object
10
+ }
11
+ },
12
+ setup(props) {
13
+ const state = reactive({
14
+ antLocale: {
15
+ ...props.locale || defaultLocal || {},
16
+ exist: true
17
+ }
18
+ })
19
+
20
+ watch(() => props.locale, () => {
21
+ state.antLocale = {
22
+ ...props.locale || defaultLocal || {},
23
+ exist: true
24
+ }
25
+ }, { deep: true })
26
+
27
+ provide('componentLocaleData', state)
28
+
29
+ return {}
30
+ }
31
+ })