@king-design/intact 3.1.1 → 3.1.2

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 (239) hide show
  1. package/components/affix/styles.ts +4 -2
  2. package/components/badge/index.vdt +1 -1
  3. package/components/badge/styles.ts +4 -3
  4. package/components/breadcrumb/index.vdt +1 -1
  5. package/components/breadcrumb/styles.ts +4 -2
  6. package/components/button/styles.ts +7 -5
  7. package/components/card/styles.ts +4 -2
  8. package/components/carousel/styles.ts +7 -4
  9. package/components/cascader/index.vdt +2 -1
  10. package/components/cascader/styles.ts +7 -4
  11. package/components/checkbox/index.vdt +1 -1
  12. package/components/checkbox/styles.ts +4 -2
  13. package/components/code/styles.ts +3 -2
  14. package/components/collapse/index.spec.ts +1 -1
  15. package/components/collapse/styles.ts +7 -4
  16. package/components/colorpicker/styles.ts +7 -4
  17. package/components/copy/styles.ts +3 -2
  18. package/components/datepicker/styles.ts +10 -6
  19. package/components/diagram/styles.ts +3 -2
  20. package/components/dialog/styles.ts +10 -6
  21. package/components/drawer/styles.ts +4 -2
  22. package/components/dropdown/styles.ts +7 -4
  23. package/components/editable/styles.ts +4 -2
  24. package/components/form/styles.ts +7 -4
  25. package/components/grid/styles.ts +12 -9
  26. package/components/icon/index.vdt +1 -1
  27. package/components/icon/styles.ts +4 -2
  28. package/components/input/styles.ts +8 -5
  29. package/components/layout/styles.ts +13 -9
  30. package/components/menu/demos/recursive.md +340 -0
  31. package/components/menu/styles.ts +21 -16
  32. package/components/message/styles.ts +7 -5
  33. package/components/pagination/styles.ts +4 -2
  34. package/components/popover/content.vdt +1 -1
  35. package/components/popover/styles.ts +4 -2
  36. package/components/progress/styles.ts +4 -4
  37. package/components/radio/styles.ts +4 -2
  38. package/components/rate/styles.ts +4 -2
  39. package/components/scrollSelect/styles.ts +4 -2
  40. package/components/select/base.ts +3 -2
  41. package/components/select/base.vdt +1 -1
  42. package/components/select/styles.ts +10 -6
  43. package/components/skeleton/styles.ts +7 -4
  44. package/components/slider/styles.ts +4 -2
  45. package/components/spin/styles.ts +4 -4
  46. package/components/spinner/styles.ts +4 -3
  47. package/components/split/styles.ts +4 -2
  48. package/components/steps/index.vdt +2 -2
  49. package/components/steps/styles.ts +7 -5
  50. package/components/switch/styles.ts +4 -2
  51. package/components/table/column.ts +2 -0
  52. package/components/table/column.vdt +7 -3
  53. package/components/table/demos/basic.md +2 -2
  54. package/components/table/demos/fixColumn.md +3 -1
  55. package/components/table/demos/groupHeader.md +11 -11
  56. package/components/table/demos/scheme.md +1 -1
  57. package/components/table/index.spec.ts +8 -3
  58. package/components/table/styles.ts +11 -8
  59. package/components/table/table.vdt +3 -4
  60. package/components/table/useColumns.ts +1 -0
  61. package/components/table/useFixedColumns.ts +27 -49
  62. package/components/table/useGroup.ts +5 -0
  63. package/components/table/useResizable.ts +38 -10
  64. package/components/table/useWidth.ts +3 -0
  65. package/components/tabs/styles.ts +4 -2
  66. package/components/tag/styles.ts +7 -4
  67. package/components/timeline/styles.ts +7 -5
  68. package/components/timepicker/styles.ts +4 -2
  69. package/components/tip/styles.ts +4 -2
  70. package/components/tooltip/content.vdt +1 -1
  71. package/components/tooltip/styles.ts +4 -2
  72. package/components/transfer/styles.ts +4 -2
  73. package/components/tree/demos/checkbox.md +1 -0
  74. package/components/tree/demos/contextmenu.md +10 -1
  75. package/components/tree/index.spec.ts +7 -0
  76. package/components/tree/styles.ts +4 -2
  77. package/components/tree/useChecked.ts +3 -0
  78. package/components/treeSelect/styles.ts +4 -2
  79. package/components/upload/styles.ts +7 -4
  80. package/components/utils.ts +10 -4
  81. package/components/wave/styles.ts +4 -2
  82. package/es/components/affix/styles.d.ts +4 -1
  83. package/es/components/affix/styles.js +4 -2
  84. package/es/components/badge/index.vdt.js +1 -1
  85. package/es/components/badge/styles.d.ts +4 -1
  86. package/es/components/badge/styles.js +4 -2
  87. package/es/components/breadcrumb/index.vdt.js +1 -1
  88. package/es/components/breadcrumb/styles.d.ts +4 -1
  89. package/es/components/breadcrumb/styles.js +4 -2
  90. package/es/components/button/styles.d.ts +8 -2
  91. package/es/components/button/styles.js +7 -4
  92. package/es/components/card/styles.d.ts +4 -1
  93. package/es/components/card/styles.js +4 -2
  94. package/es/components/carousel/styles.d.ts +8 -2
  95. package/es/components/carousel/styles.js +7 -4
  96. package/es/components/cascader/index.vdt.js +3 -1
  97. package/es/components/cascader/styles.d.ts +8 -2
  98. package/es/components/cascader/styles.js +7 -4
  99. package/es/components/checkbox/index.vdt.js +1 -1
  100. package/es/components/checkbox/styles.d.ts +4 -1
  101. package/es/components/checkbox/styles.js +4 -2
  102. package/es/components/code/styles.d.ts +4 -1
  103. package/es/components/code/styles.js +3 -2
  104. package/es/components/collapse/index.spec.js +1 -1
  105. package/es/components/collapse/styles.d.ts +8 -2
  106. package/es/components/collapse/styles.js +7 -4
  107. package/es/components/colorpicker/styles.d.ts +8 -2
  108. package/es/components/colorpicker/styles.js +7 -4
  109. package/es/components/copy/styles.d.ts +4 -1
  110. package/es/components/copy/styles.js +3 -2
  111. package/es/components/datepicker/styles.d.ts +12 -3
  112. package/es/components/datepicker/styles.js +10 -6
  113. package/es/components/diagram/styles.d.ts +4 -1
  114. package/es/components/diagram/styles.js +3 -2
  115. package/es/components/dialog/styles.d.ts +12 -3
  116. package/es/components/dialog/styles.js +10 -6
  117. package/es/components/drawer/styles.d.ts +4 -1
  118. package/es/components/drawer/styles.js +4 -2
  119. package/es/components/dropdown/styles.d.ts +8 -2
  120. package/es/components/dropdown/styles.js +7 -4
  121. package/es/components/editable/styles.d.ts +4 -1
  122. package/es/components/editable/styles.js +4 -2
  123. package/es/components/form/styles.d.ts +8 -2
  124. package/es/components/form/styles.js +7 -4
  125. package/es/components/grid/styles.d.ts +8 -2
  126. package/es/components/grid/styles.js +12 -13
  127. package/es/components/icon/index.vdt.js +1 -1
  128. package/es/components/icon/styles.d.ts +4 -1
  129. package/es/components/icon/styles.js +4 -2
  130. package/es/components/input/styles.d.ts +8 -2
  131. package/es/components/input/styles.js +7 -4
  132. package/es/components/layout/styles.d.ts +16 -4
  133. package/es/components/layout/styles.js +13 -8
  134. package/es/components/menu/styles.d.ts +16 -4
  135. package/es/components/menu/styles.js +14 -9
  136. package/es/components/message/styles.d.ts +8 -2
  137. package/es/components/message/styles.js +7 -4
  138. package/es/components/pagination/styles.d.ts +4 -1
  139. package/es/components/pagination/styles.js +4 -2
  140. package/es/components/popover/content.vdt.js +1 -1
  141. package/es/components/popover/styles.d.ts +4 -1
  142. package/es/components/popover/styles.js +4 -2
  143. package/es/components/progress/styles.d.ts +4 -1
  144. package/es/components/progress/styles.js +4 -2
  145. package/es/components/radio/styles.d.ts +4 -1
  146. package/es/components/radio/styles.js +4 -2
  147. package/es/components/rate/styles.d.ts +4 -1
  148. package/es/components/rate/styles.js +4 -2
  149. package/es/components/scrollSelect/styles.d.ts +4 -1
  150. package/es/components/scrollSelect/styles.js +4 -2
  151. package/es/components/select/base.js +3 -1
  152. package/es/components/select/base.vdt.js +1 -1
  153. package/es/components/select/styles.d.ts +12 -3
  154. package/es/components/select/styles.js +10 -6
  155. package/es/components/skeleton/styles.d.ts +8 -2
  156. package/es/components/skeleton/styles.js +7 -4
  157. package/es/components/slider/styles.d.ts +4 -1
  158. package/es/components/slider/styles.js +4 -2
  159. package/es/components/spin/styles.d.ts +4 -1
  160. package/es/components/spin/styles.js +4 -2
  161. package/es/components/spinner/styles.d.ts +4 -1
  162. package/es/components/spinner/styles.js +4 -2
  163. package/es/components/split/styles.d.ts +4 -1
  164. package/es/components/split/styles.js +4 -2
  165. package/es/components/steps/index.vdt.js +2 -2
  166. package/es/components/steps/styles.d.ts +4 -3
  167. package/es/components/steps/styles.js +9 -4
  168. package/es/components/switch/styles.d.ts +4 -1
  169. package/es/components/switch/styles.js +4 -2
  170. package/es/components/table/column.d.ts +1 -0
  171. package/es/components/table/column.js +2 -1
  172. package/es/components/table/column.vdt.js +9 -3
  173. package/es/components/table/index.spec.js +18 -11
  174. package/es/components/table/styles.d.ts +8 -2
  175. package/es/components/table/styles.js +8 -5
  176. package/es/components/table/table.vdt.js +3 -4
  177. package/es/components/table/useColumns.js +1 -0
  178. package/es/components/table/useFixedColumns.d.ts +3 -3
  179. package/es/components/table/useFixedColumns.js +27 -46
  180. package/es/components/table/useGroup.d.ts +1 -0
  181. package/es/components/table/useGroup.js +11 -1
  182. package/es/components/table/useResizable.js +41 -5
  183. package/es/components/table/useWidth.js +3 -0
  184. package/es/components/tabs/styles.d.ts +4 -1
  185. package/es/components/tabs/styles.js +4 -2
  186. package/es/components/tag/styles.d.ts +8 -2
  187. package/es/components/tag/styles.js +7 -4
  188. package/es/components/timeline/styles.d.ts +8 -2
  189. package/es/components/timeline/styles.js +7 -5
  190. package/es/components/timepicker/styles.d.ts +4 -1
  191. package/es/components/timepicker/styles.js +4 -2
  192. package/es/components/tip/styles.d.ts +4 -1
  193. package/es/components/tip/styles.js +4 -2
  194. package/es/components/tooltip/content.vdt.js +1 -1
  195. package/es/components/tooltip/styles.d.ts +4 -1
  196. package/es/components/tooltip/styles.js +4 -2
  197. package/es/components/transfer/styles.d.ts +4 -1
  198. package/es/components/transfer/styles.js +4 -2
  199. package/es/components/tree/index.spec.js +13 -1
  200. package/es/components/tree/styles.d.ts +4 -1
  201. package/es/components/tree/styles.js +4 -2
  202. package/es/components/tree/useChecked.js +4 -0
  203. package/es/components/treeSelect/styles.d.ts +4 -1
  204. package/es/components/treeSelect/styles.js +4 -2
  205. package/es/components/upload/styles.d.ts +8 -2
  206. package/es/components/upload/styles.js +7 -4
  207. package/es/components/utils.d.ts +10 -2
  208. package/es/components/utils.js +9 -2
  209. package/es/components/wave/styles.d.ts +4 -1
  210. package/es/components/wave/styles.js +4 -2
  211. package/es/i18n/en-US.d.ts +1 -0
  212. package/es/i18n/en-US.js +1 -0
  213. package/es/index.d.ts +2 -2
  214. package/es/index.js +2 -2
  215. package/es/site/data/components/menu/demos/recursive/index.d.ts +29 -0
  216. package/es/site/data/components/menu/demos/recursive/index.js +57 -0
  217. package/es/site/data/components/menu/demos/recursive/react.d.ts +2 -0
  218. package/es/site/data/components/menu/demos/recursive/react.js +69 -0
  219. package/es/site/data/components/table/demos/basic/react.js +4 -2
  220. package/es/site/data/components/table/demos/fixColumn/react.js +2 -1
  221. package/es/site/data/components/table/demos/groupHeader/react.js +11 -20
  222. package/es/site/data/components/table/demos/scheme/react.js +2 -1
  223. package/es/site/data/components/tree/demos/checkbox/index.d.ts +12 -2
  224. package/es/site/data/components/tree/demos/checkbox/index.js +1 -0
  225. package/es/site/data/components/tree/demos/checkbox/react.d.ts +12 -2
  226. package/es/site/data/components/tree/demos/checkbox/react.js +1 -0
  227. package/es/site/data/components/tree/demos/contextmenu/index.d.ts +1 -0
  228. package/es/site/data/components/tree/demos/contextmenu/index.js +1 -0
  229. package/es/site/data/components/tree/demos/contextmenu/react.d.ts +1 -0
  230. package/es/site/data/components/tree/demos/contextmenu/react.js +1 -0
  231. package/es/site/src/components/article/index.js +6 -2
  232. package/es/styles/fonts/iconfont.d.ts +4 -1
  233. package/es/styles/fonts/iconfont.js +1 -1
  234. package/es/styles/global.js +1 -1
  235. package/i18n/en-US.ts +1 -0
  236. package/index.ts +2 -2
  237. package/package.json +3 -3
  238. package/styles/fonts/iconfont.ts +2 -2
  239. package/styles/global.ts +22 -0
