@king-design/intact 3.6.2-beta.1 → 3.7.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 (281) hide show
  1. package/components/.DS_Store +0 -0
  2. package/components/anchor/constants.ts +3 -0
  3. package/components/anchor/demos/basic.md +34 -0
  4. package/components/anchor/demos/container.md +76 -0
  5. package/components/anchor/demos/events.md +100 -0
  6. package/components/anchor/demos/horizontal.md +33 -0
  7. package/components/anchor/demos/nested.md +132 -0
  8. package/components/anchor/index.md +38 -0
  9. package/components/anchor/index.spec.ts +171 -0
  10. package/components/anchor/index.ts +159 -0
  11. package/components/anchor/index.vdt +24 -0
  12. package/components/anchor/link.ts +44 -0
  13. package/components/anchor/link.vdt +49 -0
  14. package/components/anchor/styles.ts +50 -0
  15. package/components/anchor/useScroll.ts +221 -0
  16. package/components/config/demos/basic.md +11 -3
  17. package/components/descriptions/.DS_Store +0 -0
  18. package/components/dialog/base.vdt +3 -1
  19. package/components/drawer/demos/resizable.md +67 -0
  20. package/components/drawer/index.md +1 -0
  21. package/components/drawer/index.spec.ts +43 -0
  22. package/components/drawer/index.ts +14 -0
  23. package/components/drawer/index.vdt +20 -3
  24. package/components/drawer/styles.ts +44 -0
  25. package/components/drawer/useDrawerResizable.ts +190 -0
  26. package/components/icon/demos/color.md +1 -1
  27. package/components/icon/demos/icons.md +18 -0
  28. package/components/menu/.DS_Store +0 -0
  29. package/components/menu/demos/.DS_Store +0 -0
  30. package/components/menu/demos/collapse.md +2 -2
  31. package/components/menu/demos/showCollapseArrow.md +3 -3
  32. package/components/menu/demos/size.md +4 -4
  33. package/components/menu/styles.ts +7 -3
  34. package/components/notification/demos/basic.md +27 -0
  35. package/components/notification/demos/close.md +52 -0
  36. package/components/notification/demos/duration.md +43 -0
  37. package/components/notification/demos/events.md +39 -0
  38. package/components/notification/demos/hideClose.md +30 -0
  39. package/components/notification/demos/icon.md +47 -0
  40. package/components/notification/demos/position.md +39 -0
  41. package/components/notification/demos/types.md +38 -0
  42. package/components/notification/index.md +62 -0
  43. package/components/notification/index.spec.ts +211 -0
  44. package/components/notification/index.ts +2 -0
  45. package/components/notification/notification.ts +185 -0
  46. package/components/notification/notification.vdt +62 -0
  47. package/components/notification/notifications.ts +46 -0
  48. package/components/notification/notifications.vdt +16 -0
  49. package/components/notification/styles.ts +179 -0
  50. package/components/select/styles.ts +2 -0
  51. package/components/table/.DS_Store +0 -0
  52. package/components/table/demos/hidden.md +8 -2
  53. package/components/table/demos/sort.md +4 -4
  54. package/components/table/styles.ts +6 -2
  55. package/components/tabs/useActiveBar.ts +3 -3
  56. package/components/tag/base.ts +4 -0
  57. package/components/tag/demos/border.md +1 -1
  58. package/components/tag/demos/color.md +40 -0
  59. package/components/tag/demos/draggable.md +1 -1
  60. package/components/tag/demos/tags.md +1 -1
  61. package/components/tag/index.md +1 -0
  62. package/components/tag/index.spec.ts +8 -0
  63. package/components/tag/index.vdt +6 -4
  64. package/components/tag/styles.ts +23 -0
  65. package/components/tag/useColor.ts +79 -0
  66. package/components/timepicker/index.spec.ts +16 -5
  67. package/components/timepicker/useDefaultValue.ts +16 -7
  68. package/components/timepicker/useStep.ts +3 -2
  69. package/components/tour/.DS_Store +0 -0
  70. package/components/transfer/demos/customFilter.md +1 -1
  71. package/components/transfer/demos/customList.md +1 -1
  72. package/components/transfer/demos/getData.md +1 -1
  73. package/components/transfer/demos/leftChecked.md +1 -1
  74. package/components/transfer/demos/pagination.md +63 -0
  75. package/components/transfer/demos/table.md +248 -0
  76. package/components/transfer/demos/tree.md +1 -1
  77. package/components/transfer/index.md +2 -0
  78. package/components/transfer/index.spec.ts +147 -0
  79. package/components/transfer/index.ts +7 -0
  80. package/components/transfer/index.vdt +30 -4
  81. package/components/transfer/styles.ts +11 -1
  82. package/components/transfer/useCheck.ts +5 -5
  83. package/components/transfer/usePagination.ts +92 -0
  84. package/components/virtualList/.DS_Store +0 -0
  85. package/components/virtualList/demos/.DS_Store +0 -0
  86. package/dist/fonts/iconfont.eot +0 -0
  87. package/dist/fonts/iconfont.svg +235 -0
  88. package/dist/fonts/iconfont.ttf +0 -0
  89. package/dist/fonts/iconfont.woff +0 -0
  90. package/dist/fonts/iconfont.woff2 +0 -0
  91. package/dist/fonts/ionicons.eot +0 -0
  92. package/dist/fonts/ionicons.svg +2230 -0
  93. package/dist/fonts/ionicons.ttf +0 -0
  94. package/dist/fonts/ionicons.woff +0 -0
  95. package/dist/fonts/ionicons.woff2 +0 -0
  96. package/dist/i18n/en-US.js +1411 -0
  97. package/dist/i18n/en-US.js.map +1 -0
  98. package/dist/i18n/en-US.min.js +1 -0
  99. package/dist/i18n/index.js +283 -0
  100. package/dist/i18n/index.js.map +1 -0
  101. package/dist/i18n/index.min.js +1 -0
  102. package/dist/kpc.js +50764 -0
  103. package/dist/kpc.js.map +1 -0
  104. package/dist/kpc.min.js +1 -0
  105. package/dist/kpc.react.js +58380 -0
  106. package/dist/kpc.react.js.map +1 -0
  107. package/dist/kpc.react.min.js +1 -0
  108. package/dist/kpc.tmp.js.map +1 -0
  109. package/dist/kpc.vue-legacy.js +58272 -0
  110. package/dist/kpc.vue-legacy.js.map +1 -0
  111. package/dist/kpc.vue-legacy.min.js +1 -0
  112. package/dist/kpc.vue.js +58128 -0
  113. package/dist/kpc.vue.js.map +1 -0
  114. package/dist/kpc.vue.min.js +1 -0
  115. package/es/components/anchor/constants.d.ts +2 -0
  116. package/es/components/anchor/constants.js +2 -0
  117. package/es/components/anchor/index.d.ts +41 -0
  118. package/es/components/anchor/index.js +141 -0
  119. package/es/components/anchor/index.spec.d.ts +1 -0
  120. package/es/components/anchor/index.spec.js +230 -0
  121. package/es/components/anchor/index.vdt.js +31 -0
  122. package/es/components/anchor/link.d.ts +16 -0
  123. package/es/components/anchor/link.js +52 -0
  124. package/es/components/anchor/link.vdt.js +49 -0
  125. package/es/components/anchor/styles.d.ts +5 -0
  126. package/es/components/anchor/styles.js +30 -0
  127. package/es/components/anchor/useScroll.d.ts +7 -0
  128. package/es/components/anchor/useScroll.js +218 -0
  129. package/es/components/dialog/base.vdt.js +1 -1
  130. package/es/components/drawer/index.d.ts +3 -0
  131. package/es/components/drawer/index.js +22 -3
  132. package/es/components/drawer/index.spec.js +83 -0
  133. package/es/components/drawer/index.vdt.js +23 -3
  134. package/es/components/drawer/styles.js +1 -1
  135. package/es/components/drawer/useDrawerResizable.d.ts +10 -0
  136. package/es/components/drawer/useDrawerResizable.js +162 -0
  137. package/es/components/menu/styles.d.ts +1 -0
  138. package/es/components/menu/styles.js +4 -1
  139. package/es/components/notification/index.d.ts +1 -0
  140. package/es/components/notification/index.js +1 -0
  141. package/es/components/notification/index.spec.d.ts +1 -0
  142. package/es/components/notification/index.spec.js +317 -0
  143. package/es/components/notification/notification.d.ts +39 -0
  144. package/es/components/notification/notification.js +183 -0
  145. package/es/components/notification/notification.vdt.js +56 -0
  146. package/es/components/notification/notifications.d.ts +16 -0
  147. package/es/components/notification/notifications.js +51 -0
  148. package/es/components/notification/notifications.vdt.js +24 -0
  149. package/es/components/notification/styles.d.ts +9 -0
  150. package/es/components/notification/styles.js +110 -0
  151. package/es/components/select/styles.js +1 -1
  152. package/es/components/table/styles.js +1 -1
  153. package/es/components/tabs/useActiveBar.js +7 -3
  154. package/es/components/tag/base.d.ts +2 -0
  155. package/es/components/tag/base.js +3 -0
  156. package/es/components/tag/index.spec.js +17 -0
  157. package/es/components/tag/index.vdt.js +12 -5
  158. package/es/components/tag/styles.d.ts +9 -0
  159. package/es/components/tag/styles.js +14 -1
  160. package/es/components/tag/useColor.d.ts +7 -0
  161. package/es/components/tag/useColor.js +71 -0
  162. package/es/components/timepicker/index.spec.js +70 -42
  163. package/es/components/timepicker/useDefaultValue.js +12 -7
  164. package/es/components/timepicker/useStep.js +4 -2
  165. package/es/components/transfer/index.d.ts +13 -0
  166. package/es/components/transfer/index.js +6 -2
  167. package/es/components/transfer/index.spec.js +197 -0
  168. package/es/components/transfer/index.vdt.js +28 -5
  169. package/es/components/transfer/styles.js +4 -1
  170. package/es/components/transfer/useCheck.js +2 -1
  171. package/es/components/transfer/usePagination.d.ts +12 -0
  172. package/es/components/transfer/usePagination.js +79 -0
  173. package/es/index.d.ts +4 -2
  174. package/es/index.js +4 -2
  175. package/es/site/data/components/anchor/demos/basic/index.d.ts +11 -0
  176. package/es/site/data/components/anchor/demos/basic/index.js +18 -0
  177. package/es/site/data/components/anchor/demos/basic/react.d.ts +11 -0
  178. package/es/site/data/components/anchor/demos/basic/react.js +46 -0
  179. package/es/site/data/components/anchor/demos/container/index.d.ts +12 -0
  180. package/es/site/data/components/anchor/demos/container/index.js +19 -0
  181. package/es/site/data/components/anchor/demos/container/react.d.ts +12 -0
  182. package/es/site/data/components/anchor/demos/container/react.js +52 -0
  183. package/es/site/data/components/anchor/demos/events/index.d.ts +17 -0
  184. package/es/site/data/components/anchor/demos/events/index.js +36 -0
  185. package/es/site/data/components/anchor/demos/events/react.d.ts +17 -0
  186. package/es/site/data/components/anchor/demos/events/react.js +88 -0
  187. package/es/site/data/components/anchor/demos/horizontal/index.d.ts +11 -0
  188. package/es/site/data/components/anchor/demos/horizontal/index.js +18 -0
  189. package/es/site/data/components/anchor/demos/horizontal/react.d.ts +11 -0
  190. package/es/site/data/components/anchor/demos/horizontal/react.js +46 -0
  191. package/es/site/data/components/anchor/demos/nested/index.d.ts +12 -0
  192. package/es/site/data/components/anchor/demos/nested/index.js +19 -0
  193. package/es/site/data/components/anchor/demos/nested/react.d.ts +12 -0
  194. package/es/site/data/components/anchor/demos/nested/react.js +100 -0
  195. package/es/site/data/components/anchor/index.d.ts +57 -0
  196. package/es/site/data/components/anchor/index.js +32 -0
  197. package/es/site/data/components/config/demos/basic/index.d.ts +1 -0
  198. package/es/site/data/components/config/demos/basic/index.js +8 -1
  199. package/es/site/data/components/config/demos/basic/react.d.ts +1 -0
  200. package/es/site/data/components/config/demos/basic/react.js +15 -3
  201. package/es/site/data/components/drawer/demos/resizable/index.d.ts +15 -0
  202. package/es/site/data/components/drawer/demos/resizable/index.js +26 -0
  203. package/es/site/data/components/drawer/demos/resizable/react.d.ts +15 -0
  204. package/es/site/data/components/drawer/demos/resizable/react.js +63 -0
  205. package/es/site/data/components/icon/demos/icons/index.js +1 -1
  206. package/es/site/data/components/menu/demos/collapse/index.d.ts +6 -1
  207. package/es/site/data/components/menu/demos/collapse/react.d.ts +6 -1
  208. package/es/site/data/components/menu/demos/showCollapseArrow/index.d.ts +8 -1
  209. package/es/site/data/components/menu/demos/showCollapseArrow/react.d.ts +8 -1
  210. package/es/site/data/components/menu/demos/size/index.d.ts +7 -2
  211. package/es/site/data/components/menu/demos/size/react.d.ts +7 -2
  212. package/es/site/data/components/notification/demos/basic/index.d.ts +6 -0
  213. package/es/site/data/components/notification/demos/basic/index.js +21 -0
  214. package/es/site/data/components/notification/demos/basic/react.d.ts +5 -0
  215. package/es/site/data/components/notification/demos/basic/react.js +24 -0
  216. package/es/site/data/components/notification/demos/close/index.d.ts +13 -0
  217. package/es/site/data/components/notification/demos/close/index.js +38 -0
  218. package/es/site/data/components/notification/demos/close/react.d.ts +13 -0
  219. package/es/site/data/components/notification/demos/close/react.js +52 -0
  220. package/es/site/data/components/notification/demos/duration/index.d.ts +7 -0
  221. package/es/site/data/components/notification/demos/duration/index.js +33 -0
  222. package/es/site/data/components/notification/demos/duration/react.d.ts +6 -0
  223. package/es/site/data/components/notification/demos/duration/react.js +38 -0
  224. package/es/site/data/components/notification/demos/events/index.d.ts +6 -0
  225. package/es/site/data/components/notification/demos/events/index.js +31 -0
  226. package/es/site/data/components/notification/demos/events/react.d.ts +5 -0
  227. package/es/site/data/components/notification/demos/events/react.js +34 -0
  228. package/es/site/data/components/notification/demos/hideClose/index.d.ts +6 -0
  229. package/es/site/data/components/notification/demos/hideClose/index.js +25 -0
  230. package/es/site/data/components/notification/demos/hideClose/react.d.ts +5 -0
  231. package/es/site/data/components/notification/demos/hideClose/react.js +28 -0
  232. package/es/site/data/components/notification/demos/icon/index.d.ts +7 -0
  233. package/es/site/data/components/notification/demos/icon/index.js +33 -0
  234. package/es/site/data/components/notification/demos/icon/react.d.ts +6 -0
  235. package/es/site/data/components/notification/demos/icon/react.js +42 -0
  236. package/es/site/data/components/notification/demos/position/index.d.ts +9 -0
  237. package/es/site/data/components/notification/demos/position/index.js +27 -0
  238. package/es/site/data/components/notification/demos/position/react.d.ts +8 -0
  239. package/es/site/data/components/notification/demos/position/react.js +40 -0
  240. package/es/site/data/components/notification/demos/types/index.d.ts +9 -0
  241. package/es/site/data/components/notification/demos/types/index.js +26 -0
  242. package/es/site/data/components/notification/demos/types/react.d.ts +8 -0
  243. package/es/site/data/components/notification/demos/types/react.js +39 -0
  244. package/es/site/data/components/notification/index.d.ts +57 -0
  245. package/es/site/data/components/notification/index.js +32 -0
  246. package/es/site/data/components/table/demos/hidden/react.js +21 -3
  247. package/es/site/data/components/tag/demos/color/index.d.ts +10 -0
  248. package/es/site/data/components/tag/demos/color/index.js +19 -0
  249. package/es/site/data/components/tag/demos/color/react.d.ts +10 -0
  250. package/es/site/data/components/tag/demos/color/react.js +34 -0
  251. package/es/site/data/components/transfer/demos/pagination/index.d.ts +19 -0
  252. package/es/site/data/components/transfer/demos/pagination/index.js +42 -0
  253. package/es/site/data/components/transfer/demos/pagination/react.d.ts +20 -0
  254. package/es/site/data/components/transfer/demos/pagination/react.js +65 -0
  255. package/es/site/data/components/transfer/demos/table/index.d.ts +33 -0
  256. package/es/site/data/components/transfer/demos/table/index.js +132 -0
  257. package/es/site/data/components/transfer/demos/table/react.d.ts +35 -0
  258. package/es/site/data/components/transfer/demos/table/react.js +246 -0
  259. package/es/site/src/router/index.js +4 -33
  260. package/es/styles/fonts/iconfont.eot +0 -0
  261. package/es/styles/fonts/iconfont.js +1 -1
  262. package/es/styles/fonts/iconfont.svg +38 -0
  263. package/es/styles/fonts/iconfont.ttf +0 -0
  264. package/es/styles/fonts/iconfont.woff +0 -0
  265. package/es/styles/fonts/iconfont.woff2 +0 -0
  266. package/es/styles/theme.d.ts +8 -0
  267. package/es/styles/theme.js +5 -1
  268. package/index.ts +4 -2
  269. package/package.json +2 -2
  270. package/styles/.DS_Store +0 -0
  271. package/styles/fonts/demo_index.html +443 -6
  272. package/styles/fonts/iconfont.css +82 -6
  273. package/styles/fonts/iconfont.eot +0 -0
  274. package/styles/fonts/iconfont.js +1 -1
  275. package/styles/fonts/iconfont.json +133 -0
  276. package/styles/fonts/iconfont.svg +38 -0
  277. package/styles/fonts/iconfont.ts +76 -0
  278. package/styles/fonts/iconfont.ttf +0 -0
  279. package/styles/fonts/iconfont.woff +0 -0
  280. package/styles/fonts/iconfont.woff2 +0 -0
  281. package/styles/theme.ts +4 -0
