@jetlinks-web/components 2.7.0 → 3.0.0

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 (284) hide show
  1. package/es/AutoComplete/AutoComplete.js +2 -3
  2. package/es/BadgeStatus/Badge.js +2 -3
  3. package/es/CardSelect/CardSelect.js +23 -18
  4. package/es/CardSelect/style/index.js +25 -1
  5. package/es/CheckButton/CheckButton.js +12 -4
  6. package/es/CheckButton/style/index.js +41 -1
  7. package/es/ConfigProvider/index.js +1 -1
  8. package/es/DragModal/DragModal.js +15 -9
  9. package/es/DragModal/style/index.js +64 -1
  10. package/es/EditTable/Body.js +10 -3
  11. package/es/EditTable/EditTable.js +14 -8
  12. package/es/EditTable/FormItem.js +15 -10
  13. package/es/EditTable/Header.js +16 -6
  14. package/es/EditTable/components/ContextMenu/Menu.js +12 -6
  15. package/es/EditTable/components/Search/search.js +1 -2
  16. package/es/EditTable/components/Search/sort.js +1 -3
  17. package/es/EditTable/group.js +24 -19
  18. package/es/EditTable/hooks/useValidate.js +1 -1
  19. package/es/EditTable/style/body.js +53 -0
  20. package/es/EditTable/style/form.js +24 -0
  21. package/es/EditTable/style/group.js +25 -0
  22. package/es/EditTable/style/header.js +58 -0
  23. package/es/EditTable/style/index.js +42 -1
  24. package/es/EditTable/style/menu.js +27 -0
  25. package/es/EditTable/style/table.js +46 -0
  26. package/es/EditTable/utils.js +1 -1
  27. package/es/Ellipsis/Ellipsis.js +11 -3
  28. package/es/Ellipsis/style/index.js +24 -1
  29. package/es/Empty/Empty.js +1 -1
  30. package/es/FullPage/FullPage.js +1 -2
  31. package/es/LocaleProvider/index.js +1 -2
  32. package/es/PermissionButton/index.js +4 -5
  33. package/es/ProLayout/Basic/BasicLayout.js +46 -42
  34. package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
  35. package/es/ProLayout/Basic/Header.js +4 -8
  36. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  37. package/es/ProLayout/PageContainer/index.js +20 -16
  38. package/es/ProLayout/PageContainer/style.js +46 -0
  39. package/es/ProLayout/SiderMenu/BaseMenu.js +14 -37
  40. package/es/ProLayout/SiderMenu/SiderMenu.js +25 -36
  41. package/es/ProLayout/SiderMenu/style.js +166 -0
  42. package/es/ProLayout/TopHeader/index.js +12 -11
  43. package/es/ProLayout/TopHeader/style.js +126 -0
  44. package/es/ProLayout/style/index.js +7 -1
  45. package/es/ProLayout/util.js +5 -5
  46. package/es/ProTable/Alert.js +13 -5
  47. package/es/ProTable/Content.js +22 -14
  48. package/es/ProTable/Header.js +22 -12
  49. package/es/ProTable/Pagination.js +13 -5
  50. package/es/ProTable/ProTable.js +43 -27
  51. package/es/ProTable/setting.js +1 -1
  52. package/es/ProTable/style/index.js +109 -1
  53. package/es/RadioButton/RadioButton.js +10 -4
  54. package/es/RadioButton/style/index.js +23 -1
  55. package/es/Scrollbar/Scrollbar.js +10 -3
  56. package/es/Scrollbar/Thumb.js +36 -25
  57. package/es/Scrollbar/style/index.js +63 -1
  58. package/es/Search/Advanced/History.js +24 -17
  59. package/es/Search/Advanced/SaveHistory.js +2 -3
  60. package/es/Search/Advanced/index.js +213 -293
  61. package/es/Search/Item.js +175 -415
  62. package/es/Search/Search.js +78 -172
  63. package/es/Search/hooks/index.js +108 -1
  64. package/es/Search/hooks/useRouteQuery.js +57 -0
  65. package/es/Search/setting.js +132 -14
  66. package/es/Search/style/index.js +4 -2
  67. package/es/Search/style/item.js +28 -0
  68. package/es/Search/style/search.js +133 -0
  69. package/es/Search/util.js +116 -124
  70. package/es/Skeleton/components/DashBoardCard.js +64 -0
  71. package/es/Skeleton/components/DashBoardChart.js +96 -0
  72. package/es/Skeleton/components/Detail.js +110 -0
  73. package/es/Skeleton/components/Drawer.js +91 -0
  74. package/es/Skeleton/components/Item.js +68 -0
  75. package/es/Skeleton/components/List.js +45 -0
  76. package/es/Skeleton/components/ListCard.js +63 -0
  77. package/es/Skeleton/components/ListCardItem.js +86 -0
  78. package/es/Skeleton/components/ListTable.js +76 -0
  79. package/es/Skeleton/components/Page.js +62 -0
  80. package/es/Skeleton/components/Search.js +54 -0
  81. package/es/Skeleton/components/Tree.js +72 -0
  82. package/es/Skeleton/index.js +15 -0
  83. package/es/Skeleton/skeleton.js +58 -0
  84. package/es/Skeleton/style/index.js +132 -0
  85. package/es/Title/style/index.js +29 -1
  86. package/es/Title/title.js +13 -5
  87. package/es/ValueItem/ValueItem.js +29 -72
  88. package/es/components.js +0 -3
  89. package/es/locale/en-US.js +0 -7
  90. package/es/locale/zh-CN.js +0 -7
  91. package/es/style/index.js +0 -3
  92. package/es/style/styleRegister.js +21 -0
  93. package/es/style/variable.js +4 -0
  94. package/es/style.js +0 -12
  95. package/lib/AutoComplete/AutoComplete.js +1 -2
  96. package/lib/BadgeStatus/Badge.js +2 -3
  97. package/lib/CardSelect/CardSelect.js +23 -18
  98. package/lib/CardSelect/style/index.js +30 -1
  99. package/lib/CheckButton/CheckButton.js +12 -4
  100. package/lib/CheckButton/style/index.js +46 -1
  101. package/lib/ConfigProvider/context.js +1 -1
  102. package/lib/ConfigProvider/index.js +3 -3
  103. package/lib/DragModal/DragModal.js +15 -9
  104. package/lib/DragModal/style/index.js +69 -1
  105. package/lib/EditTable/Body.js +10 -3
  106. package/lib/EditTable/EditTable.js +13 -7
  107. package/lib/EditTable/FormItem.js +16 -11
  108. package/lib/EditTable/Header.js +16 -6
  109. package/lib/EditTable/components/ContextMenu/Menu.js +12 -6
  110. package/lib/EditTable/components/Search/search.js +1 -2
  111. package/lib/EditTable/components/Search/sort.js +1 -3
  112. package/lib/EditTable/group.js +24 -19
  113. package/lib/EditTable/hooks/useValidate.js +1 -1
  114. package/lib/EditTable/style/body.js +60 -0
  115. package/lib/EditTable/style/form.js +31 -0
  116. package/lib/EditTable/style/group.js +32 -0
  117. package/lib/EditTable/style/header.js +65 -0
  118. package/lib/EditTable/style/index.js +47 -1
  119. package/lib/EditTable/style/menu.js +33 -0
  120. package/lib/EditTable/style/table.js +52 -0
  121. package/lib/EditTable/utils.js +1 -1
  122. package/lib/Ellipsis/Ellipsis.js +11 -3
  123. package/lib/Ellipsis/style/index.js +29 -1
  124. package/lib/Empty/Empty.js +1 -1
  125. package/lib/FullPage/FullPage.js +1 -2
  126. package/lib/LocaleProvider/index.js +1 -2
  127. package/lib/PermissionButton/index.js +9 -10
  128. package/lib/ProLayout/Basic/BasicLayout.js +55 -51
  129. package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
  130. package/lib/ProLayout/Basic/Header.js +6 -10
  131. package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
  132. package/lib/ProLayout/PageContainer/index.js +24 -20
  133. package/lib/ProLayout/PageContainer/style.js +53 -0
  134. package/lib/ProLayout/SiderMenu/BaseMenu.js +18 -40
  135. package/lib/ProLayout/SiderMenu/SiderMenu.js +28 -39
  136. package/lib/ProLayout/SiderMenu/style.js +173 -0
  137. package/lib/ProLayout/TopHeader/index.js +12 -10
  138. package/lib/ProLayout/TopHeader/style.js +133 -0
  139. package/lib/ProLayout/defaultSettings.js +1 -1
  140. package/lib/ProLayout/style/index.js +12 -1
  141. package/lib/ProLayout/util.js +5 -5
  142. package/lib/ProTable/Alert.js +13 -5
  143. package/lib/ProTable/Content.js +22 -14
  144. package/lib/ProTable/Header.js +22 -12
  145. package/lib/ProTable/Pagination.js +13 -5
  146. package/lib/ProTable/ProTable.js +43 -27
  147. package/lib/ProTable/setting.js +3 -3
  148. package/lib/ProTable/style/index.js +114 -1
  149. package/lib/RadioButton/RadioButton.js +10 -4
  150. package/lib/RadioButton/style/index.js +28 -1
  151. package/lib/Scrollbar/Scrollbar.js +10 -3
  152. package/lib/Scrollbar/Thumb.js +36 -25
  153. package/lib/Scrollbar/style/index.js +68 -1
  154. package/lib/Search/Advanced/History.js +24 -17
  155. package/lib/Search/Advanced/SaveHistory.js +2 -3
  156. package/lib/Search/Advanced/index.js +213 -293
  157. package/lib/Search/Item.js +175 -415
  158. package/lib/Search/Search.js +78 -172
  159. package/lib/Search/hooks/index.js +130 -1
  160. package/lib/Search/hooks/useRouteQuery.js +64 -0
  161. package/lib/Search/setting.js +133 -15
  162. package/lib/Search/style/index.js +9 -2
  163. package/lib/Search/style/item.js +35 -0
  164. package/lib/Search/style/search.js +140 -0
  165. package/lib/Search/util.js +116 -124
  166. package/lib/Skeleton/components/DashBoardCard.js +64 -0
  167. package/lib/Skeleton/components/DashBoardChart.js +96 -0
  168. package/lib/Skeleton/components/Detail.js +110 -0
  169. package/lib/Skeleton/components/Drawer.js +91 -0
  170. package/lib/Skeleton/components/Item.js +68 -0
  171. package/lib/Skeleton/components/List.js +45 -0
  172. package/lib/Skeleton/components/ListCard.js +63 -0
  173. package/lib/Skeleton/components/ListCardItem.js +86 -0
  174. package/lib/Skeleton/components/ListTable.js +76 -0
  175. package/lib/Skeleton/components/Page.js +62 -0
  176. package/lib/Skeleton/components/Search.js +54 -0
  177. package/lib/Skeleton/components/Tree.js +72 -0
  178. package/lib/Skeleton/index.js +75 -0
  179. package/lib/Skeleton/skeleton.js +58 -0
  180. package/lib/Skeleton/style/index.js +139 -0
  181. package/lib/Title/style/index.js +34 -1
  182. package/lib/Title/title.js +13 -5
  183. package/lib/ValueItem/ValueItem.js +29 -72
  184. package/lib/components.js +0 -21
  185. package/lib/locale/en-US.js +0 -7
  186. package/lib/locale/zh-CN.js +0 -7
  187. package/lib/style/components.less +0 -1
  188. package/lib/style/index.js +1 -4
  189. package/lib/style/styleRegister.js +28 -0
  190. package/lib/style/variable.js +10 -0
  191. package/lib/style.js +1 -14
  192. package/package.json +13 -14
  193. package/es/AMap/Map.js +0 -133
  194. package/es/AMap/index.js +0 -5
  195. package/es/AMap/util.js +0 -56
  196. package/es/CardSelect/style/index.css +0 -24
  197. package/es/CardSelect/style/index.less +0 -26
  198. package/es/CheckButton/style/index.css +0 -37
  199. package/es/CheckButton/style/index.less +0 -40
  200. package/es/DragModal/style/index.css +0 -82
  201. package/es/DragModal/style/index.less +0 -97
  202. package/es/Echarts/Echarts.js +0 -48
  203. package/es/Echarts/index.js +0 -5
  204. package/es/EditTable/style/body.less +0 -66
  205. package/es/EditTable/style/form.less +0 -33
  206. package/es/EditTable/style/group.less +0 -32
  207. package/es/EditTable/style/header.less +0 -77
  208. package/es/EditTable/style/index.css +0 -267
  209. package/es/EditTable/style/index.less +0 -41
  210. package/es/EditTable/style/menu.less +0 -25
  211. package/es/EditTable/style/table.less +0 -47
  212. package/es/Ellipsis/style/index.css +0 -17
  213. package/es/Ellipsis/style/index.less +0 -20
  214. package/es/MonacoEditor/Monaco.js +0 -242
  215. package/es/MonacoEditor/index.js +0 -5
  216. package/es/MonacoEditor/style/index.css +0 -4
  217. package/es/MonacoEditor/style/index.js +0 -1
  218. package/es/MonacoEditor/style/index.less +0 -4
  219. package/es/ProLayout/Basic/BasicLayout.less +0 -66
  220. package/es/ProLayout/Basic/Header.less +0 -8
  221. package/es/ProLayout/PageContainer/index.less +0 -103
  222. package/es/ProLayout/SiderMenu/index.less +0 -231
  223. package/es/ProLayout/TopHeader/index.less +0 -174
  224. package/es/ProLayout/style/default.less +0 -4
  225. package/es/ProLayout/style/style.less +0 -7
  226. package/es/ProTable/style/ProTable.less +0 -141
  227. package/es/RadioButton/style/index.css +0 -20
  228. package/es/RadioButton/style/index.less +0 -19
  229. package/es/Scrollbar/style/index.css +0 -65
  230. package/es/Scrollbar/style/index.less +0 -83
  231. package/es/Search/style/Item.less +0 -33
  232. package/es/Search/style/Search.less +0 -179
  233. package/es/Title/style/index.css +0 -23
  234. package/es/Title/style/index.less +0 -25
  235. package/es/style/index.css +0 -5197
  236. package/es/style/index.less +0 -13
  237. package/es/style/variable.css +0 -4
  238. package/es/style/variable.less +0 -4
  239. package/lib/AMap/Map.js +0 -133
  240. package/lib/AMap/index.js +0 -12
  241. package/lib/AMap/util.js +0 -62
  242. package/lib/CardSelect/style/index.css +0 -24
  243. package/lib/CardSelect/style/index.less +0 -26
  244. package/lib/CheckButton/style/index.css +0 -37
  245. package/lib/CheckButton/style/index.less +0 -40
  246. package/lib/DragModal/style/index.css +0 -82
  247. package/lib/DragModal/style/index.less +0 -97
  248. package/lib/Echarts/Echarts.js +0 -48
  249. package/lib/Echarts/index.js +0 -12
  250. package/lib/EditTable/style/body.less +0 -66
  251. package/lib/EditTable/style/form.less +0 -33
  252. package/lib/EditTable/style/group.less +0 -32
  253. package/lib/EditTable/style/header.less +0 -77
  254. package/lib/EditTable/style/index.css +0 -267
  255. package/lib/EditTable/style/index.less +0 -41
  256. package/lib/EditTable/style/menu.less +0 -25
  257. package/lib/EditTable/style/table.less +0 -47
  258. package/lib/Ellipsis/style/index.css +0 -17
  259. package/lib/Ellipsis/style/index.less +0 -20
  260. package/lib/MonacoEditor/Monaco.js +0 -242
  261. package/lib/MonacoEditor/index.js +0 -12
  262. package/lib/MonacoEditor/style/index.css +0 -4
  263. package/lib/MonacoEditor/style/index.js +0 -3
  264. package/lib/MonacoEditor/style/index.less +0 -4
  265. package/lib/ProLayout/Basic/BasicLayout.less +0 -66
  266. package/lib/ProLayout/Basic/Header.less +0 -8
  267. package/lib/ProLayout/PageContainer/index.less +0 -103
  268. package/lib/ProLayout/SiderMenu/index.less +0 -231
  269. package/lib/ProLayout/TopHeader/index.less +0 -174
  270. package/lib/ProLayout/style/default.less +0 -4
  271. package/lib/ProLayout/style/style.less +0 -7
  272. package/lib/ProTable/style/ProTable.less +0 -141
  273. package/lib/RadioButton/style/index.css +0 -20
  274. package/lib/RadioButton/style/index.less +0 -19
  275. package/lib/Scrollbar/style/index.css +0 -65
  276. package/lib/Scrollbar/style/index.less +0 -83
  277. package/lib/Search/style/Item.less +0 -33
  278. package/lib/Search/style/Search.less +0 -179
  279. package/lib/Title/style/index.css +0 -23
  280. package/lib/Title/style/index.less +0 -25
  281. package/lib/style/index.css +0 -5197
  282. package/lib/style/index.less +0 -13
  283. package/lib/style/variable.css +0 -4
  284. package/lib/style/variable.less +0 -4
