@jetlinks-web/components 3.0.1-rc → 3.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 (286) hide show
  1. package/es/AutoComplete/AutoComplete.js +13 -9
  2. package/es/BadgeStatus/Badge.js +1 -2
  3. package/es/BadgeStatus/color.js +3 -3
  4. package/es/CardSelect/CardSelect.js +23 -13
  5. package/es/CardSelect/style/index.js +25 -1
  6. package/es/CheckButton/CheckButton.js +12 -4
  7. package/es/CheckButton/style/index.js +41 -1
  8. package/es/DragModal/DragModal.js +14 -8
  9. package/es/DragModal/style/index.js +64 -1
  10. package/es/EditTable/Body.js +10 -3
  11. package/es/EditTable/EditTable.js +13 -7
  12. package/es/EditTable/FormItem.js +18 -19
  13. package/es/EditTable/Header.js +16 -6
  14. package/es/EditTable/components/ContextMenu/Menu.js +11 -5
  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 +23 -18
  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 +30 -3
  27. package/es/Ellipsis/Ellipsis.js +10 -2
  28. package/es/Ellipsis/style/index.js +24 -1
  29. package/es/FullPage/FullPage.js +1 -2
  30. package/es/LocaleProvider/index.js +1 -2
  31. package/es/PermissionButton/index.js +6 -7
  32. package/es/ProLayout/Basic/BasicLayout.js +45 -41
  33. package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
  34. package/es/ProLayout/Basic/Header.js +3 -7
  35. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  36. package/es/ProLayout/PageContainer/index.js +21 -17
  37. package/es/ProLayout/PageContainer/style.js +46 -0
  38. package/es/ProLayout/SiderMenu/BaseMenu.js +18 -42
  39. package/es/ProLayout/SiderMenu/SiderMenu.js +24 -36
  40. package/es/ProLayout/SiderMenu/style.js +166 -0
  41. package/es/ProLayout/TopHeader/index.js +13 -12
  42. package/es/ProLayout/TopHeader/style.js +126 -0
  43. package/es/ProLayout/style/index.js +7 -1
  44. package/es/ProLayout/util.js +5 -5
  45. package/es/ProTable/Alert.js +12 -4
  46. package/es/ProTable/Content.js +108 -28
  47. package/es/ProTable/Header.js +21 -11
  48. package/es/ProTable/Pagination.js +12 -4
  49. package/es/ProTable/ProTable.js +46 -34
  50. package/es/ProTable/hooks/index.js +2 -0
  51. package/es/ProTable/hooks/useTableInject.js +5 -0
  52. package/es/ProTable/hooks/useTableSelection.js +95 -0
  53. package/es/ProTable/setting.js +1 -1
  54. package/es/ProTable/style/index.js +109 -1
  55. package/es/RadioButton/RadioButton.js +10 -4
  56. package/es/RadioButton/style/index.js +23 -1
  57. package/es/Scrollbar/Scrollbar.js +10 -3
  58. package/es/Scrollbar/Thumb.js +36 -25
  59. package/es/Scrollbar/style/index.js +63 -1
  60. package/es/Search/Advanced/History.js +23 -16
  61. package/es/Search/Advanced/SaveHistory.js +1 -2
  62. package/es/Search/Advanced/index.js +212 -292
  63. package/es/Search/Item.js +175 -415
  64. package/es/Search/Search.js +78 -172
  65. package/es/Search/hooks/index.js +108 -1
  66. package/es/Search/hooks/useRouteQuery.js +57 -0
  67. package/es/Search/setting.js +132 -14
  68. package/es/Search/style/index.js +4 -2
  69. package/es/Search/style/item.js +28 -0
  70. package/es/Search/style/search.js +133 -0
  71. package/es/Search/util.js +116 -124
  72. package/es/Skeleton/components/DashBoardCard.js +19 -12
  73. package/es/Skeleton/components/DashBoardChart.js +48 -45
  74. package/es/Skeleton/components/Detail.js +27 -21
  75. package/es/Skeleton/components/Drawer.js +23 -14
  76. package/es/Skeleton/components/Item.js +9 -1
  77. package/es/Skeleton/components/List.js +0 -1
  78. package/es/Skeleton/components/ListCard.js +20 -13
  79. package/es/Skeleton/components/ListCardItem.js +12 -13
  80. package/es/Skeleton/components/ListTable.js +19 -10
  81. package/es/Skeleton/components/Page.js +0 -1
  82. package/es/Skeleton/components/Tree.js +21 -14
  83. package/es/Skeleton/skeleton.js +17 -8
  84. package/es/Skeleton/style/index.js +132 -1
  85. package/es/Title/style/index.js +29 -1
  86. package/es/Title/title.js +13 -5
  87. package/es/ValueItem/ValueItem.js +44 -39
  88. package/es/components.js +1 -5
  89. package/es/locale/en-US.js +3 -7
  90. package/es/locale/zh-CN.js +3 -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 -13
  95. package/lib/AutoComplete/AutoComplete.js +13 -9
  96. package/lib/BadgeStatus/Badge.js +1 -2
  97. package/lib/BadgeStatus/color.js +3 -3
  98. package/lib/CardSelect/CardSelect.js +23 -13
  99. package/lib/CardSelect/style/index.js +30 -1
  100. package/lib/CheckButton/CheckButton.js +12 -4
  101. package/lib/CheckButton/style/index.js +46 -1
  102. package/lib/DragModal/DragModal.js +14 -8
  103. package/lib/DragModal/style/index.js +69 -1
  104. package/lib/EditTable/Body.js +10 -3
  105. package/lib/EditTable/EditTable.js +13 -7
  106. package/lib/EditTable/FormItem.js +18 -19
  107. package/lib/EditTable/Header.js +16 -6
  108. package/lib/EditTable/components/ContextMenu/Menu.js +11 -5
  109. package/lib/EditTable/components/Search/search.js +1 -2
  110. package/lib/EditTable/components/Search/sort.js +1 -3
  111. package/lib/EditTable/group.js +23 -18
  112. package/lib/EditTable/hooks/useValidate.js +1 -1
  113. package/lib/EditTable/style/body.js +60 -0
  114. package/lib/EditTable/style/form.js +31 -0
  115. package/lib/EditTable/style/group.js +32 -0
  116. package/lib/EditTable/style/header.js +65 -0
  117. package/lib/EditTable/style/index.js +47 -1
  118. package/lib/EditTable/style/menu.js +33 -0
  119. package/lib/EditTable/style/table.js +52 -0
  120. package/lib/EditTable/utils.js +31 -3
  121. package/lib/Ellipsis/Ellipsis.js +10 -2
  122. package/lib/Ellipsis/style/index.js +29 -1
  123. package/lib/FullPage/FullPage.js +1 -2
  124. package/lib/Icon/icon.js +1 -2
  125. package/lib/LocaleProvider/index.js +1 -2
  126. package/lib/PermissionButton/index.js +6 -7
  127. package/lib/ProLayout/Basic/BasicLayout.js +45 -42
  128. package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
  129. package/lib/ProLayout/Basic/Header.js +2 -6
  130. package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
  131. package/lib/ProLayout/PageContainer/index.js +19 -15
  132. package/lib/ProLayout/PageContainer/style.js +53 -0
  133. package/lib/ProLayout/SiderMenu/BaseMenu.js +19 -42
  134. package/lib/ProLayout/SiderMenu/SiderMenu.js +24 -37
  135. package/lib/ProLayout/SiderMenu/style.js +173 -0
  136. package/lib/ProLayout/TopHeader/index.js +14 -12
  137. package/lib/ProLayout/TopHeader/style.js +133 -0
  138. package/lib/ProLayout/style/index.js +12 -1
  139. package/lib/ProLayout/util.js +5 -5
  140. package/lib/ProTable/Alert.js +12 -4
  141. package/lib/ProTable/Content.js +108 -28
  142. package/lib/ProTable/Header.js +21 -11
  143. package/lib/ProTable/Pagination.js +12 -4
  144. package/lib/ProTable/ProTable.js +46 -34
  145. package/lib/ProTable/hooks/index.js +27 -0
  146. package/lib/ProTable/hooks/useTableInject.js +11 -0
  147. package/lib/ProTable/hooks/useTableSelection.js +102 -0
  148. package/lib/ProTable/setting.js +1 -1
  149. package/lib/ProTable/style/index.js +114 -1
  150. package/lib/RadioButton/RadioButton.js +10 -4
  151. package/lib/RadioButton/style/index.js +28 -1
  152. package/lib/Scrollbar/Scrollbar.js +10 -3
  153. package/lib/Scrollbar/Thumb.js +36 -25
  154. package/lib/Scrollbar/style/index.js +68 -1
  155. package/lib/Search/Advanced/History.js +23 -16
  156. package/lib/Search/Advanced/SaveHistory.js +1 -2
  157. package/lib/Search/Advanced/index.js +212 -292
  158. package/lib/Search/Item.js +175 -415
  159. package/lib/Search/Search.js +78 -172
  160. package/lib/Search/hooks/index.js +130 -1
  161. package/lib/Search/hooks/useRouteQuery.js +64 -0
  162. package/lib/Search/setting.js +133 -15
  163. package/lib/Search/style/index.js +9 -2
  164. package/lib/Search/style/item.js +35 -0
  165. package/lib/Search/style/search.js +140 -0
  166. package/lib/Search/util.js +116 -124
  167. package/lib/Skeleton/components/DashBoardCard.js +19 -12
  168. package/lib/Skeleton/components/DashBoardChart.js +48 -45
  169. package/lib/Skeleton/components/Detail.js +27 -21
  170. package/lib/Skeleton/components/Drawer.js +23 -14
  171. package/lib/Skeleton/components/Item.js +9 -1
  172. package/lib/Skeleton/components/List.js +0 -1
  173. package/lib/Skeleton/components/ListCard.js +20 -13
  174. package/lib/Skeleton/components/ListCardItem.js +12 -13
  175. package/lib/Skeleton/components/ListTable.js +19 -10
  176. package/lib/Skeleton/components/Page.js +0 -1
  177. package/lib/Skeleton/components/Tree.js +21 -14
  178. package/lib/Skeleton/skeleton.js +17 -8
  179. package/lib/Skeleton/style/index.js +137 -1
  180. package/lib/Title/style/index.js +34 -1
  181. package/lib/Title/title.js +13 -5
  182. package/lib/ValueItem/ValueItem.js +44 -39
  183. package/lib/components.js +1 -30
  184. package/lib/index.js +1 -2
  185. package/lib/locale/en-US.js +3 -7
  186. package/lib/locale/zh-CN.js +3 -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 -15
  192. package/package.json +170 -173
  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/FlameGraph/FlameGraph.js +0 -136
  215. package/es/FlameGraph/index.js +0 -5
  216. package/es/FlameGraph/style/index.css +0 -43
  217. package/es/FlameGraph/style/index.js +0 -1
  218. package/es/FlameGraph/style/index.less +0 -52
  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 -139
  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/Skeleton/style/Skeleton.less +0 -166
  234. package/es/Title/style/index.css +0 -27
  235. package/es/Title/style/index.less +0 -27
  236. package/es/style/index.css +0 -5375
  237. package/es/style/index.less +0 -14
  238. package/es/style/variable.css +0 -4
  239. package/es/style/variable.less +0 -4
  240. package/lib/AMap/Map.js +0 -133
  241. package/lib/AMap/index.js +0 -12
  242. package/lib/AMap/util.js +0 -62
  243. package/lib/CardSelect/style/index.css +0 -24
  244. package/lib/CardSelect/style/index.less +0 -26
  245. package/lib/CheckButton/style/index.css +0 -37
  246. package/lib/CheckButton/style/index.less +0 -40
  247. package/lib/DragModal/style/index.css +0 -82
  248. package/lib/DragModal/style/index.less +0 -97
  249. package/lib/Echarts/Echarts.js +0 -48
  250. package/lib/Echarts/index.js +0 -12
  251. package/lib/EditTable/style/body.less +0 -66
  252. package/lib/EditTable/style/form.less +0 -33
  253. package/lib/EditTable/style/group.less +0 -32
  254. package/lib/EditTable/style/header.less +0 -77
  255. package/lib/EditTable/style/index.css +0 -267
  256. package/lib/EditTable/style/index.less +0 -41
  257. package/lib/EditTable/style/menu.less +0 -25
  258. package/lib/EditTable/style/table.less +0 -47
  259. package/lib/Ellipsis/style/index.css +0 -17
  260. package/lib/Ellipsis/style/index.less +0 -20
  261. package/lib/FlameGraph/FlameGraph.js +0 -136
  262. package/lib/FlameGraph/index.js +0 -12
  263. package/lib/FlameGraph/style/index.css +0 -43
  264. package/lib/FlameGraph/style/index.js +0 -3
  265. package/lib/FlameGraph/style/index.less +0 -52
  266. package/lib/ProLayout/Basic/BasicLayout.less +0 -66
  267. package/lib/ProLayout/Basic/Header.less +0 -8
  268. package/lib/ProLayout/PageContainer/index.less +0 -103
  269. package/lib/ProLayout/SiderMenu/index.less +0 -231
  270. package/lib/ProLayout/TopHeader/index.less +0 -174
  271. package/lib/ProLayout/style/default.less +0 -4
  272. package/lib/ProLayout/style/style.less +0 -7
  273. package/lib/ProTable/style/ProTable.less +0 -139
  274. package/lib/RadioButton/style/index.css +0 -20
  275. package/lib/RadioButton/style/index.less +0 -19
  276. package/lib/Scrollbar/style/index.css +0 -65
  277. package/lib/Scrollbar/style/index.less +0 -83
  278. package/lib/Search/style/Item.less +0 -33
  279. package/lib/Search/style/Search.less +0 -179
  280. package/lib/Skeleton/style/Skeleton.less +0 -166
  281. package/lib/Title/style/index.css +0 -27
  282. package/lib/Title/style/index.less +0 -27
  283. package/lib/style/index.css +0 -5375
  284. package/lib/style/index.less +0 -14
  285. package/lib/style/variable.css +0 -4
  286. package/lib/style/variable.less +0 -4