@@ -3,6 +3,7 @@ import { css } from '@emotion/css';
3
3
  import { theme, setDefault } from '../../styles/theme';
4
4
  import { deepDefaults, sizes, palette } from '../../styles/utils';
5
5
  import '../../styles/global';
6
+ import { cache } from '../utils';
6
7
  var defaults = {
7
8
  get transition() {
8
9
  return theme.transition.middle;
@@ -71,8 +72,9 @@ setDefault(function () {
71
72
  kswitch = deepDefaults(theme, {
72
73
  switch: defaults
73
74
  }).switch;
75
+ makeStyles == null ? void 0 : makeStyles.clearCache();
74
76
  });
75
- export function makeStyles(k) {
77
+ export var makeStyles = cache(function makeStyles(k) {
76
78
  return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;transition:background ", kswitch.transition, ";input{opacity:0;position:absolute;}.", k, "-switch-bar,.", k, "-switch-off{box-sizing:border-box;}.", k, "-switch-bar{position:absolute;text-align:right;overflow:hidden;}.", k, "-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.", k, "-switch-bar,.", k, "-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}&:hover{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.hoverBgColor, ";}}.", k, "-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.", k, "-switch-on,.", k, "-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.", k, "-dragging{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
77
79
  var _kswitch$size = kswitch[size],
78
80
  width = _kswitch$size.width,
@@ -80,4 +82,4 @@ export function makeStyles(k) {
80
82
  padding = _kswitch$size.padding;
81
83
  return /*#__PURE__*/css("&.", k, "-", size, ",&.", k, "-", size, " .", k, "-switch-on,&.", k, "-", size, " .", k, "-switch-off{width:", width, ";height:", height, ";}&.", k, "-", size, "{border-radius:", height, ";.", k, "-switch-bar{width:", height, ";border-radius:", height, ";}.", k, "-switch-wrapper{padding:", padding, ";}.", k, "-switch-on,.", k, "-switch-off{line-height:", height, ";left:0;}.", k, "-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.", k, "-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
82
84
  }), "&.", k, "-checked{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";}.", k, "-switch-bar{width:100%;}&:hover{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.hoverBgColor, ";}}}&.", k, "-disabled{&,.", k, "-switch-handle{cursor:not-allowed;}&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.", k, "-checked{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
83
- }
85
+ });
@@ -15,6 +15,7 @@ export interface TableColumnProps {
15
15
  cols?: number;
16
16
  rows?: number;
17
17
  prevVNode?: VNodeComponentClass<TableColumn> | null;
18
+ nextVNode?: VNodeComponentClass<TableColumn> | null;
18
19
  }
19
20
  export interface TableColumnEvents {
20
21
  }
@@ -23,7 +23,8 @@ var typeDefs = {
23
23
  // offset: null,
24
24
  cols: null,
25
25
  rows: null,
26
- prevVNode: null
26
+ prevVNode: null,
27
+ nextVNode: null
27
28
  };
28
29
  export var TableColumn = /*#__PURE__*/function (_Component) {
29
30
  _inheritsLoose(TableColumn, _Component);
@@ -45,7 +45,8 @@ export default function ($props, $blocks, $__proto__) {
45
45
  confirm = _this$group.confirm,
46
46
  dropdownRef = _this$group.dropdownRef,
47
47
  localGroupValue = _this$group.localGroupValue,
48
- isEmptyValue = _this$group.isEmptyValue;
48
+ isEmptyValue = _this$group.isEmptyValue,
49
+ checkAll = _this$group.checkAll;
49
50
  var k = this.config.k;
50
51
  return _$cc(TableContext.Consumer, {
51
52
  'children': function children(checkType) {
@@ -150,20 +151,25 @@ export default function ($props, $blocks, $__proto__) {
150
151
  }) : _$ce(2, 'span', $value.label, 0)
151
152
  });
152
153
  }, $this), 4, _$cn(k + "-table-group-body")), multiple ? _$ce(2, 'div', [_$cc(Button, {
154
+ 'size': 'mini',
155
+ 'type': 'link',
156
+ 'ev-click': checkAll,
157
+ 'children': _$('全选')
158
+ }), _$cc(Button, {
153
159
  'size': 'small',
154
160
  'disabled': isEmptyValue(localGroupValue.value),
155
161
  'type': 'secondary',
156
162
  'ev-click': function evClick() {
157
163
  return reset(onChange);
158
164
  },
159
- 'children': '重置'
165
+ 'children': _$('重置')
160
166
  }), _$cc(Button, {
161
167
  'type': 'primary',
162
168
  'size': 'small',
163
169
  'ev-click': function evClick() {
164
170
  return confirm(onChange);
165
171
  },
166
- 'children': '确定'
172
+ 'children': _$('确定')
167
173
  })], 4, _$cn(k + "-table-group-footer")) : undefined]