@@ -0,0 +1,28 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ export var genItemStyle = function genItemStyle(config) {
3
+ var componentCls = config.componentCls;
4
+ return _defineProperty({}, "".concat(componentCls, "-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
5
+ display: 'flex',
6
+ gap: '16px',
7
+ alignItems: 'center'
8
+ }, "".concat(componentCls, "-item--type"), {
9
+ width: '90px',
10
+ minWidth: '0',
11
+ '> span': {
12
+ lineHeight: '34px',
13
+ fontWeight: 'bold'
14
+ }
15
+ }), "".concat(componentCls, "-item--column"), {
16
+ width: '130px',
17
+ minWidth: '0'
18
+ }), "".concat(componentCls, "-item--termType"), {
19
+ width: '110px',
20
+ minWidth: '0'
21
+ }), "".concat(componentCls, "-item--label"), {
22
+ minWidth: '40px'
23
+ }), "".concat(componentCls, "-item--value"), {
24
+ display: 'flex',
25
+ width: '0',
26
+ flexGrow: 1
27
+ }));
28
+ };
@@ -0,0 +1,133 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ export var genSearchStyle = function genSearchStyle(config) {
3
+ var componentCls = config.componentCls,
4
+ token = config.token;
5
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-warp"), _defineProperty(_defineProperty(_defineProperty({
6
+ padding: '24px',
7
+ backgroundColor: '#fff',
8
+ marginBottom: '24px',
9
+ '.pack-up': _defineProperty({}, "".concat(componentCls, "-items"), {
10
+ flex: '1 1 auto',
11
+ '.left': {
12
+ minWidth: '380px',
13
+ maxWidth: '580px'
14
+ }
15
+ }),
16
+ '&.senior': _defineProperty({}, "> ".concat(componentCls, "-content"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
17
+ display: 'flex'
18
+ }, "".concat(componentCls, "-footer"), _defineProperty({
19
+ display: 'flex',
20
+ gap: '64px',
21
+ position: 'relative',
22
+ '.more-btn': {
23
+ '.more-text': {
24
+ paddingRight: '24px'
25
+ },
26
+ '.more-icon': {
27
+ transition: 'transform 0.3s',
28
+ transform: 'rotateZ(90deg)',
29
+ fontSize: '14px',
30
+ '&.more-up': {
31
+ transform: 'rotateZ(-90deg)'
32
+ }
33
+ }
34
+ },
35
+ '&.expand': {
36
+ marginTop: '16px',
37
+ width: '100%',
38
+ justifyContent: 'space-between'
39
+ }
40
+ }, "".concat(componentCls, "-footer--btns"), {
41
+ display: 'flex',
42
+ gap: '12px'
43
+ })), '.items-expand', {
44
+ display: 'flex',
45
+ gap: '16px',
46
+ '.left,& .right': {
47
+ minWidth: 0,
48
+ flex: '1 1 0'
49
+ },
50
+ '.left-items, & .right-items': {
51
+ display: 'flex',
52
+ gap: '16px',
53
+ flexDirection: 'column'
54
+ },
55
+ '.center': {
56
+ display: 'flex',
57
+ flexDirection: 'column',
58
+ justifyContent: 'center'
59
+ },
60
+ '&.vertical': {
61
+ flexDirection: 'column',
62
+ '.center': {
63
+ flexDirection: 'row',
64
+ justifyContent: 'center'
65
+ }
66
+ }
67
+ }), '&.senior-expand', {
68
+ flexDirection: 'column'
69
+ }), '&.small', _defineProperty({
70
+ gap: '12px'
71
+ }, "".concat(componentCls, "-footre"), {
72
+ gap: '4px'
73
+ })))
74
+ }, "".concat(componentCls, "-content"), {
75
+ '&.simple': _defineProperty(_defineProperty({}, "".concat(componentCls, "-footer--btns"), {
76
+ display: 'flex'
77
+ }), "".concat(componentCls, "-item"), _defineProperty({
78
+ gap: '8px'
79
+ }, "".concat(componentCls, "-item--label"), {
80
+ textAlign: 'right'
81
+ }))
82
+ }), '.no-radius', {
83
+ borderRadius: 0,
84
+ borderColor: '#f1f1f1'
85
+ }), '.search-history-warp', {
86
+ position: 'relative',
87
+ '.search-history-button': {
88
+ paddingRight: '32px'
89
+ },
90
+ '.search-history-button-icon': {
91
+ position: 'absolute',
92
+ width: '24px',
93
+ height: '18px',
94
+ right: '6px',
95
+ top: '8px',
96
+ color: '#fff',
97
+ lineHeight: '18px',
98
+ textAlign: 'center',
99
+ fontWeight: 'bold',
100
+ '> span': {
101
+ fontSize: '14px'
102
+ }
103
+ }
104
+ })), '.search-history-empty', {
105
+ padding: '12px 12px 6px 12px',
106
+ backgroundColor: '#fff'
107
+ }), '.search-history-items', {
108
+ width: '120px',
109
+ maxHeight: '300px',
110
+ overflowY: 'auto',
111
+ '.search-history-item': {
112
+ display: 'flex',
113
+ padding: '4px 0px 4px 4px',
114
+ alignItems: 'center',
115
+ gap: '4px',
116
+ '&:hover': {
117
+ backgroundColor: '#f1f1f1'
118
+ },
119
+ '.history-item--title': {
120
+ width: 'calc(100% - 30px)',
121
+ cursor: 'pointer'
122
+ },
123
+ '.delete': {
124
+ padding: '0 6px',
125
+ flex: '0 0 28px'
126
+ }
127
+ }
128
+ }), '.search-history-list-pop', {
129
+ '.ant-popover-inner-content': {
130
+ padding: 0
131
+ }
132
+ });
133
+ };
package/es/Search/util.js CHANGED
@@ -1,8 +1,7 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- import { cloneDeep, isArray, isFunction, isString } from 'lodash-es';
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import { cloneDeep, isArray, isFunction, isString, omit } from 'lodash-es';
4
4
  import { termType } from './setting';