@@ -20,19 +20,23 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
20
20
  "computed": "setup-const",
21
21
  "_alertProps": "setup-maybe-ref",
22
22
  "useLocaleReceiver": "setup-maybe-ref",
23
+ "useProTableStyle": "setup-maybe-ref",
23
24
  "contextLocale": "setup-maybe-ref",
24
25
  "props": "setup-reactive-const",
25
26
  "emits": "setup-const",
27
+ "prefixCls": "setup-ref",
28
+ "wrapSSR": "setup-maybe-ref",
29
+ "hashId": "setup-maybe-ref",
26
30
  "_message": "setup-ref",
27
31
  "onClose": "setup-const"
28
32
  } */
29
33
  import { defineComponent as _defineComponent } from 'vue';
30
- import { renderSlot as _renderSlot, unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
31
- const _hoisted_1 = { class: "jtable-alert" };
34
+ import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
32
35
  import { Alert, Button } from 'ant-design-vue';
33
36
  import { computed } from "vue";
34
37
  import { _alertProps } from "./setting";
35
38
  import { useLocaleReceiver } from "../LocaleReciver/index";
39
+ import useProTableStyle from './style';
36
40
  const __sfc_main__ = _defineComponent({
37
41
  ...{
38
42
  name: 'Alert'
@@ -43,6 +47,8 @@ const __sfc_main__ = _defineComponent({
43
47
  const [contextLocale] = useLocaleReceiver('ProTable');
44
48
  const props = __props;
45
49
  const emits = __emit;
50
+ const prefixCls = computed(() => 'pro-table');
51
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
46
52
  const _message = computed(() => {
47
53
  let locale = _optionalChain([contextLocale, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.alert, 'optionalAccess', _4 => _4.selectItem]) || '';
48
54
  [_optionalChain([props, 'access', _5 => _5.rowSelection, 'optionalAccess', _6 => _6.selectedRowKeys, 'optionalAccess', _7 => _7.length]) || 0].forEach((item, index) => {
@@ -54,7 +60,9 @@ const __sfc_main__ = _defineComponent({
54
60
  emits('close');
55
61
  };
56
62
  return (_ctx, _cache) => {
57
- return (_openBlock(), _createElementBlock("div", _hoisted_1, [
63
+ return (_openBlock(), _createElementBlock("div", {
64
+ class: _normalizeClass(['jtable-alert', _unref(hashId)])
65
+ }, [
58
66
  _renderSlot(_ctx.$slots, "default", {}, () => [
59
67
  _createVNode(_unref(Alert), {
60
68
  type: "info",
@@ -74,7 +82,7 @@ const __sfc_main__ = _defineComponent({
74
82
  _: 1 /* STABLE */
75
83
  }, 8 /* PROPS */, ["message"])
76
84
  ])
77
- ]));
85
+ ], 2 /* CLASS */));
78
86
  };
79
87
  }
80
88
  });
@@ -21,29 +21,51 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
21
21
  "_contentProps": "setup-maybe-ref",
22
22
  "Table": "setup-maybe-ref",
23
23
  "get": "setup-maybe-ref",
24
+ "omit": "setup-maybe-ref",
24
25
  "Empty": "setup-maybe-ref",
26
+ "useTableInject": "setup-maybe-ref",
27
+ "useProTableStyle": "setup-maybe-ref",
28
+ "useLocaleReceiver": "setup-maybe-ref",
25
29
  "props": "setup-reactive-const",
26
30
  "slots": "setup-maybe-ref",
31
+ "contextLocale": "setup-maybe-ref",
32
+ "prefixCls": "setup-ref",
33
+ "wrapSSR": "setup-maybe-ref",
34
+ "hashId": "setup-maybe-ref",
35
+ "_rowSelection": "setup-maybe-ref",
27
36
  "_columns": "setup-ref",
37
+ "_slots": "setup-ref",
28
38
  "_scroll": "setup-ref",
29
- "gridTemplateColumns": "setup-ref"
39
+ "gridTemplateColumns": "setup-ref",
40
+ "__rowSelection": "setup-ref",
41
+ "indeterminate": "setup-ref",
42
+ "checkedAll": "setup-ref",
43
+ "onClick": "setup-const",
44
+ "handleCheckedAllChange": "setup-const"
30
45
  } */
31
46
  import { defineComponent as _defineComponent } from 'vue';
32
- import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, unref as _unref, createVNode as _createVNode, mergeProps as _mergeProps, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock } from "vue";
33
- const _hoisted_1 = { class: "jtable-box" };
34
- const _hoisted_2 = {
47
+ import { unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, mergeProps as _mergeProps, renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, normalizeProps as _normalizeProps, createSlots as _createSlots, createBlock as _createBlock } from "vue";
48
+ const _hoisted_1 = {
35
49
  key: 0,
36
50
  class: "jtable-card"
37
51
  };
38
- const _hoisted_3 = {
39
- key: 1,
52
+ const _hoisted_2 = {
53
+ key: 0,
54
+ style: { "margin-bottom": "10px" }
55
+ };
56
+ const _hoisted_3 = ["onClick"];
57
+ const _hoisted_4 = {
58
+ key: 2,
40
59
  class: "j-table-empty"
41
60
  };
42
61
  import { useSlots, computed } from 'vue';
43
62
  import { _contentProps } from "./setting";
44
63
  import { Table } from 'ant-design-vue';
45
- import { get } from 'lodash-es';
64
+ import { get, omit } from 'lodash-es';
46
65
  import Empty from '../Empty';
66
+ import { useTableInject } from './hooks';
67
+ import useProTableStyle from './style';
68
+ import { useLocaleReceiver } from "../LocaleReciver";
47
69
  const __sfc_main__ = _defineComponent({
48
70
  ...{
49
71
  name: 'Content'
@@ -58,60 +80,107 @@ const __sfc_main__ = _defineComponent({
58
80
  setup(__props) {
59
81
  const props = __props;
60
82
  const slots = useSlots();
83
+ const [contextLocale] = useLocaleReceiver('ProTable');
84
+ const prefixCls = computed(() => 'pro-table');
85
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
86
+ const _rowSelection = useTableInject();
61
87
  const _columns = computed(() => props.columns.filter((i) => !_optionalChain([i, 'optionalAccess', _2 => _2.hideInTable])));
88
+ const _slots = computed(() => {
89
+ return omit(slots, ['emptyText', 'bodyCell']);
90
+ });
62
91
  const _scroll = computed(() => {
63
- let y = _optionalChain([props, 'access', _3 => _3.scroll, 'optionalAccess', _4 => _4.y]) || '100%';
92
+ if (props.scroll === false) {
93
+ return {
94
+ x: undefined,
95
+ y: undefined
96
+ };
97
+ }
64
98
  return {
65
- x: _optionalChain([props, 'access', _5 => _5.scroll, 'optionalAccess', _6 => _6.x]) || '100%',
66
- y
99
+ x: props.scroll.x === false ? undefined : props.scroll.x || '100%',
100
+ y: props.scroll.y === false ? undefined : props.scroll.y || '100%'
67
101
  };
68
102
  });
69
103
  const gridTemplateColumns = computed(() => {
70
104
  return `repeat(${props.column}, 1fr)`;
71
105
  });
106
+ const __rowSelection = computed(() => {
107
+ return props.rowSelection || _optionalChain([_rowSelection, 'optionalAccess', _3 => _3.value]);
108
+ });
109
+ const indeterminate = computed(() => {
110
+ return _optionalChain([__rowSelection, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.selectedRowKeys, 'optionalAccess', _6 => _6.length]) > 0 && _optionalChain([__rowSelection, 'access', _7 => _7.value, 'optionalAccess', _8 => _8.selectedRowKeys, 'optionalAccess', _9 => _9.length]) < props.dataSource.length;
111
+ });
112
+ const checkedAll = computed(() => {
113
+ return _optionalChain([__rowSelection, 'access', _10 => _10.value, 'optionalAccess', _11 => _11.selectedRowKeys, 'optionalAccess', _12 => _12.length]) > 0 && _optionalChain([__rowSelection, 'access', _13 => _13.value, 'optionalAccess', _14 => _14.selectedRowKeys, 'optionalAccess', _15 => _15.length]) === props.dataSource.length;
114
+ });
115
+ const onClick = (item) => {
116
+ if (_rowSelection && _rowSelection.value) {
117
+ const _selected = _optionalChain([_rowSelection, 'access', _16 => _16.value, 'access', _17 => _17.selectedRowKeys, 'optionalAccess', _18 => _18.includes, 'call', _19 => _19(item[props.rowKey])]);
118
+ _optionalChain([_rowSelection, 'access', _20 => _20.value, 'access', _21 => _21.onSelect, 'optionalCall', _22 => _22(item, !_selected)]);
119
+ }
120
+ };
121
+ const handleCheckedAllChange = (e) => {
122
+ const flag = e.target.checked;
123
+ _optionalChain([__rowSelection, 'access', _23 => _23.value, 'optionalAccess', _24 => _24.onSelectAll, 'optionalCall', _25 => _25(flag, props.dataSource, props.dataSource)]);
124
+ };
72
125
  return (_ctx, _cache) => {
73
- return (_openBlock(), _createElementBlock("div", _hoisted_1, [
126
+ const _component_a_checkbox = _resolveComponent("a-checkbox");
127
+ return (_openBlock(), _createElementBlock("div", {
128
+ class: _normalizeClass(['jtable-box', _unref(hashId)])
129
+ }, [
74
130
  (_ctx.mode === 'CARD')
75
- ? (_openBlock(), _createElementBlock("div", _hoisted_2, [
131
+ ? (_openBlock(), _createElementBlock("div", _hoisted_1, [
132
+ (__rowSelection.value && __rowSelection.value.type === 'checkbox')
133
+ ? (_openBlock(), _createElementBlock("div", _hoisted_2, [
134
+ _createVNode(_component_a_checkbox, {
135
+ indeterminate: indeterminate.value,
136
+ checked: checkedAll.value,
137
+ onChange: handleCheckedAllChange
138
+ }, {
139
+ default: _withCtx(() => [
140
+ _createTextVNode(_toDisplayString(_unref(contextLocale).select.all), 1 /* TEXT */)
141
+ ]),
142
+ _: 1 /* STABLE */
143
+ }, 8 /* PROPS */, ["indeterminate", "checked"])
144
+ ]))
145
+ : _createCommentVNode("v-if", true),
76
146
  (_ctx.dataSource.length)
77
147
  ? (_openBlock(), _createElementBlock("div", {
78
- key: 0,
148
+ key: 1,
79
149
  class: "jtable-card-items",
80
150
  style: _normalizeStyle({ gridTemplateColumns: gridTemplateColumns.value })
81
151
  }, [
82
152
  (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.dataSource, (item) => {
83
153
  return (_openBlock(), _createElementBlock("div", {
84
154
  class: _normalizeClass(['jtable-card-item', props.cardBodyClass]),
85
- key: item[props.rowKey]
155
+ key: item[props.rowKey],
156
+ onClick: ($event) => (onClick(item))
86
157
  }, [
87
- _renderSlot(_ctx.$slots, "card", _normalizeProps(_guardReactiveProps(item)))
88
- ], 2 /* CLASS */));
158
+ _renderSlot(_ctx.$slots, "card", _mergeProps({ ref_for: true }, item))
159
+ ], 10 /* CLASS, PROPS */, _hoisted_3));
89
160
  }), 128 /* KEYED_FRAGMENT */))
90
161
  ], 4 /* STYLE */))
91
- : (_openBlock(), _createElementBlock("div", _hoisted_3, [
162
+ : (_openBlock(), _createElementBlock("div", _hoisted_4, [
92
163
  _renderSlot(_ctx.$slots, "emptyText", {}, () => [
93
164
  _createVNode(_unref(Empty))
94
165
  ])
95
166
  ]))
96
167
  ]))
97
168
  : (_openBlock(), _createBlock(_unref(Table), _mergeProps({ key: 1 }, props, {
169
+ "row-selection": __rowSelection.value,
98
170
  dataSource: _ctx.dataSource,
99
171
  columns: _columns.value,
100
172
  pagination: false,
101
173
  scroll: _scroll.value,
102
- class: { 'j-table-scroll': !_optionalChain([props, 'access', _7 => _7.scroll, 'optionalAccess', _8 => _8.y]) }
103
- }), {
104
- headerCell: _withCtx(({ column, title }) => [
105
- _renderSlot(_ctx.$slots, "headerCell", _normalizeProps(_guardReactiveProps({ column, title })))
106
- ]),
174
+ class: { 'j-table-scroll': !_optionalChain([props, 'access', _26 => _26.scroll, 'optionalAccess', _27 => _27.y]) }
175
+ }), _createSlots({
107
176
  bodyCell: _withCtx(({ column, record, index }) => [
108
- ((_optionalChain([column, 'optionalAccess', _9 => _9.key]) || _optionalChain([column, 'optionalAccess', _10 => _10.dataIndex])) && _optionalChain([column, 'optionalAccess', _11 => _11.scopedSlots]) && (_optionalChain([_unref, 'call', _12 => _12(slots), 'optionalAccess', _13 => _13[_optionalChain([column, 'optionalAccess', _14 => _14.dataIndex])]]) || _optionalChain([_unref, 'call', _15 => _15(slots), 'optionalAccess', _16 => _16[_optionalChain([column, 'optionalAccess', _17 => _17.key])]])))
109
- ? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _18 => _18.key]) || _optionalChain([column, 'optionalAccess', _19 => _19.dataIndex]), _mergeProps({ key: 0 }, record, {
177
+ ((_optionalChain([column, 'optionalAccess', _28 => _28.key]) || _optionalChain([column, 'optionalAccess', _29 => _29.dataIndex])) && _optionalChain([column, 'optionalAccess', _30 => _30.scopedSlots]) && (_optionalChain([_slots, 'access', _31 => _31.value, 'optionalAccess', _32 => _32[_optionalChain([column, 'optionalAccess', _33 => _33.dataIndex])]]) || _optionalChain([_slots, 'access', _34 => _34.value, 'optionalAccess', _35 => _35[_optionalChain([column, 'optionalAccess', _36 => _36.key])]])))
178
+ ? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _37 => _37.key]) || _optionalChain([column, 'optionalAccess', _38 => _38.dataIndex]), _mergeProps({ key: 0 }, record, {
110
179
  index: index,
111
180
  column: column
112
181
  }))
113
182
  : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
114
- _createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _20 => _20.dataIndex]) || _optionalChain([column, 'optionalAccess', _21 => _21.key])) || '--'), 1 /* TEXT */)
183
+ _createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _39 => _39.dataIndex]) || _optionalChain([column, 'optionalAccess', _40 => _40.key])) || '--'), 1 /* TEXT */)
115
184
  ], 64 /* STABLE_FRAGMENT */))
116
185
  ]),
117
186
  emptyText: _withCtx(() => [
@@ -119,9 +188,20 @@ const __sfc_main__ = _defineComponent({
119
188
  _createVNode(_unref(Empty))
120
189
  ])
121
190
  ]),
122
- _: 3 /* FORWARDED */
123
- }, 16 /* FULL_PROPS */, ["dataSource", "columns", "scroll", "class"]))
124
- ]));
191
+ _: 2 /* DYNAMIC */
192
+ }, [
193
+ _renderList(_slots.value, (_, slotKey) => {
194
+ return {
195
+ name: slotKey,
196
+ fn: _withCtx((slotProps) => [
197
+ (!((_optionalChain([__props, 'access', _41 => _41.column, 'optionalAccess', _42 => _42.key]) || _optionalChain([__props, 'access', _43 => _43.column, 'optionalAccess', _44 => _44.dataIndex])) && _optionalChain([__props, 'access', _45 => _45.column, 'optionalAccess', _46 => _46.scopedSlots]) && (_optionalChain([_slots, 'access', _47 => _47.value, 'optionalAccess', _48 => _48[_optionalChain([__props, 'access', _49 => _49.column, 'optionalAccess', _50 => _50.dataIndex])]]) || _optionalChain([_slots, 'access', _51 => _51.value, 'optionalAccess', _52 => _52[_optionalChain([__props, 'access', _53 => _53.column, 'optionalAccess', _54 => _54.key])]]))))
198
+ ? _renderSlot(_ctx.$slots, slotKey, _normalizeProps(_mergeProps({ key: 0 }, slotProps)))
199
+ : _createCommentVNode("v-if", true)
200
+ ])
201
+ };
202
+ })
203
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["row-selection", "dataSource", "columns", "scroll", "class"]))
204
+ ], 2 /* CLASS */));
125
205
  };