168
174
  })]
169
175
  }, 'dropdown', dropdownRef) : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, {
@@ -366,7 +366,7 @@ describe('Table', function () {
366
366
  }, _callee6);
367
367
  })));
368
368
  it('group', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
369
- var _mount7, instance, element, _instance$refs4, __test1, __test2, _element$querySelecto8, table1, table2, icon, dropdown, item, icon2, dropdown2, _dropdown2$querySelec, item1, item2, _dropdown2$querySelec2, reset, confirm, newDropdown;
369
+ var _mount7, instance, element, _instance$refs4, __test1, __test2, _element$querySelecto8, table1, table2, icon, dropdown, item, icon2, dropdown2, _dropdown2$querySelec, item1, item2, _dropdown2$querySelec2, checkAll, reset, confirm, newDropdown;
370
370
 
371
371
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
372
372
  while (1) {
@@ -420,7 +420,7 @@ describe('Table', function () {
420
420
  status: []
421
421
  }); // click confirm
422
422
 
423
- _dropdown2$querySelec2 = dropdown2.querySelectorAll('.k-table-group-footer .k-btn'), reset = _dropdown2$querySelec2[0], confirm = _dropdown2$querySelec2[1];
423
+ _dropdown2$querySelec2 = dropdown2.querySelectorAll('.k-table-group-footer .k-btn'), checkAll = _dropdown2$querySelec2[0], reset = _dropdown2$querySelec2[1], confirm = _dropdown2$querySelec2[2];
424
424
  confirm.click();
425
425
  _context7.next = 35;
426
426
  return wait();
@@ -443,28 +443,35 @@ describe('Table', function () {
443
443
 
444
444
  case 44:
445
445
  expect(dropdown2.innerHTML).to.matchSnapshot();
446
- confirm.click();
447
- _context7.next = 48;
448
- return wait();
449
-
450
- case 48:
451
446
  expect(instance.get('multipleGroup')).to.eql({
452
447
  status: []
453
- }); // update group
448
+ }); // click checkAll
449
+
450
+ dispatchEvent(icon2, 'click');
451
+ _context7.next = 49;
452
+ return wait();
453
+
454
+ case 49:
455
+ checkAll.click();
456
+ _context7.next = 52;
457
+ return wait();
458
+
459
+ case 52:
460
+ expect(dropdown2.querySelectorAll('.k-checkbox.k-checked')).to.length(2); // update group
454
461
 
455
462
  instance.set('statusGroup', [{
456
463
  label: 'label',
457
464
  value: 'value'
458
465
  }]);
459
466
  dispatchEvent(icon, 'click');
460
- _context7.next = 53;
467
+ _context7.next = 57;
461
468
  return wait(500);
462
469
 
463
- case 53:
470
+ case 57:
464
471
  newDropdown = getElement('.k-table-group-dropdown');
465
472
  expect(newDropdown.innerHTML).to.matchSnapshot();
466
473
 
467
- case 55:
474
+ case 59:
468
475
  case "end":
469
476
  return _context7.stop();
470
477
  }
@@ -1,3 +1,9 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(k: string): string;
3
- export declare function makeGroupMenuStyles(k: string): string;
2
+ export declare const makeStyles: {
3
+ (k: string): string;
4
+ clearCache(): {};
5
+ };
6
+ export declare const makeGroupMenuStyles: {
7
+ (k: string): string;
8
+ clearCache(): {};
9
+ };
@@ -4,6 +4,7 @@ import { css } from '@emotion/css';
4
4
  import { theme, setDefault } from '../../styles/theme';
5
5
  import { deepDefaults, palette } from '../../styles/utils';
6
6
  import '../../styles/global';
7
+ import { cache } from '../utils';
7
8
  var defaults = {
8
9
  get transition() {
9
10
  return theme.transition.large;
@@ -101,12 +102,14 @@ setDefault(function () {
101
102
  table = deepDefaults(theme, {
102
103
  table: defaults
103
104
  }).table;
105
+ makeStyles == null ? void 0 : makeStyles.clearCache();
106
+ makeGroupMenuStyles == null ? void 0 : makeGroupMenuStyles.clearCache();
104
107
  });
105
- export function makeStyles(k) {
106
- return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;td,th{transition:all ", table.transition, ";}}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
108
+ export var makeStyles = cache(function makeStyles(k) {
109
+ return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
107
110
  return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
108
111
  }), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
109
- }
110
- export function makeGroupMenuStyles(k) {
112
+ });
113
+ export var makeGroupMenuStyles = cache(function makeGroupMenuStyles(k) {
111
114
  return /*#__PURE__*/css("min-width:", table.group.menuMinWidth, "!important;.", k, "-dropdown-item.", k, "-active{color:", table.group.activeColor, ";}.", k, "-table-group-header{padding:", table.group.headerPadding, ";border-bottom:", table.group.headerBorder, ";}.", k, "-table-group-body{max-height:", table.group.menuMaxHeight, ";overflow:auto;}.", k, "-table-group-footer{text-align:right;border-top:", table.group.headerBorder, ";padding:8px;.", k, "-btn{margin-left:8px;}}");
112
- }
115
+ });
@@ -70,7 +70,7 @@ export default function ($props, $blocks, $__proto__) {
70
70
  scrollPosition = _this$fixedColumns.scrollPosition,
71
71
  hasFixed = _this$fixedColumns.hasFixed,
72
72
  getHasFixedLeft = _this$fixedColumns.getHasFixedLeft,
73
- getOffsetMap = _this$fixedColumns.getOffsetMap;
73
+ offsetMap = _this$fixedColumns.offsetMap;
74
74
  var scrollRef = this.scroll.scrollRef;
75
75
  var _this$stickyHeader = this.stickyHeader,
76
76
  stickHeader = _this$stickyHeader.stickHeader,
@@ -107,7 +107,6 @@ export default function ($props, $blocks, $__proto__) {
107
107
  getAllStatus = _this$checked.getAllStatus,
108
108
  onChangeChecked = _this$checked.onChangeChecked;
109
109
  var allCheckedStatus = getAllCheckedStatus();
110
- var offsetMap = getOffsetMap();
111
110
  var thead = hideHeader ? null : _$cc(TableContext.Provider, {
112
111
  'value': checkType,
113
112
  'children': _$cc(GroupContext.Provider, {
@@ -126,7 +125,7 @@ export default function ($props, $blocks, $__proto__) {
126
125
  onStart: onStart
127
126
  },
128
127
  'children': _$cc(FixedColumnsContext.Provider, {
129
- 'value': offsetMap,
128
+ 'value': offsetMap.value,
130
129
  'children': _$ce(2, 'thead', _$ma(columns, function ($value, $key) {
131
130
  return _$ce(2, 'tr', function () {
132
131
  var ths = [$key === 0 && checkType !== 'none' ? _$cv('th', _extends({}, getClassAndStyleForFixed({
@@ -214,7 +213,7 @@ export default function ($props, $blocks, $__proto__) {
214
213
  'indent': indentSize,
215
214
  'onToggleSpreadRow': toggleSpreadRow,
216
215
  'onBeforeUnmount': _this.resetRowStatus.onRowBeforeUnmount,
217
- 'offsetMap': offsetMap,
216
+ 'offsetMap': offsetMap.value,
218
217
  'animation': animation[1],
219
218
  'draggable': draggable,
220
219
  'draggingKey': draggingKey.value,
@@ -41,6 +41,7 @@ export function useColumns() {
41
41
 
42
42
  ret = true;
43
43
  var clonedVNode = directClone(vNode);
44
+ if (currentVNode) currentVNode.props.nextVNode = clonedVNode;
44
45
 
45
46
  var props = _extends({}, clonedVNode.props, {
46
47
  cols: 0,
@@ -1,4 +1,4 @@
1
- import { VNodeComponentClass, Props, RefObject, Key } from 'intact';
1
+ import { VNodeComponentClass, Props, Key } from 'intact';
2
2
  import { TableColumn, TableColumnProps } from './column';
3
3
  import type { TableProps, TableRowKey } from './table';
4
4
  import { State } from '../../hooks/useState';
@@ -7,14 +7,14 @@ declare type ScrollPosition = 'left' | 'middle' | 'right';
7
7
  export declare const context: {
8
8
  Provider: import("intact").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
9
9
  Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
10
- useContext: () => RefObject<any>;
10
+ useContext: () => import("intact").RefObject<any>;
11
11
  };
12
12
  export declare function useFixedColumns(getColumns: () => VNodeComponentClass<TableColumn>[][], { scrollRef, callbacks }: ReturnType<typeof useScroll>, widthMap: State<Record<TableRowKey, number>>): {
13
13
  scrollPosition: State<ScrollPosition | null>;
14
14
  setScrollPosition: (scrollLeft: number) => void;
15
15
  hasFixed: State<boolean>;
16
+ offsetMap: State<Record<Key, number>>;
16
17
  getHasFixedLeft: () => boolean;
17
- getOffsetMap: () => Record<Key, number>;
18
18
  };
19
19
  export declare function getClassAndStyleForFixed({ className, fixed, align }: Props<TableColumnProps>, offset: number, k: string, checkType?: TableProps['checkType']): {
20
20
  className: string;
@@ -1,10 +1,10 @@
1
- import { useInstance, onMounted, onUnmounted } from 'intact';
1
+ import { useInstance, findDomFromVNode, nextTick } from 'intact';
2
2
  import { useState } from '../../hooks/useState';
3
3
  import { cx } from '@emotion/css';
4
- import { isNullOrUndefined, isString, error } from 'intact-shared';
5
- import { throttle } from '../utils';
6
4
  import { watchState } from '../../hooks/useState';
7
5
  import { createContext } from '../context';
6
+ import { useResizeObserver } from '../../hooks/useResizeObserver';
7
+ import { isEqualObject } from '../utils';
8
8
  export var context = createContext();
9
9
  export function useFixedColumns(getColumns, _ref, widthMap) {
10
10
  var scrollRef = _ref.scrollRef,
@@ -12,38 +12,32 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
12
12
  var instance = useInstance();
13
13
  var scrollPosition = useState(null);
14
14
  var hasFixed = useState(false);
15
+ var offsetMap = useState({}, isEqualObject);
15
16
  var hasFixedLeft = false;
16
17
  var hasFixedRight = false;
17
- var offsetMap = {};
18
18
  callbacks.push(setScrollPosition);
19
- instance.on('$receive:children', handleFixedColumns);
19
+ instance.watch('children', handleFixedColumnsAndUpdate, {
20
+ presented: true
21
+ });
20
22
  watchState(widthMap, function () {
21
- handleFixedColumns();
22
- updateScrollPositionOnResize();
23
+ return nextTick(handleFixedColumnsAndUpdate);
23
24
  });
24
- var throttleUpdate = throttle(function () {
25
- if (instance.$unmounted) return;
26
- updateScrollPositionOnResize();
27
- }, 100);
28
- onMounted(function () {
25
+ useResizeObserver(scrollRef, handleFixedColumnsAndUpdate, true);
26
+
27
+ function handleFixedColumnsAndUpdate() {
28
+ handleFixedColumns();
29
29
  updateScrollPositionOnResize();
30
- window.addEventListener('resize', throttleUpdate);
31
- });
32
- onUnmounted(function () {
33
- window.removeEventListener('resize', throttleUpdate);
34
- });
30
+ }
35
31
 
36
32
  function handleFixedColumns() {
37
33
  var columns = getColumns();
34
+ var _offsetMap = {};
38
35
  hasFixedLeft = false;
39
36
  hasFixedRight = false;
40
- offsetMap = {};
41
37
  columns.forEach(function (columns, row) {
42
- var offset = 0;
43
38
  columns.forEach(function (vNode, col) {
44
39
  var props = vNode.props;
45
40
  var key = props.key;
46
- offsetMap[key] = 0;
47
41
  var fixed = props.fixed;
48
42
 
49
43
  if (fixed === 'left') {
@@ -54,41 +48,34 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
54
48
  var _props = prevVNode.props;
55
49
 
56
50
  if (_props.fixed === 'left') {
57
- if (process.env.NODE_ENV !== 'production') {
58
- validateWidth(_props);
59
- }
60
-
61
- value += widthMap.value[_props.key] || parseInt(_props.width, 10) || 0;
51
+ value += getWidth(prevVNode);
62
52
  }
63
53
 
64
54
  prevVNode = _props.prevVNode;
65
55
  }
66
56
 
67
- offsetMap[key] = value;
57
+ _offsetMap[key] = value;
68
58
  hasFixedLeft = true;
69
59
  } else if (fixed === 'right') {
70
60
  var _value = 0;
71
- var lastVNode = columns[columns.length - 1];
61
+ var nextVNode = props.nextVNode;
72
62
 
73
- while (vNode !== lastVNode) {
74
- var _props2 = lastVNode.props;
63
+ while (nextVNode) {
64
+ var _props2 = nextVNode.props;
75
65
 
76
66
  if (_props2.fixed === 'right') {
77
- if (process.env.NODE_ENV !== 'production') {
78
- validateWidth(_props2);
79
- }
80
-
81
- _value += widthMap.value[_props2.key] || parseInt(_props2.width, 10) || 0;
67
+ _value += getWidth(nextVNode);
82
68
  }
83
69
 
84
- lastVNode = _props2.prevVNode;
70
+ nextVNode = _props2.nextVNode;
85
71
  }
86
72
 
87
- offsetMap[key] = _value;
73
+ _offsetMap[key] = _value;
88
74
  hasFixedRight = true;
89
75
  }
90
76
  });
91
77
  });
78
+ offsetMap.set(_offsetMap);
92
79
  hasFixed.set(hasFixedLeft || hasFixedRight);
93
80
  }
94
81
 
@@ -113,11 +100,9 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
113
100
  scrollPosition: scrollPosition,
114
101
  setScrollPosition: setScrollPosition,
115
102
  hasFixed: hasFixed,
103
+ offsetMap: offsetMap,
116
104
  getHasFixedLeft: function getHasFixedLeft() {
117
105
  return hasFixedLeft;
118
- },
119
- getOffsetMap: function getOffsetMap() {
120
- return offsetMap;
121
106
  }
122
107
  };
123
108
  }
@@ -134,11 +119,7 @@ export function getClassAndStyleForFixed(_ref2, offset, k, checkType) {
134
119
  };
135
120
  }
136
121
 
137
- function validateWidth(_ref4) {
138
- var width = _ref4.width,
139
- key = _ref4.key;
140
-
141
- if (isNullOrUndefined(width) || isString(width) && !/\d+(px)?/.test(width)) {
142
- error("The width must be specified with 'px' when the column has fixed. <TableColumn key=\"" + key + "\" />");
143
- }
122
+ function getWidth(vNode) {
123
+ var dom = findDomFromVNode(vNode, true);
124
+ return dom.offsetWidth;
144
125
  }
@@ -20,5 +20,6 @@ export declare function useGroup(): {
20
20
  dropdownRef: import("intact").RefObject<Dropdown>;
21
21
  localGroupValue: import("../../hooks/useState").State<any>;
22
22
  isEmptyValue: (groupValue: any) => boolean | undefined;
23
+ checkAll: () => void;
23
24
  };
24
25
  export {};
@@ -1,4 +1,5 @@
1
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
2
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
2
3
  import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
3
4
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
4
5
  import { useInstance, createRef } from 'intact';
@@ -62,6 +63,14 @@ export function useGroup() {
62
63
  confirm(onChange);
63
64
  }
64
65
 
66
+ function checkAll() {
67
+ var _filteredGroup$value;
68
+
69
+ localGroupValue.set((_filteredGroup$value = filteredGroup.value) == null ? void 0 : _mapInstanceProperty(_filteredGroup$value).call(_filteredGroup$value, function (item) {
70
+ return item.value;
71
+ }));
72
+ }
73
+
65
74
  function isEmptyValue(groupValue) {
66
75
  var _instance$get4 = instance.get(),
67
76
  multiple = _instance$get4.multiple;
@@ -98,6 +107,7 @@ export function useGroup() {
98
107
  confirm: confirm,
99
108
  dropdownRef: dropdownRef,
100
109
  localGroupValue: localGroupValue,
101
- isEmptyValue: isEmptyValue
110
+ isEmptyValue: isEmptyValue,
111
+ checkAll: checkAll
102
112
  };
103
113
  }
@@ -9,15 +9,17 @@ export function useResizable(scrollRef, tableRef, tableWidth, widthMap, storeWid
9
9
  var x;
10
10
  var prevVNode;
11
11
  var prevTh;
12
+ var prevMinWidth;
12
13
  var currentVNode;
13
14
  var currentTh;
14
- var minWidth;
15
+ var currentMinWidth;
16
+ var nextVNode;
15
17
 
16
18
  function onStart(e) {
17
19
  containerWidth = scrollRef.value.clientWidth;
18
20
  x = e.clientX; // find the previous column but exclude the hidden columns, #467
19
21
 
20
- prevVNode = currentVNode = e._vNode;
22
+ prevVNode = nextVNode = currentVNode = e._vNode;
21
23
  prevTh;
22
24
 
23
25
  do {
@@ -26,7 +28,20 @@ export function useResizable(scrollRef, tableRef, tableWidth, widthMap, storeWid
26
28
  } while (window.getComputedStyle(prevTh).display === 'none');
27
29
 
28
30
  currentTh = findDomFromVNode(currentVNode, true);
29
- minWidth = prevVNode.props.minWidth || instance.get('minColWidth');
31
+ prevMinWidth = prevVNode.props.minWidth || instance.get('minColWidth');
32
+ currentMinWidth = currentVNode.props.minWidth || instance.get('minColWidth');
33
+
34
+ while (nextVNode = (_nextVNode = nextVNode) == null ? void 0 : _nextVNode.props.nextVNode) {
35
+ var _nextVNode;
36
+
37
+ var th = findDomFromVNode(nextVNode, true);
38
+
39
+ if (window.getComputedStyle(th).display === 'none') {
40
+ continue;
41
+ }
42
+
43
+ break;
44
+ }
30
45
  }
31
46
 
32
47
  function onMove(e) {
@@ -35,14 +50,35 @@ export function useResizable(scrollRef, tableRef, tableWidth, widthMap, storeWid
35
50
  var delX = e.clientX - x;
36
51
  if (delX === 0) return;
37
52
  var newPrevWidth = prevTh.offsetWidth + delX;
38
- if (newPrevWidth < minWidth && delX < 0) return;
39
53
  var newCurrentWidth = currentTh.offsetWidth - delX;
40
54
  var newTableWidth = tableRef.value.offsetWidth + delX;
55
+ var isCurrentFixedRight = currentVNode.props.fixed === 'right'; // const isPrevFixedRight = prevVNode.props!.fixed === 'right';
56
+
57
+ if ((newPrevWidth < prevMinWidth || isCurrentFixedRight) && delX < 0) {
58
+ // if (nextVNode) return;
59
+ // the last column, we should expand its width
60
+ if (newPrevWidth < prevMinWidth) {
61
+ newPrevWidth -= delX;
62
+ newTableWidth -= delX;
63
+ }
64
+ }
65
+
41
66
  var currentKey = currentVNode.props.key;
42
67
  var prevKey = prevVNode.props.key;
43
- x = e.clientX;
44
68
  var map = (_map = {}, _map[prevKey] = newPrevWidth, _map);
45
69
 
70
+ if (!nextVNode || isCurrentFixedRight) {
71
+ newTableWidth -= delX;
72
+
73
+ if (newCurrentWidth < currentMinWidth && delX > 0) {
74
+ newCurrentWidth = currentMinWidth;
75
+ }
76
+
77
+ map[currentKey] = newCurrentWidth;
78
+ }
79
+
80
+ x = e.clientX;
81
+
46
82
  if (containerWidth > newTableWidth) {
47
83
  map[currentKey] = newCurrentWidth;
48
84
  } else {
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
1
2
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
2
3
  import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
3
4
  import { useInstance, onMounted, createRef } from 'intact';
@@ -100,6 +101,8 @@ export function useWidth(scrollRef, getColumns) {
100
101
  });
101
102
 
102
103
  if (shouldUpdate) {
104
+ // let useFixedColumns to update scroll position
105
+ widthMap.set(_extends({}, widthMap.value));
103
106
  instance.forceUpdate(function () {
104
107
  // check again because it may affect other columns
105
108
  if (!isStop) {
@@ -1,2 +1,5 @@
1
1
  import '../../styles/global';
2
- export declare function makeStyles(k: string): string;
2
+ export declare const makeStyles: {
3
+ (k: string): string;
4
+ clearCache(): {};
5
+ };
@@ -3,6 +3,7 @@ import { css } from '@emotion/css';
3
3
  import { theme, setDefault } from '../../styles/theme';
4
4
  import { deepDefaults, sizes } from '../../styles/utils';
5
5
  import '../../styles/global';
6
+ import { cache } from '../utils';
6
7
  var closeFontSizeMap = {
7
8
  large: '24px',
8
9
  default: '20px',
@@ -107,10 +108,11 @@ setDefault(function () {
107
108
  tabs = deepDefaults(theme, {
108
109
  tabs: defaults
109
110
  }).tabs;
111
+ makeStyles == null ? void 0 : makeStyles.clearCache();
110
112
  });
111
- export function makeStyles(k) {
113
+ export var makeStyles = cache(function makeStyles(k) {
112
114
  return /*#__PURE__*/css(makeCommonStyles(k), ";", makeScrollStyles(k), ";&.", k, "-type-default{", makeDefaultStyles(k), ";}&.", k, "-type-card{", makeCardStyles(k), ";}&.", k, "-type-flat-card{", makeFlatCardStyles(k), ";}");
113
- }
115
+ });
114
116
 
115
117
  function makeCommonStyles(k) {
116
118
  var active = tabs.active;
@@ -65,5 +65,11 @@ declare const defaults: {
65
65
  };
66
66
  declare let tag: typeof defaults;
67
67
  export { tag };
68
- export declare function makeStyles(k: string): string;
69
- export declare function makeTagsStyles(k: string): string;
68
+ export declare const makeStyles: {
69
+ (k: string): string;
70
+ clearCache(): {};
71
+ };
72
+ export declare const makeTagsStyles: {
73
+ (k: string): string;
74
+ clearCache(): {};
75
+ };
@@ -3,6 +3,7 @@ import { css } from '@emotion/css';
3
3
  import { deepDefaults, sizes, palette } from '../../styles/utils';
4
4
  import { theme, setDefault } from '../../styles/theme';
5
5
  import '../../styles/global';
6
+ import { cache } from '../utils';
6
7
  var types = ['primary', 'warning', 'danger', 'success', 'disabled'];
7
8
  var defaults = deepDefaults({
8
9
  get border() {
@@ -112,9 +113,11 @@ setDefault(function () {
112
113
  tag = deepDefaults(theme, {
113
114
  tag: defaults
114
115
  }).tag;
116
+ makeStyles == null ? void 0 : makeStyles.clearCache();
117
+ makeTagsStyles == null ? void 0 : makeTagsStyles.clearCache();
115
118
  });
116
119
  export { tag };
117
- export function makeStyles(k) {
120
+ export var makeStyles = cache(function makeStyles(k) {
118
121
  return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:", tag.border, ";border-radius:", tag.borderRadius, ";font-size:", tag.fontSize, ";height:", tag.height, ";.", k, "-tag-close{font-size:", tag.close.fontSize, ";margin-left:", tag.close.gap, ";width:", tag.close.width, ";}&.", k, "-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
119
122
  var styles = tag[t];
120
123
  return /*#__PURE__*/css("&.", k, "-", t, "{color:", styles.color, ";border-color:", styles.color, ";background:", styles.bgColor, ";}");
@@ -123,7 +126,7 @@ export function makeStyles(k) {
123
126
  var styles = tag[s];
124
127
  return /*#__PURE__*/css("&.", k, "-", s, "{padding:", styles.padding, ";height:", styles.height, ";font-size:", styles.fontSize, ";.", k, "-tag-close{font-size:", styles.close.fontSize, ";margin-left:", styles.close.gap, ";}}");
125
128
  }), "&.", k, "-dashed{border-style:dashed;}&.", k, "-dragging{opacity:0;}");
126
- }
127
- export function makeTagsStyles(k) {
129
+ });
130
+ export var makeTagsStyles = cache(function makeTagsStyles(k) {
128
131
  return /*#__PURE__*/css("display:flex;flex-wrap:wrap;gap:", defaults.tags.gap, ";position:relative;overflow:hidden;&.", k, "-nowrap{flex-wrap:nowrap;.", k, "-tag{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;}}.", k, "-tags-more{cursor:default;font-family:monospace;}.", k, "-tag.", k, "-draggable{cursor:move;}");
129
- }
132
+ });
@@ -2,6 +2,12 @@ import '../../styles/global';
2
2
  declare type ValueOf<T extends readonly any[]> = T[number];
3
3
  export declare type Types = ValueOf<typeof types>;
4
4
  export declare const types: readonly ["primary", "warning", "danger", "success"];
5
- export declare function makeStyles(k: string): string;
6
- export declare function makeItemStyles(k: string): string;
5
+ export declare const makeStyles: {
6
+ (k: string): string;
7
+ clearCache(): {};
8
+ };
9
+ export declare const makeItemStyles: {
10
+ (k: string): string;
11
+ clearCache(): {};
12
+ };
7
13
  export {};