5
- import './typing';
6
5
  /**
7
6
  * 处理like,nlike特殊值
8
7
  * @param v
@@ -22,8 +21,8 @@ export var handleLikeValue = function handleLikeValue(v) {
22
21
  return v;
23
22
  };
24
23
  var handleItemValue = function handleItemValue(item, columnOptionMap) {
25
- var _item = columnOptionMap.get(item.column);
26
- if (!_item) return item;
24
+ var _item = columnOptionMap[item.column].search;
25
+ if (_item === null || _item === '' || _item === undefined) return item;
27
26
  if (_item.rename) {
28
27
  item.column = _item.rename;
29
28
  }
@@ -33,26 +32,16 @@ var handleItemValue = function handleItemValue(item, columnOptionMap) {
33
32
  if (['like', 'nlike'].includes(item.termType) && !!item.value) {
34
33
  item.value = "%".concat(handleLikeValue(item.value), "%");
35
34
  }
35
+ if (_item.handleTerms && isFunction(_item.handleTerms)) {
36
+ return _item.handleTerms(item);
37
+ }
36
38
  return item;
37
39
  };
38
40
  var isEmpty = function isEmpty(v) {
39
41
  return v === undefined || v === null || v === '' || isArray(v) && v.length === 0;
40
42
  };
41
- var handleArrayToTerms = function handleArrayToTerms(terms, columnOptionMap) {
42
- return terms.map(function (item) {
43
- if (item.terms) {
44
- var filterTerms = item.terms.filter(function (filterItem) {
45
- return filterItem && !isEmpty(filterItem.value) && filterItem.termType !== undefined && filterItem.column !== undefined;
46
- });
47
- item.terms = filterTerms.map(function (result) {
48
- return handleItemValue(result, columnOptionMap);
49
- });
50
- }
51
- return item;
52
- }).filter(function (item) {
53
- var _item$terms;
54
- return (_item$terms = item.terms) === null || _item$terms === void 0 ? void 0 : _item$terms.length;
55
- });
43
+ var isFilterItem = function isFilterItem(item) {
44
+ return !isEmpty(item.value) && item.column !== undefined;
56
45
  };
57
46
  /**
58
47
  * 处理为外部使用
@@ -61,26 +50,50 @@ var handleArrayToTerms = function handleArrayToTerms(terms, columnOptionMap) {
61
50
  */