@@ -45,6 +45,9 @@ var defaults = {
45
45
  },
46
46
  arrow: {
47
47
  gap: '16px 10px'
48
+ },
49
+ pagination: {
50
+ padding: '6px 0'
48
51
  }
49
52
  };
50
53
  var transfer;
@@ -55,5 +58,5 @@ setDefault(function () {
55
58
  makeStyles == null || makeStyles.clearCache();
56
59
  });
57
60
  export var makeStyles = cache(function makeStyles(k) {
58
- return /*#__PURE__*/css("font-size:", transfer.fontSize, ";.", k, "-transfer-panel,.", k, "-transfer-arrows{display:inline-block;vertical-align:middle;}.", k, "-transfer-panel{width:", transfer.panel.width, ";border:", transfer.panel.border, ";border-radius:", transfer.panel.borderRadius, ";height:", transfer.panel.height, ";display:inline-flex;flex-direction:column;overflow:auto;}.", k, "-transfer-title{line-height:", transfer.title.lineHeight, ";background:", transfer.title.bgColor, ";padding:", transfer.title.padding, ";.", k, "-checkbox{color:", transfer.title.color, ";font-size:", transfer.title.fontSize, ";}}.", k, "-transfer-count{float:right;margin-left:", transfer.title.countGap, ";}.", k, "-transfer-list{overflow:auto;position:relative;flex:1;}.", k, "-transfer-item{color:", transfer.item.color, ";background:", transfer.item.bgColor, ";user-select:none;width:100%;&:not(.", k, "-disabled):hover{background:", transfer.item.hoverBgColor, ";color:", transfer.item.hoverColor, ";p{color:", transfer.item.hoverColor, ";}}.", k, "-checkbox{padding:", transfer.item.padding, ";display:flex;}p{margin:0;color:", transfer.item.descColor, ";}&.", k, "-disabled{p{color:", theme.color.disabled, ";}}}.", k, "-input{width:auto;margin:", transfer.searchGap, ";}.", k, "-transfer-arrows{.", k, "-btn{display:flex;margin:", transfer.arrow.gap, ";}}");
61
+ return /*#__PURE__*/css("font-size:", transfer.fontSize, ";.", k, "-transfer-panel,.", k, "-transfer-arrows{display:inline-block;vertical-align:middle;}.", k, "-transfer-panel{width:", transfer.panel.width, ";border:", transfer.panel.border, ";border-radius:", transfer.panel.borderRadius, ";height:", transfer.panel.height, ";display:inline-flex;flex-direction:column;overflow:hidden;}.", k, "-transfer-title{line-height:", transfer.title.lineHeight, ";background:", transfer.title.bgColor, ";padding:", transfer.title.padding, ";.", k, "-checkbox{color:", transfer.title.color, ";font-size:", transfer.title.fontSize, ";}}.", k, "-transfer-count{float:right;margin-left:", transfer.title.countGap, ";}.", k, "-transfer-list{overflow:auto;position:relative;flex:1;}.", k, "-transfer-item{color:", transfer.item.color, ";background:", transfer.item.bgColor, ";user-select:none;width:100%;&:not(.", k, "-disabled):hover{background:", transfer.item.hoverBgColor, ";color:", transfer.item.hoverColor, ";p{color:", transfer.item.hoverColor, ";}}.", k, "-checkbox{padding:", transfer.item.padding, ";display:flex;}p{margin:0;color:", transfer.item.descColor, ";}&.", k, "-disabled{p{color:", theme.color.disabled, ";}}}.", k, "-input{width:auto;margin:", transfer.searchGap, ";}.", k, "-transfer-arrows{.", k, "-btn{display:flex;margin:", transfer.arrow.gap, ";}}.", k, "-transfer-pagination-wrapper{padding:", transfer.pagination.padding, ";display:flex;align-items:center;justify-content:center;}");
59
62
  });
