@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,195 @@
1
+ import { Keyframes } from 'ant-design-vue'
2
+ import genComponentStyle from '../../style/styleRegister'
3
+
4
+ const JSkeletonSizeLg = '36px'
5
+ const JSkeletonSizeSm = '16px'
6
+ const JSkeletonSize = '24px'
7
+ const JSkeletonBorderRadius = '8px'
8
+ const JSkeletonBg = '#f0f2f5'
9
+ const JSkeletonBg1 = '#e6e8eb'
10
+ const JSkeletonBorder = `4px solid ${JSkeletonBg}`
11
+
12
+ const JSkeletonFlex = {
13
+ display: 'flex',
14
+ gap: '24px',
15
+ marginBottom: '16px'
16
+ }
17
+
18
+ // 动画
19
+ const waveKeyframes = new Keyframes('wave', {
20
+ '0%': {
21
+ backgroundPosition: '200% 0'
22
+ },
23
+ '100%': {
24
+ backgroundPosition: '-200% 0'
25
+ }
26
+ })
27
+
28
+ const genSkeletonStyle = (config) => {
29
+ const { componentCls } = config
30
+
31
+ return {
32
+ [`${componentCls}-flex`]: JSkeletonFlex,
33
+
34
+ [`${componentCls}-flex-between`]: {
35
+ ...JSkeletonFlex,
36
+ justifyContent: 'space-between'
37
+ },
38
+
39
+ [`${componentCls}-flex-column`]: {
40
+ ...JSkeletonFlex,
41
+ flexDirection: 'column'
42
+ },
43
+
44
+ [componentCls]: {
45
+ height: '100%',
46
+
47
+ [`${componentCls}-item`]: {
48
+ background: `linear-gradient(90deg, ${JSkeletonBg} 25%, ${JSkeletonBg1} 50%, ${JSkeletonBg} 75%)`,
49
+ backgroundSize: '400% 100%',
50
+ borderRadius: JSkeletonBorderRadius,
51
+ height: JSkeletonSize
52
+ },
53
+
54
+ [`${componentCls}-item-active`]: {
55
+ animationName: waveKeyframes,
56
+ animationDuration: '1.8s',
57
+ animationIterationCount: 'infinite',
58
+ animationTimingFunction: 'ease-in-out'
59
+ },
60
+
61
+ [`${componentCls}-item-lg`]: {
62
+ height: JSkeletonSizeLg
63
+ },
64
+
65
+ [`${componentCls}-item-sm`]: {
66
+ height: JSkeletonSizeSm
67
+ },
68
+
69
+ [`${componentCls}-item-large`]: {
70
+ height: JSkeletonSizeLg
71
+ },
72
+
73
+ [`${componentCls}-dashboard-card`]: {
74
+ ...JSkeletonFlex,
75
+ border: JSkeletonBorder,
76
+ borderRadius: JSkeletonBorderRadius,
77
+ height: '100%',
78
+ padding: '24px',
79
+ flexDirection: 'column'
80
+ },
81
+
82
+ [`${componentCls}-tabs`]: {
83
+ display: 'flex',
84
+ gap: '16px',
85
+ margin: '60px 0 20px 0',
86
+ borderBottom: JSkeletonBorder,
87
+ padding: '16px 0'
88
+ },
89
+
90
+ [`${componentCls}-desc`]: {
91
+ display: 'flex',
92
+ flexDirection: 'column',
93
+ marginBottom: '24px',
94
+
95
+ [`${componentCls}-desc-content`]: {
96
+ display: 'grid',
97
+ gridTemplateColumns: 'repeat(3, 1fr)',
98
+ gap: '36px',
99
+ margin: '24px 0 0 0'
100
+ },
101
+
102
+ [`${componentCls}-desc-item`]: {
103
+ display: 'flex',
104
+ gap: '16px'
105
+ }
106
+ },
107
+
108
+ [`${componentCls}-box`]: {
109
+ borderBottom: JSkeletonBorder,
110
+ padding: '16px 0'
111
+ },
112
+
113
+ [`${componentCls}-table`]: {
114
+ marginTop: '16px'
115
+ },
116
+
117
+ [`${componentCls}-table-cell`]: {
118
+ display: 'grid',
119
+ gridTemplateColumns: 'repeat(auto-fit, minmax(0, 1fr)) 200px',
120
+ gap: '24px',
121
+ padding: '12px 6px',
122
+ borderRadius: '8px'
123
+ },
124
+
125
+ [`${componentCls}-table-header`]: {
126
+ backgroundColor: 'lightgrey'
127
+ },
128
+
129
+ [`${componentCls}-table-action`]: {
130
+ width: '200px',
131
+ display: 'grid',
132
+ gridTemplateColumns: 'repeat(auto-fit, minmax(0, 1fr))',
133
+ gap: '24px'
134
+ },
135
+
136
+ [`${componentCls}-cards`]: {
137
+ display: 'grid',
138
+ gridTemplateColumns: 'repeat(3, 1fr)',
139
+ gap: '16px'
140
+ },
141
+
142
+ [`${componentCls}-card`]: {
143
+ [`${componentCls}-card-content`]: {
144
+ display: 'flex',
145
+ gap: '16px',
146
+ border: '2px solid #f0f2f5',
147
+ borderRadius: '8px',
148
+ padding: '24px',
149
+ marginBottom: '16px',
150
+
151
+ [`${componentCls}-image`]: {
152
+ width: '100px',
153
+ height: '100px'
154
+ },
155
+
156
+ [`${componentCls}-right`]: {
157
+ flex: 1,
158
+ minWidth: '200px',
159
+
160
+ [`${componentCls}-right-content`]: {
161
+ display: 'flex',
162
+ gap: '16px',
163
+ marginTop: '16px',
164
+
165
+ [`${componentCls}-right-content-item`]: {
166
+ flex: 1,
167
+ minWidth: '100px',
168
+ display: 'flex',
169
+ flexDirection: 'column',
170
+ gap: '16px'
171
+ }
172
+ }
173
+ }
174
+ },
175
+
176
+ [`${componentCls}-action`]: {
177
+ display: 'flex',
178
+ justifyContent: 'flex-end',
179
+ gap: '16px',
180
+
181
+ '.btn': {
182
+ flex: 1,
183
+ minWidth: '100px'
184
+ },
185
+
186
+ '.delete': {
187
+ flex: '0 0 100px'
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+
195
+ export default genComponentStyle([genSkeletonStyle])
@@ -0,0 +1,36 @@
1
+
2
+ import { defineComponent, computed } from 'vue'
3
+ import dayjs from 'dayjs'
4
+
5
+ export default defineComponent({
6
+ name: 'JTimeFormat',
7
+ props: {
8
+ time: {
9
+ type: [String, Number, undefined]
10
+ },
11
+ format: {
12
+ type: String
13
+ }
14
+ },
15
+ setup(props) {
16
+ const handleValue = (time, format) => {
17
+ const value = Number(time)
18
+ const _format = format || 'YYYY-MM-DD HH:mm:ss'
19
+ if (!isNaN(value)) {
20
+ return dayjs(value).format(_format)
21
+ }
22
+ return time
23
+ }
24
+
25
+ const timeFormat = computed(() => {
26
+ if (props.time) {
27
+ return handleValue(props.time, props.format)
28
+ }
29
+ return props.time
30
+ })
31
+
32
+ return {
33
+ timeFormat
34
+ }
35
+ }
36
+ })
@@ -0,0 +1,7 @@
1
+ import TimeFormat from './TimeFormat.js'
2
+
3
+ TimeFormat.install = function (app) {
4
+ app.component(TimeFormat.name, TimeFormat)
5
+ }
6
+
7
+ export default TimeFormat
@@ -0,0 +1,26 @@
1
+
2
+ import { defineComponent, computed } from 'vue'
3
+ import useTitleStyle from './style'
4
+
5
+ export default defineComponent({
6
+ name: 'JTitle',
7
+ props: {
8
+ data: {
9
+ type: String,
10
+ default: ''
11
+ },
12
+ style: {
13
+ type: Object,
14
+ default: () => ({})
15
+ }
16
+ },
17
+ setup(props) {
18
+ const prefixCls = computed(() => 'j-title')
19
+ const [wrapSSR, hashId] = useTitleStyle(prefixCls)
20
+
21
+ return {
22
+ prefixCls,
23
+ hashId
24
+ }
25
+ }
26
+ })
@@ -0,0 +1,7 @@
1
+ import Title from './Title.js'
2
+
3
+ Title.install = function (app) {
4
+ app.component(Title.name, Title)
5
+ }
6
+
7
+ export default Title
@@ -0,0 +1,34 @@
1
+ import genComponentStyle from '../../style/styleRegister'
2
+
3
+ const genTitleStyle = (config) => {
4
+ const { componentCls, token } = config
5
+
6
+ return {
7
+ [componentCls]: {
8
+ display: 'flex',
9
+ alignItems: 'center',
10
+ width: '100%',
11
+ marginBottom: '16px',
12
+
13
+ [`${componentCls}-content`]: {
14
+ position: 'relative',
15
+ paddingLeft: '10px',
16
+ color: 'rgba(0, 0, 0, 0.8)',
17
+ fontWeight: 600,
18
+ lineHeight: 1,
19
+ '&::before': {
20
+ position: 'absolute',
21
+ top: 0,
22
+ left: 0,
23
+ width: 4,
24
+ height: '100%',
25
+ background: '#1890ff',
26
+ borderRadius: '0 3px 3px 0',
27
+ content: '""'
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ export default genComponentStyle([genTitleStyle])
@@ -0,0 +1,113 @@
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; }
2
+ import { defineComponent, ref, watch, computed } from 'vue'
3
+ import { componentsType } from './util'
4
+ import {
5
+ Select,
6
+ DatePicker,
7
+ TimePicker,
8
+ Input,
9
+ InputNumber,
10
+ InputPassword,
11
+ Upload,
12
+ } from 'ant-design-vue'
13
+ import { omit } from 'lodash-es'
14
+
15
+ export default defineComponent({
16
+ name: 'JValueItem',
17
+ components: {
18
+ Select,
19
+ DatePicker,
20
+ TimePicker,
21
+ Input,
22
+ InputNumber,
23
+ InputPassword,
24
+ Upload,
25
+ },
26
+ props: {
27
+ // 组件双向绑定的值
28
+ modelValue: {
29
+ type: [Number, String],
30
+ default: '',
31
+ },
32
+ // 组件类型
33
+ itemType: {
34
+ type: String,
35
+ default: 'string',
36
+ },
37
+ // 多选框
38
+ mode: {
39
+ type: String,
40
+ default: undefined,
41
+ },
42
+ placeholder: String,
43
+ options: Array,
44
+ style: Object,
45
+ class: String,
46
+ valueFormat: String,
47
+ action: [String, Promise] ,
48
+ headers: Object,
49
+ disabled: Boolean,
50
+ extraProps: {
51
+ type: Object,
52
+ default: () => ({})
53
+ },
54
+ handleFileChange: {
55
+ type: Function,
56
+ }
57
+ },
58
+ emits: ['update:modelValue', 'change'],
59
+ setup(props, { emit }) {
60
+ const typeMap = new Map(Object.entries(componentsType))
61
+ const myValue = ref(undefined)
62
+ const objectValue = ref('')
63
+
64
+ const bindProps = computed(() => {
65
+ return Object.assign(omit(props, ['extraProps']), props.extraProps)
66
+ })
67
+
68
+ const handleItemModalSubmit = () => {
69
+ myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '')
70
+ emit('update:modelValue', objectValue.value)
71
+ emit('change', objectValue.value)
72
+ }
73
+
74
+ const onChange = (e) => {
75
+ emit('update:modelValue', myValue.value)
76
+ emit('change', e && e.target ? e.target.value : e)
77
+ }
78
+
79
+ const monacoCancel = () => {
80
+ objectValue.value = props.modelValue
81
+ }
82
+
83
+ const handleFileChangeInternal = async (info) => {
84
+ if (info.file.status === 'done') {
85
+ let url = _optionalChain([info, 'optionalAccess', _ => _.file, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.result, 'optionalAccess', _4 => _4.accessUrl])
86
+ if (props.handleFileChange) {
87
+ url = await props.handleFileChange(info, info.file.response)
88
+ }
89
+ myValue.value = url
90
+ emit('update:modelValue', url)
91
+ emit('change', url)
92
+ }
93
+ }
94
+
95
+ watch(() => props.modelValue, () => {
96
+ myValue.value = props.modelValue
97
+ if (props.itemType === 'object') {
98
+ objectValue.value = props.modelValue
99
+ }
100
+ }, { immediate: true })
101
+
102
+ return {
103
+ typeMap,
104
+ myValue,
105
+ objectValue,
106
+ bindProps,
107
+ handleItemModalSubmit,
108
+ onChange,
109
+ monacoCancel,
110
+ handleFileChangeInternal,
111
+ }
112
+ }
113
+ })
@@ -0,0 +1,7 @@
1
+ import ValueItem from './ValueItem.js'
2
+
3
+ ValueItem.install = function (app) {
4
+ app.component(ValueItem.name, ValueItem)
5
+ }
6
+
7
+ export default ValueItem
@@ -0,0 +1,17 @@
1
+ export const componentsType = {
2
+ int: 'inputNumber',
3
+ long: 'inputNumber',
4
+ float: 'inputNumber',
5
+ double: 'inputNumber',
6
+ string: 'input',
7
+ array: 'input',
8
+ password: 'password',
9
+ enum: 'select',
10
+ select: 'select',
11
+ boolean: 'select',
12
+ date: 'date',
13
+ time: 'time',
14
+ object: 'object',
15
+ geoPoint: 'geoPoint',
16
+ file: 'file'
17
+ }