62
51
  export var termsParamsFormat = function termsParamsFormat(terms, columnOptionMap) {
63
52
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'adv';
64
- var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'terms';
53
+ var dataFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'terms';
65
54
  // 过滤掉terms中value无效的item
66
- var cloneParams = cloneDeep(terms);
67
- if (searchType === 'terms') {
68
- return type === 'adv' ? {
69
- terms: handleArrayToTerms(cloneParams.terms, columnOptionMap)
70
- } : cloneParams.filter(function (item) {
71
- return item && !isEmpty(item.value) && item.column !== undefined;
72
- }).map(function (item) {
73
- return handleItemValue(item, columnOptionMap);
74
- });
75
- } else if (searchType == 'object') {
76
- var result = {};
77
- cloneParams.filter(function (item) {
78
- return item && item.value !== undefined && item.value !== '';
79
- }).forEach(function (item) {
80
- _extends(result, _defineProperty({}, item.column, item.value));
81
- });
82
- return result;
55
+ var cloneParams = cloneDeep(terms.terms);
56
+ var handleParamsValue = cloneParams.map(function (item) {
57
+ return omit(handleItemValue(item, columnOptionMap), ['_span']);
58
+ });
59
+ var filterParams = handleParamsValue.filter(isFilterItem);
60
+ if (dataFormat === 'terms') {
61
+ // terms格式
62
+ // 过滤,并处理值
63
+ if (type === 'adv') {
64
+ if (cloneParams.length > 1) {
65
+ // 拓展开
66
+ var array_A = handleParamsValue.slice(0, 3).filter(isFilterItem);
67
+ var array_B = handleParamsValue.slice(3, 6).filter(isFilterItem);
68
+ var _terms = [];
69
+ if (array_A.length > 0) {
70
+ _terms.push({
71
+ terms: array_A
72
+ });
73
+ }
74
+ if (array_B.length > 0) {
75
+ _terms.push({
76
+ terms: array_B,
77
+ type: handleParamsValue[3].type
78
+ });
79
+ }
80
+ return {
81
+ terms: _terms
82
+ };
83
+ }
84
+ return {
85
+ terms: [{
86
+ terms: filterParams
87
+ }]
88
+ };
89
+ }
90
+ return filterParams;
83
91
  }
92
+ // dataFormat === 'object'
93
+ return filterParams.reduce(function (pre, item) {
94
+ pre[item.column] = item;
95
+ return pre;
96
+ }, {});
84
97
  };
85
98
  /**
86
99
  * TreeSelect过滤
@@ -104,21 +117,6 @@ export var filterSelectNode = function filterSelectNode(value, option) {
104
117
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'label';
105
118
  return (_option$key = option[key]) === null || _option$key === void 0 ? void 0 : _option$key.includes(value);
106
119
  };
107
- export var handleQData = function handleQData(terms) {
108
- // 排序, null 往后放
109
- terms.terms.forEach(function (a) {
110
- for (var i = 0; i < a.terms.length; i++) {
111
- for (var j = 0; j < a.terms.length - i - 1; j++) {
112
- if (!a.terms[j] && a.terms[j + 1]) {
113
- var temp = a.terms[j];
114
- a.terms[j] = a.terms[j + 1];
115
- a.terms[j + 1] = temp;
116
- }
117
- }
118
- }
119
- });
120
- return terms;
121
- };
122
120
  export var hasExpand = function hasExpand(terms) {
123
121
  var itemCount = 0;
124
122
  terms.forEach(function (a) {
@@ -130,62 +128,59 @@ export var hasExpand = function hasExpand(terms) {
130
128
  });
131
129
  return itemCount >= 2;
132
130
  };
133
- export var compatibleOldTerms = function compatibleOldTerms(q) {
134
- var _terms = [{
135
- terms: [null, null, null]
136
- }, {
137
- terms: [null, null, null],
138
- type: 'and'
139
- }];
131
+ function shouldExpand(a, b) {
132
+ var isAFirstHasValue = a[0] !== null && a[0] !== undefined;
133
+ var isARestNull = a.slice(1).every(function (item) {
134
+ return item === null || item === undefined;
135
+ });
136
+ var isBAllNull = b.every(function (item) {
137
+ return item === null || item === undefined;
138
+ });
139
+ return !(isAFirstHasValue && isARestNull && isBAllNull);
140
+ }
141
+ export var compatibleOldTerms = function compatibleOldTerms(q, columnsMap, defaultCacheValues) {
140
142
  try {
141
- var _terms$terms;
142
143
  var terms = JSON.parse(q || '{}');
143
- (_terms$terms = terms.terms) === null || _terms$terms === void 0 ? void 0 : _terms$terms.forEach(function (a, aIndex) {
144
- var _a$terms;
145
- a === null || a === void 0 ? void 0 : (_a$terms = a.terms) === null || _a$terms === void 0 ? void 0 : _a$terms.forEach(function (b, bIndex) {
146
- _terms[aIndex].terms[bIndex] = b;
147
- });
148
- if (a.type) {
149
- _terms[aIndex].type = a.type;
144
+ if (terms.terms.length === 2) {
145
+ var expand = shouldExpand(terms.terms[0].terms, terms.terms[1].terms);
146
+ var _terms = [];
147
+ if (!expand) {
148
+ _terms = [terms.terms[0].terms[0]];
149
+ } else {
150
+ _terms = [].concat(_toConsumableArray(terms.terms[0].terms), _toConsumableArray(terms.terms[1].terms));
151
+ // 重新
152
+ var arr = Object.values(columnsMap);
153
+ for (var i = 0; i < _terms.length; i++) {
154
+ if (_terms[i] === null) {
155
+ var indexIn = i % arr.length;
156
+ var obj = getItemDefaultValue(arr[indexIn], defaultCacheValues);
157
+ if (i === 3) {
158
+ obj.type = terms.terms[1].type;
159
+ }
160
+ _terms[i] = obj;
161
+ }
162
+ }
150
163
  }
151
- });
152
- return {
153
- terms: _terms
154
- };
164
+ return {
165
+ terms: _terms,
166
+ expand: expand
167
+ };
168
+ } else {
169
+ var hasTermsKey = Reflect.has(terms.terms[0], 'terms'); // 兼容历史数据
170
+ return {
171
+ terms: hasTermsKey ? terms.terms[0].terms : terms.terms,
172
+ expand: terms.terms.length > 1
173
+ };
174
+ }
155
175
  } catch (e) {
156
176
  console.warn('[Pro Search Error] > ', e);
157
177
  return {
158
- terms: _terms
178
+ terms: [],
179
+ expand: false
159
180
  };
160
181
  }
161
182
  };
162
- export var handleParamsToString = function handleParamsToString() {
163
- var terms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
164
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
165
- var _terms = [{
166
- terms: [null, null, null]
167
- }, {
168
- terms: [null, null, null],
169
- type: type
170
- }];
171
- var termsIndex = 0;
172
- var termsStar = 0;
173
- terms.forEach(function (item, index) {
174
- if (index > 2) {
175
- termsIndex = 1;
176
- termsStar = 4;
177
- }
178
- _terms[termsIndex].terms[index - termsStar] = item;
179
- });
180
- return JSON.stringify({
181
- terms: _terms
182
- });
183
- };
184
183
  export var getTermTypeFn = function getTermTypeFn(type) {
185
- // if (column?.includes('id') && type === 'string') {
186
- // // 默认id为 eq
187
- // return 'eq';
188
- // }
189
184
  switch (type) {
190
185
  case 'select':
191
186
  case 'treeSelect':
@@ -202,11 +197,14 @@ export var getTermTypeFn = function getTermTypeFn(type) {
202
197
  }
203
198
  };
204
199
  export var getTermTypes = function getTermTypes(types, locale) {
205
- return termType(locale).filter(function (item) {
206
- return types.includes(item.value);
200
+ var termTypes = termType(locale);
201
+ return types.map(function (code) {
202
+ return termTypes.find(function (item) {
203
+ return item.value === code;
204
+ });
207
205
  });
208
206
  };
209
- export var getTermOptions = function getTermOptions(type, column, locale) {
207
+ export var getTermOptions = function getTermOptions(type, locale) {
210
208
  var keys = [];
211
209
  switch (type) {
212
210
  case 'select':
@@ -225,7 +223,7 @@ export var getTermOptions = function getTermOptions(type, column, locale) {
225
223
  keys = ['eq', 'not', 'gt', 'lt', 'gte', 'lte'];
226
224
  break;
227
225
  default:
228
- keys = ['like', 'nlike'];
226
+ keys = ['like', 'nlike', 'eq', 'not'];
229
227
  // column?.includes('id') && type === 'string'
230
228
  // ? ['eq']
231
229
  // : ['like', 'nlike'];
@@ -233,24 +231,18 @@ export var getTermOptions = function getTermOptions(type, column, locale) {
233
231
  }
234
232
  return keys.length ? getTermTypes(keys, locale) : termType(locale);
235
233
  };
236
- export var termsToValue = function termsToValue(targetItem, searchItems) {
237
- if (['like', 'nlike'].includes(targetItem.termType) && !!targetItem.value) {
238
- if (targetItem.value.startsWith('%') && targetItem.value.endsWith('%')) {
239
- targetItem.value = targetItem.value.slice(1, -1);
240
- }
241
- }
242
- // 处理重命名
243
- var searchItem = searchItems.filter(function (item) {
244
- return item.rename;
245
- }).find(function (item) {
246
- if (item.rename === targetItem.column) {
247
- targetItem.column = item.column;
248
- return true;
249
- }
250
- return item.column === targetItem.column;
251
- });
252
- if (!targetItem.termType) {
253
- targetItem.termType = getTermTypeFn(searchItem.type);
254
- }
255
- return targetItem;
234
+ /**
235
+ * 获取单项默认值,仅初始化使用
236
+ * @param record
237
+ * @param defaultCacheValues
238
+ */
239
+ export var getItemDefaultValue = function getItemDefaultValue(record, defaultCacheValues) {
240
+ var defaultValue = _objectSpread({}, defaultCacheValues[record.dataIndex]);
241
+ return {
242
+ column: record.dataIndex,
243
+ termType: defaultValue.defaultTermType || getTermTypeFn(record.search.type),
244
+ value: defaultValue.defaultValue,
245
+ type: 'or',
246
+ _span: record.search.span
247
+ };
256
248
  };
@@ -0,0 +1,64 @@
1
+ /* Analyzed bindings: {
2
+ "active": "props",
3
+ "loading": "props",
4
+ "Item": "setup-const",
5
+ "computed": "setup-const",
6
+ "useSkeletonStyle": "setup-maybe-ref",
7
+ "prefixCls": "setup-ref",
8
+ "wrapSSR": "setup-maybe-ref",
9
+ "hashId": "setup-maybe-ref",
10
+ "props": "setup-reactive-const"
11
+ } */
12
+ import { renderSlot as _renderSlot, unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
13
+ const _hoisted_1 = { class: "j-skeleton-dashboard-card" };
14
+ const _hoisted_2 = { style: { "min-height": "0", "flex": "1" } };
15
+ import Item from './Item.js';
16
+ import { computed } from "vue";
17
+ import useSkeletonStyle from '../style';
18
+ const __sfc_main__ = Object.assign({
19
+ name: 'JSkeletonDashboardCard'
20
+ }, {
21
+ props: {
22
+ active: {
23
+ type: Boolean,
24
+ default: true,
25
+ },
26
+ loading: {
27
+ type: Boolean,
28
+ default: true,
29
+ }
30
+ },
31
+ setup(__props) {
32
+ const prefixCls = computed(() => 'j-skeleton');
33
+ const [wrapSSR, hashId] = useSkeletonStyle(prefixCls);
34
+ const props = __props;
35
+ return (_ctx, _cache) => {
36
+ return (!__props.loading)
37
+ ? _renderSlot(_ctx.$slots, "default", { key: 0 })
38
+ : (_openBlock(), _createElementBlock("div", {
39
+ key: 1,
40
+ class: _normalizeClass(['j-skeleton', _unref(hashId)])
41
+ }, [
42
+ _createElementVNode("div", _hoisted_1, [
43
+ _createVNode(Item, {
44
+ active: __props.active,
45
+ width: "50%"
46
+ }, null, 8 /* PROPS */, ["active"]),
47
+ _createElementVNode("div", _hoisted_2, [
48
+ _createVNode(Item, {
49
+ active: __props.active,
50
+ size: "large",
51
+ width: "120px"
52
+ }, null, 8 /* PROPS */, ["active"])
53
+ ]),
54
+ _createVNode(Item, {
55
+ active: __props.active,
56
+ size: "small",
57
+ width: "100%"
58
+ }, null, 8 /* PROPS */, ["active"])
59
+ ])
60
+ ], 2 /* CLASS */));
61
+ };
62
+ }
63
+ });
64
+ export default __sfc_main__;
@@ -0,0 +1,96 @@
1
+ /* Analyzed bindings: {
2
+ "active": "props",
3
+ "loading": "props",
4
+ "Item": "setup-const",
5
+ "computed": "setup-const",
6
+ "useSkeletonStyle": "setup-maybe-ref",
7
+ "props": "setup-reactive-const",
8
+ "prefixCls": "setup-ref",
9
+ "wrapSSR": "setup-maybe-ref",
10
+ "hashId": "setup-maybe-ref"
11
+ } */
12
+ import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass } from "vue";
13
+ const _hoisted_1 = { class: "j-skeleton-dashboard-card" };
14
+ const _hoisted_2 = { class: "j-skeleton-flex-between" };
15
+ const _hoisted_3 = { style: { "width": "100%", "height": "200px" } };
16
+ const _hoisted_4 = {
17
+ viewBox: "0 0 800 200",
18
+ preserveAspectRatio: "none",
19
+ style: { "width": "100%", "height": "100%", "display": "block" }
20
+ };
21
+ import Item from './Item.js';
22
+ import { computed } from "vue";
23
+ import useSkeletonStyle from '../style';
24
+ const __sfc_main__ = Object.assign({
25
+ name: 'JSkeletonDashboardChart'
26
+ }, {
27
+ props: {
28
+ active: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
32
+ loading: {
33
+ type: Boolean,
34
+ default: true,
35
+ }
36
+ },
37
+ setup(__props) {
38
+ const props = __props;
39
+ const prefixCls = computed(() => 'j-skeleton');
40
+ const [wrapSSR, hashId] = useSkeletonStyle(prefixCls);
41
+ return (_ctx, _cache) => {
42
+ return (!__props.loading)
43
+ ? _renderSlot(_ctx.$slots, "default", { key: 0 })
44
+ : (_openBlock(), _createElementBlock("div", {
45
+ key: 1,
46
+ class: _normalizeClass(['j-skeleton', _unref(hashId)])
47
+ }, [
48
+ _createElementVNode("div", _hoisted_1, [
49
+ _createElementVNode("div", _hoisted_2, [
50
+ _createVNode(Item, {
51
+ active: __props.active,
52
+ width: "200px"
53
+ }, null, 8 /* PROPS */, ["active"]),
54
+ _createVNode(Item, {
55
+ active: __props.active,
56
+ width: "150px"
57
+ }, null, 8 /* PROPS */, ["active"])
58
+ ]),
59
+ _createElementVNode("div", _hoisted_3, [
60
+ (_openBlock(), _createElementBlock("svg", _hoisted_4, [
61
+ _createCommentVNode(" 坐标轴(4px宽度,#f0f2f5颜色) "),
62
+ _cache[0] || (_cache[0] = _createElementVNode("path", {
63
+ d: "M0 150 L800 150",
64
+ stroke: "#f0f2f5",
65
+ "stroke-width": "4",
66
+ "stroke-opacity": "0.8"
67
+ }, null, -1 /* HOISTED */)),
68
+ _createCommentVNode(" X轴 "),
69
+ _cache[1] || (_cache[1] = _createElementVNode("path", {
70
+ d: "M0 150 L0 50",
71
+ stroke: "#f0f2f5",
72
+ "stroke-width": "4",
73
+ "stroke-opacity": "0.8"
74
+ }, null, -1 /* HOISTED */)),
75
+ _createCommentVNode(" Y轴 "),
76
+ _createCommentVNode(" 两条曲线 "),
77
+ _cache[2] || (_cache[2] = _createElementVNode("path", {
78
+ d: "M0 100 C200 30, 600 170, 800 100",
79
+ stroke: "#f0f2f5",
80
+ fill: "none",
81
+ "stroke-width": "4"
82
+ }, null, -1 /* HOISTED */)),
83
+ _cache[3] || (_cache[3] = _createElementVNode("path", {
84
+ d: "M0 120 C200 60, 600 140, 800 80",
85
+ stroke: "#f0f2f5",
86
+ fill: "none",
87
+ "stroke-width": "4"
88
+ }, null, -1 /* HOISTED */))
89
+ ]))
90
+ ])
91
+ ])
92
+ ], 2 /* CLASS */));
93
+ };
94
+ }
95
+ });
96
+ export default __sfc_main__;