@@ -41,7 +41,8 @@ export function useCheck(_ref) {
41
41
  } else if (e.shiftKey) {
42
42
  var _context2;
43
43
  e.preventDefault();
44
- var values = getShowedData(model);
44
+ var allData = getShowedData(model);
45
+ var values = instance.get('pagination') ? instance.paginationState.getPagedData(model, allData) : allData;
45
46
  var checkedKeys = _sliceInstanceProperty(_context2 = instance.get(model + "CheckedKeys")).call(_context2, 0);
46
47
  var lastEndIndex = endIndex;
47
48
  var keyName = instance.get('keyName');
@@ -0,0 +1,12 @@
1
+ import type { Model } from './useFilter';
2
+ import { Pagination, PaginationChangeData } from '../pagination';
3
+ export declare function usePagination(): {
4
+ getPagedData: (model: Model, allData: any[]) => any[];
5
+ leftValue: import("../../hooks/useState").State<number>;
6
+ leftLimit: import("../../hooks/useState").State<number>;
7
+ rightValue: import("../../hooks/useState").State<number>;
8
+ rightLimit: import("../../hooks/useState").State<number>;
9
+ onChange: (model: Model, data: PaginationChangeData) => void;
10
+ leftPaginationRef: import("intact").RefObject<Pagination>;
11
+ rightPaginationRef: import("intact").RefObject<Pagination>;
12
+ };
@@ -0,0 +1,79 @@
1
+ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
2
+ import { useInstance, createRef } from 'intact';
3
+ import { useState } from '../../hooks/useState';
4
+ import { Pagination } from '../pagination';
5
+ import { isObject } from 'intact-shared';
6
+ import { useReceive } from '../../hooks/useReceive';
7
+ var defaultPagination = Pagination.defaults();
8
+ export function usePagination() {
9
+ var instance = useInstance();
10
+ var leftValue = useState(defaultPagination.value);
11
+ var leftLimit = useState(defaultPagination.limit);
12
+ var rightValue = useState(defaultPagination.value);
13
+ var rightLimit = useState(defaultPagination.limit);
14
+ var leftPaginationRef = createRef();
15
+ var rightPaginationRef = createRef();
16
+ useReceive(['pagination'], function () {
17
+ var pagination = instance.get('pagination');
18
+ if (isObject(pagination)) {
19
+ if (pagination.value !== undefined) {
20
+ leftValue.set(pagination.value);
21
+ rightValue.set(pagination.value);
22
+ }
23
+ if (pagination.limit !== undefined) {
24
+ leftLimit.set(pagination.limit);
25
+ rightLimit.set(pagination.limit);
26
+ }
27
+ }
28
+ });
29
+ instance.watch('leftKeywords', function () {
30
+ leftValue.set(1);
31
+ ;
32
+ });
33
+ instance.watch('rightKeywords', function () {
34
+ rightValue.set(1);
35
+ });
36
+ // 计算分页数据
37
+ function getPagedData(model, allData) {
38
+ if (!instance.get('pagination')) {
39
+ return allData;
40
+ }
41
+ var value = model === 'left' ? leftValue.value : rightValue.value;
42
+ var limit = model === 'left' ? leftLimit.value : rightLimit.value;
43
+ var totalPages = Math.ceil(allData.length / limit) || 1;
44
+ // 如果当前页超出总页数,跳转到最后一页
45
+ var currentPage = value;
46
+ if (currentPage > totalPages && totalPages > 0) {
47
+ currentPage = totalPages;
48
+ if (model === 'left') {
49
+ leftValue.set(currentPage);
50
+ } else {
51
+ rightValue.set(currentPage);
52
+ }
53
+ }
54
+ // 切片数据
55
+ var index = (currentPage - 1) * limit;
56
+ return _sliceInstanceProperty(allData).call(allData, index, index + limit);
57
+ }
58
+ function onChange(model, data) {
59
+ if (model === 'left') {
60
+ leftValue.set(data.value);
61
+ leftLimit.set(data.limit);
62
+ } else {
63
+ rightValue.set(data.value);
64
+ rightLimit.set(data.limit);
65
+ }
66
+ // 触发分页事件
67
+ instance.trigger('page', model, data);
68
+ }
69
+ return {
70
+ getPagedData: getPagedData,
71
+ leftValue: leftValue,
72
+ leftLimit: leftLimit,
73
+ rightValue: rightValue,
74
+ rightLimit: rightLimit,
75
+ onChange: onChange,
76
+ leftPaginationRef: leftPaginationRef,
77
+ rightPaginationRef: rightPaginationRef
78
+ };
79
+ }
package/es/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.2-beta.1
2
+ * @king-design v3.7.0
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -11,6 +11,7 @@ export { _$, localize } from './i18n';
11
11
  export { bind } from './components/utils';
12
12
  export { setTheme, theme } from './styles/theme';
13
13
  export * from './components/affix';
14
+ export * from './components/anchor';
14
15
  export * from './components/badge';
15
16
  export * from './components/breadcrumb';
16
17
  export * from './components/button';
@@ -37,6 +38,7 @@ export * from './components/input';
37
38
  export * from './components/layout';
38
39
  export * from './components/menu';
39
40
  export * from './components/message';
41
+ export * from './components/notification';
40
42
  export * from './components/pagination';
41
43
  export * from './components/popover';
42
44
  export * from './components/progress';
@@ -66,4 +68,4 @@ export * from './components/upload';
66
68
  export * from './components/view';
67
69
  export * from './components/virtualList';
68
70
  export * from './components/wave';
69
- export declare const version = "3.6.2-beta.1";
71
+ export declare const version = "3.7.0";
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.2-beta.1
2
+ * @king-design v3.7.0
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -12,6 +12,7 @@ export { bind } from './components/utils';
12
12
  export { setTheme, theme } from './styles/theme';
13
13
  /* generate start */
14
14
  export * from './components/affix';
15
+ export * from './components/anchor';
15
16
  export * from './components/badge';
16
17
  export * from './components/breadcrumb';
17
18
  export * from './components/button';
@@ -38,6 +39,7 @@ export * from './components/input';
38
39
  export * from './components/layout';
39
40
  export * from './components/menu';
40
41
  export * from './components/message';
42
+ export * from './components/notification';
41
43
  export * from './components/pagination';
42
44
  export * from './components/popover';
43
45
  export * from './components/progress';
@@ -67,5 +69,5 @@ export * from './components/upload';
67
69
  export * from './components/view';
68
70
  export * from './components/virtualList';
69
71
  export * from './components/wave';
70
- export var version = '3.6.2-beta.1';
72
+ export var version = '3.7.0';
71
73
  /* generate end */
@@ -0,0 +1,11 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ interface Props {
4
+ activeAnchor?: string;
5
+ }
6
+ export default class extends Component<Props> {
7
+ static template: string | import("intact").Template<any>;
8
+ static defaults(): {
9
+ activeAnchor: string;
10
+ };
11
+ }
@@ -0,0 +1,18 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ export { default as data } from './index.json';
3
+ import { Component } from 'intact';
4
+ import template from './index.vdt';
5
+ var default_1 = /*#__PURE__*/function (_Component) {
6
+ _inheritsLoose(default_1, _Component);
7
+ function default_1() {
8
+ return _Component.apply(this, arguments) || this;
9
+ }
10
+ default_1.defaults = function defaults() {
11
+ return {
12
+ activeAnchor: ''
13
+ };
14
+ };
15
+ return default_1;
16
+ }(Component);
17
+ default_1.template = template;
18
+ export { default_1 as default };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ activeAnchor?: string;
4
+ }
5
+ export default class Demo extends React.Component<{}, Props> {
6
+ state: {
7
+ activeAnchor: string;
8
+ };
9
+ render(): React.JSX.Element;
10
+ }
11
+ export {};
@@ -0,0 +1,46 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import React from 'react';
4
+ import { Anchor, AnchorLink } from '@king-design/react';
5
+ var Demo = /*#__PURE__*/function (_React$Component) {
6
+ _inheritsLoose(Demo, _React$Component);
7
+ function Demo() {
8
+ var _context;
9
+ var _this;
10
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11
+ args[_key] = arguments[_key];
12
+ }
13
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
14
+ _this.state = {
15
+ activeAnchor: ''
16
+ };
17
+ return _this;
18
+ }
19
+ var _proto = Demo.prototype;
20
+ _proto.render = function render() {
21
+ var _this2 = this;
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: "anchor-demo"
24
+ }, /*#__PURE__*/React.createElement(Anchor, {
25
+ value: this.state.activeAnchor,
26
+ onChangeValue: function onChangeValue(activeAnchor) {
27
+ return _this2.setState({
28
+ activeAnchor: activeAnchor
29
+ });
30
+ },
31
+ offset: 76
32
+ }, /*#__PURE__*/React.createElement(AnchorLink, {
33
+ href: "components-anchor-demos-basic",
34
+ title: "\u57FA\u7840\u7528\u6CD5"
35
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
36
+ href: "components-anchor-demos-horizontal",
37
+ title: "\u6C34\u5E73\u6392\u5217"
38
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
39
+ href: "components-anchor-demos-container",
40
+ title: "\u81EA\u5B9A\u4E49\u6EDA\u52A8\u5BB9\u5668",
41
+ disabled: true
42
+ })));
43
+ };
44
+ return Demo;
45
+ }(React.Component);
46
+ export { Demo as default };
@@ -0,0 +1,12 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ import './index.styl';
4
+ interface Props {
5
+ activeAnchor?: string;
6
+ }
7
+ export default class extends Component<Props> {
8
+ static template: string | import("intact").Template<any>;
9
+ static defaults(): {
10
+ activeAnchor: string;
11
+ };
12
+ }
@@ -0,0 +1,19 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ export { default as data } from './index.json';
3
+ import { Component } from 'intact';
4
+ import template from './index.vdt';
5
+ import './index.styl';
6
+ var default_1 = /*#__PURE__*/function (_Component) {
7
+ _inheritsLoose(default_1, _Component);
8
+ function default_1() {
9
+ return _Component.apply(this, arguments) || this;
10
+ }
11
+ default_1.defaults = function defaults() {
12
+ return {
13
+ activeAnchor: 'config-info-card'
14
+ };
15
+ };
16
+ return default_1;
17
+ }(Component);
18
+ default_1.template = template;
19
+ export { default_1 as default };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ interface Props {
4
+ activeAnchor?: string;
5
+ }
6
+ export default class Demo extends React.Component<{}, Props> {
7
+ state: {
8
+ activeAnchor: string;
9
+ };
10
+ render(): React.JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,52 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import React from 'react';
4
+ import { Anchor, AnchorLink } from '@king-design/react';
5
+ import './index.styl';
6
+ var Demo = /*#__PURE__*/function (_React$Component) {
7
+ _inheritsLoose(Demo, _React$Component);
8
+ function Demo() {
9
+ var _context;
10
+ var _this;
11
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12
+ args[_key] = arguments[_key];
13
+ }
14
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
15
+ _this.state = {
16
+ activeAnchor: 'config-info-card'
17
+ };
18
+ return _this;
19
+ }
20
+ var _proto = Demo.prototype;
21
+ _proto.render = function render() {
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: "anchor-demo"
24
+ }, /*#__PURE__*/React.createElement(Anchor, {
25
+ value: this.state.activeAnchor,
26
+ container: "#scroll-container1"
27
+ }, /*#__PURE__*/React.createElement(AnchorLink, {
28
+ href: "basic-info-card",
29
+ title: "\u57FA\u7840\u4FE1\u606F"
30
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
31
+ href: "config-info-card",
32
+ title: "\u914D\u7F6E\u4FE1\u606F"
33
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
34
+ href: "other-info-card",
35
+ title: "\u5176\u4ED6\u4FE1\u606F"
36
+ })), /*#__PURE__*/React.createElement("div", {
37
+ id: "scroll-container1",
38
+ className: "scroll-container1"
39
+ }, /*#__PURE__*/React.createElement("div", {
40
+ id: "basic-info-card",
41
+ className: "section basic-info"
42
+ }, /*#__PURE__*/React.createElement("h2", null, "\u57FA\u7840\u4FE1\u606F"), /*#__PURE__*/React.createElement("p", null, "\u8FD9\u662F\u57FA\u7840\u4FE1\u606F")), /*#__PURE__*/React.createElement("div", {
43
+ id: "config-info-card",
44
+ className: "section config-info"
45
+ }, /*#__PURE__*/React.createElement("h2", null, "\u914D\u7F6E\u4FE1\u606F"), /*#__PURE__*/React.createElement("p", null, "\u8FD9\u662F\u914D\u7F6E\u4FE1\u606F")), /*#__PURE__*/React.createElement("div", {
46
+ id: "other-info-card",
47
+ className: "section other-info"
48
+ }, /*#__PURE__*/React.createElement("h2", null, "\u5176\u4ED6\u4FE1\u606F"), /*#__PURE__*/React.createElement("p", null, "\u8FD9\u662F\u5176\u4ED6\u4FE1\u606F"))));
49
+ };
50
+ return Demo;
51
+ }(React.Component);
52
+ export { Demo as default };
@@ -0,0 +1,17 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ import './index.styl';
4
+ import { AnchorLinkProps } from 'kpc';
5
+ interface Props {
6
+ activeAnchor?: string;
7
+ logs: string[];
8
+ }
9
+ export default class extends Component<Props> {
10
+ static template: string | import("intact").Template<any>;
11
+ static defaults(): {
12
+ activeAnchor: string;
13
+ logs: never[];
14
+ };
15
+ handleAnchorClick(e: MouseEvent, link: AnchorLinkProps): void;
16
+ handleAnchorChange(href: string): void;
17
+ }
@@ -0,0 +1,36 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import { __decorate } from "tslib";
4
+ export { default as data } from './index.json';
5
+ import { Component } from 'intact';
6
+ import template from './index.vdt';
7
+ import './index.styl';
8
+ import { bind } from 'kpc';
9
+ var default_1 = /*#__PURE__*/function (_Component) {
10
+ _inheritsLoose(default_1, _Component);
11
+ function default_1() {
12
+ return _Component.apply(this, arguments) || this;
13
+ }
14
+ default_1.defaults = function defaults() {
15
+ return {
16
+ activeAnchor: 'section_one',
17
+ logs: []
18
+ };
19
+ };
20
+ var _proto = default_1.prototype;
21
+ _proto.handleAnchorClick = function handleAnchorClick(e, link) {
22
+ var _context;
23
+ var logs = this.get('logs') || [];
24
+ this.set('logs', _concatInstanceProperty(_context = []).call(_context, logs, ["\u70B9\u51FB\u4E86\u951A\u70B9: title: " + link.title + " href: " + link.href]));
25
+ };
26
+ _proto.handleAnchorChange = function handleAnchorChange(href) {
27
+ var _context2;
28
+ var logs = this.get('logs') || [];
29
+ this.set('logs', _concatInstanceProperty(_context2 = []).call(_context2, logs, ["\u951A\u70B9\u6539\u53D8\u4E3A: " + href]));
30
+ };
31
+ return default_1;
32
+ }(Component);
33
+ default_1.template = template;
34
+ export { default_1 as default };
35
+ __decorate([bind], default_1.prototype, "handleAnchorClick", null);
36
+ __decorate([bind], default_1.prototype, "handleAnchorChange", null);
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ import { AnchorLinkProps } from '@king-design/react';
4
+ interface Props {
5
+ activeAnchor?: string;
6
+ logs: string[];
7
+ }
8
+ export default class Demo extends React.Component<{}, Props> {
9
+ state: {
10
+ activeAnchor: string;
11
+ logs: never[];
12
+ };
13
+ handleAnchorClick(e: MouseEvent, link: AnchorLinkProps): void;
14
+ handleAnchorChange(href: string): void;
15
+ render(): React.JSX.Element;
16
+ }
17
+ export {};
@@ -0,0 +1,88 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
4
+ import { __decorate } from "tslib";
5
+ import React from 'react';
6
+ import { Anchor, AnchorLink } from '@king-design/react';
7
+ import './index.styl';
8
+ import { bind } from '@king-design/react';
9
+ var Demo = /*#__PURE__*/function (_React$Component) {
10
+ _inheritsLoose(Demo, _React$Component);
11
+ function Demo() {
12
+ var _context;
13
+ var _this;
14
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
+ args[_key] = arguments[_key];
16
+ }
17
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
18
+ _this.state = {
19
+ activeAnchor: 'section_one',
20
+ logs: []
21
+ };
22
+ return _this;
23
+ }
24
+ var _proto = Demo.prototype;
25
+ _proto.handleAnchorClick = function handleAnchorClick(e, link) {
26
+ var _context2;
27
+ var logs = this.state.logs || [];
28
+ this.setState({
29
+ logs: _concatInstanceProperty(_context2 = []).call(_context2, logs, ["\u70B9\u51FB\u4E86\u951A\u70B9: title: " + link.title + " href: " + link.href])
30
+ });
31
+ };
32
+ _proto.handleAnchorChange = function handleAnchorChange(href) {
33
+ var _context3;
34
+ var logs = this.state.logs || [];
35
+ this.setState({
36
+ logs: _concatInstanceProperty(_context3 = []).call(_context3, logs, ["\u951A\u70B9\u6539\u53D8\u4E3A: " + href])
37
+ });
38
+ };
39
+ _proto.render = function render() {
40
+ var _this2 = this,
41
+ _context4;
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: "anchor-demo"
44
+ }, /*#__PURE__*/React.createElement(Anchor, {
45
+ value: this.state.activeAnchor,
46
+ onChangeValue: function onChangeValue(activeAnchor) {
47
+ return _this2.setState({
48
+ activeAnchor: activeAnchor
49
+ });
50
+ },
51
+ vertical: false,
52
+ container: "#scroll-container2",
53
+ onClick: this.handleAnchorClick,
54
+ onChange: this.handleAnchorChange
55
+ }, /*#__PURE__*/React.createElement(AnchorLink, {
56
+ href: "section_one",
57
+ title: "section1"
58
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
59
+ href: "section_two",
60
+ title: "section2"
61
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
62
+ href: "section_three",
63
+ title: "section3"
64
+ })), /*#__PURE__*/React.createElement("div", {
65
+ id: "scroll-container2",
66
+ className: "scroll-container2"
67
+ }, /*#__PURE__*/React.createElement("div", {
68
+ id: "section_one",
69
+ className: "section section1"
70
+ }, /*#__PURE__*/React.createElement("h2", null, "Section1")), /*#__PURE__*/React.createElement("div", {
71
+ id: "section_two",
72
+ className: "section section2"
73
+ }, /*#__PURE__*/React.createElement("h2", null, "Section2")), /*#__PURE__*/React.createElement("div", {
74
+ id: "section_three",
75
+ className: "section section3"
76
+ }, /*#__PURE__*/React.createElement("h2", null, "Section3"))), this.state.logs.length ? /*#__PURE__*/React.createElement("div", {
77
+ className: "logs-container"
78
+ }, _mapInstanceProperty(_context4 = this.state.logs).call(_context4, function (log, index) {
79
+ return /*#__PURE__*/React.createElement("div", {
80
+ key: index
81
+ }, log);
82
+ })) : undefined);
83
+ };
84
+ return Demo;
85
+ }(React.Component);
86
+ export { Demo as default };
87
+ __decorate([bind], Demo.prototype, "handleAnchorClick", null);
88
+ __decorate([bind], Demo.prototype, "handleAnchorChange", null);
@@ -0,0 +1,11 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ interface Props {
4
+ activeAnchor?: string;
5
+ }
6
+ export default class extends Component<Props> {
7
+ static template: string | import("intact").Template<any>;
8
+ static defaults(): {
9
+ activeAnchor: string;
10
+ };
11
+ }
@@ -0,0 +1,18 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ export { default as data } from './index.json';
3
+ import { Component } from 'intact';
4
+ import template from './index.vdt';
5
+ var default_1 = /*#__PURE__*/function (_Component) {
6
+ _inheritsLoose(default_1, _Component);
7
+ function default_1() {
8
+ return _Component.apply(this, arguments) || this;
9
+ }
10
+ default_1.defaults = function defaults() {
11
+ return {
12
+ activeAnchor: ''
13
+ };
14
+ };
15
+ return default_1;
16
+ }(Component);
17
+ default_1.template = template;
18
+ export { default_1 as default };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ activeAnchor?: string;
4
+ }
5
+ export default class Demo extends React.Component<{}, Props> {
6
+ state: {
7
+ activeAnchor: string;
8
+ };
9
+ render(): React.JSX.Element;
10
+ }
11
+ export {};
@@ -0,0 +1,46 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import React from 'react';
4
+ import { Anchor, AnchorLink } from '@king-design/react';
5
+ var Demo = /*#__PURE__*/function (_React$Component) {
6
+ _inheritsLoose(Demo, _React$Component);
7
+ function Demo() {
8
+ var _context;
9
+ var _this;
10
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11
+ args[_key] = arguments[_key];
12
+ }
13
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
14
+ _this.state = {
15
+ activeAnchor: ''
16
+ };
17
+ return _this;
18
+ }
19
+ var _proto = Demo.prototype;
20
+ _proto.render = function render() {
21
+ var _this2 = this;
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: "anchor-demo"
24
+ }, /*#__PURE__*/React.createElement(Anchor, {
25
+ value: this.state.activeAnchor,
26
+ onChangeValue: function onChangeValue(activeAnchor) {
27
+ return _this2.setState({
28
+ activeAnchor: activeAnchor
29
+ });
30
+ },
31
+ offset: 76,
32
+ vertical: false
33
+ }, /*#__PURE__*/React.createElement(AnchorLink, {
34
+ href: "components-anchor-demos-basic",
35
+ title: "\u57FA\u7840\u7528\u6CD5"
36
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
37
+ href: "components-anchor-demos-horizontal",
38
+ title: "\u6C34\u5E73\u6392\u5217"
39
+ }), /*#__PURE__*/React.createElement(AnchorLink, {
40
+ href: "components-anchor-demos-container",
41
+ title: "\u81EA\u5B9A\u4E49\u6EDA\u52A8\u5BB9\u5668"
42
+ })));
43
+ };
44
+ return Demo;
45
+ }(React.Component);
46
+ export { Demo as default };
@@ -0,0 +1,12 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ import './index.styl';
4
+ interface Props {
5
+ activeAnchor?: string;
6
+ }
7
+ export default class extends Component<Props> {
8
+ static template: string | import("intact").Template<any>;
9
+ static defaults(): {
10
+ activeAnchor: string;
11
+ };
12
+ }