126
206
  }
127
207
  });
@@ -1,24 +1,30 @@
1
1
  /* Analyzed bindings: {
2
2
  "initMode": "props",
3
+ "computed": "setup-const",
3
4
  "RadioGroup": "setup-maybe-ref",
4
5
  "RadioButton": "setup-maybe-ref",
5
6
  "AIcon": "setup-maybe-ref",
6
7
  "_headerProps": "setup-maybe-ref",
8
+ "useProTableStyle": "setup-maybe-ref",
7
9
  "props": "setup-reactive-const",
8
- "emits": "setup-const"
10
+ "emits": "setup-const",
11
+ "prefixCls": "setup-ref",
12
+ "wrapSSR": "setup-maybe-ref",
13
+ "hashId": "setup-maybe-ref"
9
14
  } */
10
15
  import { defineComponent as _defineComponent } from 'vue';
11
- import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
12
- const _hoisted_1 = { class: "jtable-body-header" };
13
- const _hoisted_2 = { class: "jtable-body-header-left" };
14
- const _hoisted_3 = { class: "jtable-body-header-right" };
15
- const _hoisted_4 = {
16
+ import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from "vue";
17
+ const _hoisted_1 = { class: "jtable-body-header-left" };
18
+ const _hoisted_2 = { class: "jtable-body-header-right" };
19
+ const _hoisted_3 = {
16
20
  key: 0,
17
21
  class: "table-body-header-right-button"
18
22
  };
23
+ import { computed } from 'vue';
19
24
  import { RadioGroup, RadioButton } from 'ant-design-vue';
20
25
  import AIcon from '../Icon';
21
26
  import { _headerProps } from './setting';
27
+ import useProTableStyle from './style';
22
28
  const __sfc_main__ = _defineComponent({
23
29
  ...{
24
30
  name: 'Header'
@@ -34,15 +40,19 @@ const __sfc_main__ = _defineComponent({
34
40
  setup(__props, { emit: __emit }) {
35
41
  const props = __props;
36
42
  const emits = __emit;
43
+ const prefixCls = computed(() => 'pro-table');
44
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
37
45
  return (_ctx, _cache) => {
38
- return (_openBlock(), _createElementBlock("div", _hoisted_1, [
39
- _createElementVNode("div", _hoisted_2, [
46
+ return (_openBlock(), _createElementBlock("div", {
47
+ class: _normalizeClass(['jtable-body-header', _unref(hashId)])
48
+ }, [
49
+ _createElementVNode("div", _hoisted_1, [
40
50
  _renderSlot(_ctx.$slots, "headerLeftRender")
41
51
  ]),
42
- _createElementVNode("div", _hoisted_3, [
52
+ _createElementVNode("div", _hoisted_2, [
43
53
  _renderSlot(_ctx.$slots, "headerRightRender"),
44
54
  (!__props.initMode)
45
- ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
55
+ ? (_openBlock(), _createElementBlock("div", _hoisted_3, [
46
56
  _createVNode(_unref(RadioGroup), {
47
57
  value: _ctx.mode,
48
58
  onChange: _cache[0] || (_cache[0] = (e) => emits('change', e))
@@ -66,7 +76,7 @@ const __sfc_main__ = _defineComponent({
66
76
  ]))
67
77
  : _createCommentVNode("v-if", true)
68
78
  ])
69
- ]));
79
+ ], 2 /* CLASS */));
70
80
  };
71
81
  }
72
82
  });
@@ -19,20 +19,24 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
19
19
  "_paginationProps": "setup-maybe-ref",
20
20
  "computed": "setup-const",
21
21
  "useLocaleReceiver": "setup-maybe-ref",
22
+ "useProTableStyle": "setup-maybe-ref",
22
23
  "props": "setup-reactive-const",
23
24
  "emits": "setup-const",
24
25
  "contextLocale": "setup-maybe-ref",
26
+ "prefixCls": "setup-ref",
27
+ "wrapSSR": "setup-maybe-ref",
28
+ "hashId": "setup-maybe-ref",
25
29
  "className": "setup-ref",
26
30
  "_showTotal": "setup-const",
27
31
  "onChange": "setup-const"
28
32
  } */
29
33
  import { defineComponent as _defineComponent } from 'vue';
30
- import { renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
31
- const _hoisted_1 = { class: "jtable-pagination" };
34
+ import { unref as _unref, renderSlot as _renderSlot, mergeProps as _mergeProps, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
32
35
  import { Pagination } from 'ant-design-vue';
33
36
  import { _paginationProps } from "./setting";
34
37
  import { computed } from 'vue';
35
38
  import { useLocaleReceiver } from "../LocaleReciver";
39
+ import useProTableStyle from './style';
36
40
  const __sfc_main__ = _defineComponent({
37
41
  ...{
38
42
  name: 'JPagination'
@@ -43,6 +47,8 @@ const __sfc_main__ = _defineComponent({
43
47
  const props = __props;
44
48
  const emits = __emit;
45
49
  const [contextLocale] = useLocaleReceiver('ProTable');
50
+ const prefixCls = computed(() => 'pro-table');
51
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
46
52
  const className = computed(() => {
47
53
  return {
48
54
  'hide-content': !props.isShowContent,
@@ -62,7 +68,9 @@ const __sfc_main__ = _defineComponent({
62
68
  emits('change', page, size);
63
69
  };
64
70
  return (_ctx, _cache) => {
65
- return (_openBlock(), _createElementBlock("div", _hoisted_1, [
71
+ return (_openBlock(), _createElementBlock("div", {
72
+ class: _normalizeClass(['jtable-pagination', _unref(hashId)])
73
+ }, [
66
74
  _renderSlot(_ctx.$slots, "default", {}, () => [
67
75
  _createVNode(_unref(Pagination), _mergeProps(props, {
68
76
  total: _ctx.total,
@@ -73,7 +81,7 @@ const __sfc_main__ = _defineComponent({
73
81
  onChange: onChange
74
82
  }), null, 16 /* FULL_PROPS */, ["total", "pageSize", "current", "show-total", "class"])
75
83
  ])
76
- ]));
84
+ ], 2 /* CLASS */));
77
85
  };
78
86
  }
79
87
  });
@@ -22,6 +22,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
22
22
  } return value; }
23
23
  /* Analyzed bindings: {
24
24
  "proTableProps": "setup-maybe-ref",
25
+ "Spin": "setup-maybe-ref",
25
26
  "Header": "setup-const",
26
27
  "Alert": "setup-const",
27
28
  "Content": "setup-const",
@@ -36,7 +37,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
36
37
  "inject": "setup-const",
37
38
  "debounce": "setup-maybe-ref",
38
39
  "TableConfig": "setup-maybe-ref",
39
- "JSkeletonList": "setup-maybe-ref",
40
+ "useTableInject": "setup-maybe-ref",
41
+ "useProTableStyle": "setup-maybe-ref",
40
42
  "tableConfig": "setup-maybe-ref",
41
43
  "props": "setup-reactive-const",
42
44
  "slots": "setup-maybe-ref",
@@ -46,7 +48,11 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
46
48
  "_mode": "setup-ref",
47
49
  "column": "setup-ref",
48
50
  "page": "setup-reactive-const",
51
+ "prefixCls": "setup-ref",
52
+ "wrapSSR": "setup-maybe-ref",
53
+ "hashId": "setup-maybe-ref",
49
54
  "extraSlots": "setup-const",
55
+ "_rowSelection": "setup-maybe-ref",
50
56
  "showAlert": "setup-ref",
51
57
  "showPagination": "setup-ref",
52
58
  "onCheck": "setup-const",
@@ -60,9 +66,10 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
60
66
  "windowChange": "setup-const"
61
67
  } */
62
68
  import { defineComponent as _defineComponent } from 'vue';
63
- import { renderSlot as _renderSlot, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, normalizeProps as _normalizeProps, mergeProps as _mergeProps, renderList as _renderList, createSlots as _createSlots, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
69
+ import { unref as _unref, renderSlot as _renderSlot, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeProps as _normalizeProps, mergeProps as _mergeProps, renderList as _renderList, createSlots as _createSlots, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
64
70
  const _hoisted_1 = { class: "jtable-body" };
65
71
  import { proTableProps } from "./setting";
72
+ import { Spin } from 'ant-design-vue';
66
73
  import Header from './Header.js';
67
74
  import Alert from './Alert.js';
68
75
  import Content from './Content.js';
@@ -70,7 +77,8 @@ import Pagination from './Pagination.js';
70
77
  import { useSlots, watch, onMounted, onUnmounted, computed, ref, reactive, inject } from "vue";
71
78
  import { debounce } from 'lodash-es';
72
79
  import { TableConfig } from "../utils/constants";
73
- import { JSkeletonList } from "../Skeleton";
80
+ import { useTableInject } from "./hooks";
81
+ import useProTableStyle from "./style";
74
82
  const __sfc_main__ = _defineComponent({
75
83
  ...{
76
84
  name: 'JProTable'
@@ -98,16 +106,19 @@ const __sfc_main__ = _defineComponent({
98
106
  });
99
107
  const loading = ref(false);
100
108
  const _dataSource = ref([]);
101
- const _mode = ref(!props.mode ? (props.modeValue || 'CARD') : props.mode);
109
+ const _mode = ref(props.mode || props.modeValue || 'CARD');
102
110
  const column = ref(4);
103
111
  const page = reactive({
104
112
  pageIndex: 0,
105
113
  pageSize: 12,
106
114
  total: 0
107
115
  });
116
+ const prefixCls = computed(() => 'pro-table');
117
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
108
118
  const extraSlots = ['headerRightRender', 'headerLeftRender', 'paginationRender', 'alertRender'];
119
+ const _rowSelection = useTableInject();
109
120
  const showAlert = computed(() => {
110
- return props.alertShow && _optionalChain([props, 'optionalAccess', _2 => _2.rowSelection, 'optionalAccess', _3 => _3.selectedRowKeys, 'optionalAccess', _4 => _4.length]);
121
+ return props.alertShow && (_optionalChain([props, 'access', _2 => _2.rowSelection, 'optionalAccess', _3 => _3.selectedRowKeys, 'optionalAccess', _4 => _4.length]) || _optionalChain([_rowSelection, 'optionalAccess', _5 => _5.value, 'optionalAccess', _6 => _6.selectedRowKeys, 'optionalAccess', _7 => _7.length]));
111
122
  });
112
123
  const showPagination = computed(() => {
113
124
  return !!_dataSource.value.length && !props.noPagination && props.type === 'PAGE';
@@ -118,17 +129,17 @@ const __sfc_main__ = _defineComponent({
118
129
  const handleData = (result) => {
119
130
  if (props.type === 'PAGE') {
120
131
  // 判断如果是最后一页且最后一页为空,就跳转到前一页
121
- if (_optionalChain([result, 'optionalAccess', _5 => _5.total]) &&
122
- _optionalChain([result, 'optionalAccess', _6 => _6.pageSize]) &&
123
- _optionalChain([result, 'optionalAccess', _7 => _7.pageIndex]) &&
124
- _optionalChain([result, 'optionalAccess', _8 => _8.data, 'optionalAccess', _9 => _9.length]) === 0) {
132
+ if (_optionalChain([result, 'optionalAccess', _8 => _8.total]) &&
133
+ _optionalChain([result, 'optionalAccess', _9 => _9.pageSize]) &&
134
+ _optionalChain([result, 'optionalAccess', _10 => _10.pageIndex]) &&
135
+ _optionalChain([result, 'optionalAccess', _11 => _11.data, 'optionalAccess', _12 => _12.length]) === 0) {
125
136
  return true;
126
137
  }
127
138
  else {
128
- _dataSource.value = _optionalChain([result, 'optionalAccess', _10 => _10.data]) || [];
129
- page.pageIndex = _optionalChain([result, 'optionalAccess', _11 => _11.pageIndex]) || 0;
130
- page.pageSize = _optionalChain([result, 'optionalAccess', _12 => _12.pageSize]) || 12;
131
- page.total = _optionalChain([result, 'optionalAccess', _13 => _13.total]) || 0;
139
+ _dataSource.value = _optionalChain([result, 'optionalAccess', _13 => _13.data]) || [];
140
+ page.pageIndex = _optionalChain([result, 'optionalAccess', _14 => _14.pageIndex]) || 0;
141
+ page.pageSize = _optionalChain([result, 'optionalAccess', _15 => _15.pageSize]) || 12;
142
+ page.total = _optionalChain([result, 'optionalAccess', _16 => _16.total]) || 0;
132
143
  }
133
144
  }
134
145
  else {
@@ -147,8 +158,8 @@ const __sfc_main__ = _defineComponent({
147
158
  ...props.defaultParams,
148
159
  ..._params,
149
160
  terms: [
150
- ...(_optionalChain([props, 'access', _14 => _14.defaultParams, 'optionalAccess', _15 => _15.terms]) || []),
151
- ...(_optionalChain([_params, 'optionalAccess', _16 => _16.terms]) || []),
161
+ ...(_optionalChain([props, 'access', _17 => _17.defaultParams, 'optionalAccess', _18 => _18.terms]) || []),
162
+ ...(_optionalChain([_params, 'optionalAccess', _19 => _19.terms]) || []),
152
163
  ],
153
164
  };
154
165
  loading.value = true;
@@ -183,8 +194,13 @@ const __sfc_main__ = _defineComponent({
183
194
  });
184
195
  };
185
196
  const onClose = () => {
186
- _optionalChain([props, 'access', _17 => _17.rowSelection, 'optionalAccess', _18 => _18.onChange, 'optionalCall', _19 => _19([], [])]);
187
- _optionalChain([props, 'access', _20 => _20.rowSelection, 'optionalAccess', _21 => _21.onSelectNone, 'optionalCall', _22 => _22()]);
197
+ if (props.rowSelection) {
198
+ _optionalChain([props, 'access', _20 => _20.rowSelection, 'access', _21 => _21.onChange, 'optionalCall', _22 => _22([], [])]);
199
+ _optionalChain([props, 'access', _23 => _23.rowSelection, 'access', _24 => _24.onSelectNone, 'optionalCall', _25 => _25()]);
200
+ }
201
+ else if (_optionalChain([_rowSelection, 'optionalAccess', _26 => _26.value])) {
202
+ _optionalChain([_rowSelection, 'access', _27 => _27.value, 'optionalAccess', _28 => _28.onSelectNone, 'optionalCall', _29 => _29()]);
203
+ }
188
204
  };
189
205
  /**
190
206
  * 刷新数据
@@ -199,10 +215,10 @@ const __sfc_main__ = _defineComponent({
199
215
  });
200
216
  };
201
217
  const _gridColumns = computed(() => {
202
- if (_optionalChain([props, 'access', _23 => _23.gridColumns, 'optionalAccess', _24 => _24.length])) {
218
+ if (_optionalChain([props, 'access', _30 => _30.gridColumns, 'optionalAccess', _31 => _31.length])) {
203
219
  const arr = props.gridColumns;
204
- const lastValue = _optionalChain([arr, 'access', _25 => _25.slice, 'call', _26 => _26(-1), 'optionalAccess', _27 => _27[0]]);
205
- if (_optionalChain([arr, 'optionalAccess', _28 => _28.length]) < 4) {
220
+ const lastValue = _optionalChain([arr, 'access', _32 => _32.slice, 'call', _33 => _33(-1), 'optionalAccess', _34 => _34[0]]);
221
+ if (_optionalChain([arr, 'optionalAccess', _35 => _35.length]) < 4) {
206
222
  while (arr.length < 4) {
207
223
  arr.push(lastValue);
208
224
  }
@@ -223,16 +239,16 @@ const __sfc_main__ = _defineComponent({
223
239
  const styles = window.getComputedStyle(ele);
224
240
  const width = parseFloat(styles.width);
225
241
  if (width <= 992) {
226
- column.value = _optionalChain([_gridColumns, 'access', _29 => _29.value, 'optionalAccess', _30 => _30[0]]) || 1;
242
+ column.value = _optionalChain([_gridColumns, 'access', _36 => _36.value, 'optionalAccess', _37 => _37[0]]) || 1;
227
243
  }
228
244
  else if (width > 992 && width <= 1440) {
229
- column.value = _optionalChain([_gridColumns, 'access', _31 => _31.value, 'optionalAccess', _32 => _32[1]]) || 2;
245
+ column.value = _optionalChain([_gridColumns, 'access', _38 => _38.value, 'optionalAccess', _39 => _39[1]]) || 2;
230
246
  }
231
247
  else if (width > 1440 && width <= 1600) {
232
- column.value = _optionalChain([_gridColumns, 'access', _33 => _33.value, 'optionalAccess', _34 => _34[2]]) || 3;
248
+ column.value = _optionalChain([_gridColumns, 'access', _40 => _40.value, 'optionalAccess', _41 => _41[2]]) || 3;
233
249
  }
234
250
  else if (width > 1600) {
235
- column.value = _optionalChain([_gridColumns, 'access', _35 => _35.value, 'optionalAccess', _36 => _36[3]]) || 4;
251
+ column.value = _optionalChain([_gridColumns, 'access', _42 => _42.value, 'optionalAccess', _43 => _43[3]]) || 4;
236
252
  }
237
253
  }
238
254
  };
@@ -256,15 +272,11 @@ const __sfc_main__ = _defineComponent({
256
272
  __expose({ reload, dataSource: _dataSource });
257
273
  return (_ctx, _cache) => {
258
274
  return (_openBlock(), _createElementBlock("div", {
259
- class: "jtable-body-spin",
275
+ class: _normalizeClass(['jtable-body-spin', _unref(hashId)]),
260
276
  style: _normalizeStyle(_ctx.bodyStyle),
261
277
  id: "jtable-body-spin"
262
278
  }, [
263
- _createVNode(_unref(JSkeletonList), {
264
- loading: loading.value,
265
- active: true,
266
- mode: _mode.value
267
- }, {
279
+ _createVNode(_unref(Spin), { spinning: loading.value }, {
268
280
  default: _withCtx(() => [
269
281
  _createElementVNode("div", _hoisted_1, [
270
282
  _createVNode(Header, {
@@ -284,12 +296,12 @@ const __sfc_main__ = _defineComponent({
284
296
  (showAlert.value)
285
297
  ? (_openBlock(), _createBlock(Alert, {
286
298
  key: 0,
287
- rowSelection: _ctx.rowSelection,
299
+ rowSelection: _ctx.rowSelection || _unref(_rowSelection),
288
300
  onClose: onClose
289
301
  }, {
290
302
  default: _withCtx(() => [
291
303
  _renderSlot(_ctx.$slots, "alertRender", {
292
- rowSelection: _ctx.rowSelection,
304
+ rowSelection: _ctx.rowSelection || _unref(_rowSelection),
293
305
  onClose: onClose
294
306
  })
295
307
  ]),
@@ -335,8 +347,8 @@ const __sfc_main__ = _defineComponent({
335
347
  ])
336
348
  ]),
337
349
  _: 3 /* FORWARDED */
338
- }, 8 /* PROPS */, ["loading", "mode"])
339
- ], 4 /* STYLE */));
350
+ }, 8 /* PROPS */, ["spinning"])
351
+ ], 6 /* CLASS, STYLE */));
340
352
  };
341
353
  }
342
354
  });
@@ -0,0 +1,2 @@
1
+ export * from './useTableSelection';
2
+ export * from './useTableInject';
@@ -0,0 +1,5 @@
1
+ import { PROTABLE_ROW_SELECTION_KEY } from "./useTableSelection";
2
+ import { inject } from "vue";
3
+ export var useTableInject = function useTableInject() {
4
+ return inject(PROTABLE_ROW_SELECTION_KEY, null);
5
+ };