@king-design/intact 2.0.15 → 3.0.0-beta.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 (177) hide show
  1. package/components/button/styles.ts +4 -1
  2. package/components/card/styles.ts +3 -2
  3. package/components/checkbox/styles.ts +31 -6
  4. package/components/collapse/styles.ts +4 -1
  5. package/components/datepicker/styles.ts +3 -1
  6. package/components/dialog/base.vdt +4 -5
  7. package/components/dialog/styles.ts +18 -13
  8. package/components/drawer/styles.ts +20 -10
  9. package/components/dropdown/styles.ts +1 -1
  10. package/components/form/styles.ts +1 -1
  11. package/components/icon/demos/disabled.md +21 -0
  12. package/components/icon/demos/icons.md +87 -116
  13. package/components/icon/index.md +1 -0
  14. package/components/icon/index.ts +2 -0
  15. package/components/icon/index.vdt +6 -2
  16. package/components/icon/styles.ts +8 -1
  17. package/components/input/styles.ts +14 -20
  18. package/components/message/demos/basic.md +1 -1
  19. package/components/message/demos/duration.md +3 -3
  20. package/components/message/index.md +1 -1
  21. package/components/message/message.ts +2 -2
  22. package/components/message/message.vdt +6 -6
  23. package/components/message/styles.ts +10 -19
  24. package/components/pagination/index.vdt +9 -9
  25. package/components/pagination/styles.ts +11 -7
  26. package/components/radio/styles.ts +28 -9
  27. package/components/select/base.vdt +4 -5
  28. package/components/select/demos/basic.md +1 -1
  29. package/components/select/index.md +1 -1
  30. package/components/select/styles.ts +4 -27
  31. package/components/spinner/index.vdt +6 -4
  32. package/components/spinner/styles.ts +36 -36
  33. package/components/steps/demos/basic.md +2 -1
  34. package/components/steps/demos/clickable.md +6 -0
  35. package/components/steps/demos/error.md +25 -5
  36. package/components/steps/demos/line.md +7 -6
  37. package/components/steps/demos/simple.md +0 -6
  38. package/components/steps/index.md +1 -1
  39. package/components/steps/index.ts +4 -4
  40. package/components/steps/index.vdt +1 -0
  41. package/components/steps/step.vdt +16 -13
  42. package/components/steps/styles.ts +297 -259
  43. package/components/switch/demos/basic.md +1 -2
  44. package/components/switch/demos/disabled.md +20 -0
  45. package/components/switch/demos/onOff.md +5 -0
  46. package/components/switch/styles.ts +29 -37
  47. package/components/table/column.vdt +26 -10
  48. package/components/table/demos/rowExpandable.md +1 -1
  49. package/components/table/demos/selectedKeys.md +1 -1
  50. package/components/table/index.md +3 -3
  51. package/components/table/index.spec.ts +2 -2
  52. package/components/table/styles.ts +17 -6
  53. package/components/table/useGroup.ts +18 -2
  54. package/components/table/useSortable.ts +4 -1
  55. package/components/tabs/demos/basic.md +0 -1
  56. package/components/tabs/index.ts +2 -2
  57. package/components/tabs/index.vdt +3 -3
  58. package/components/tabs/styles.ts +202 -152
  59. package/components/tag/base.ts +1 -1
  60. package/components/tag/demos/border.md +2 -2
  61. package/components/tag/index.md +1 -1
  62. package/components/tag/styles.ts +12 -11
  63. package/components/tip/index.vdt +1 -3
  64. package/components/tip/styles.ts +8 -2
  65. package/components/tooltip/content.vdt +1 -1
  66. package/components/tooltip/styles.ts +8 -6
  67. package/components/transfer/index.vdt +3 -2
  68. package/components/transfer/styles.ts +1 -0
  69. package/components/transfer/useCheck.ts +9 -2
  70. package/components/upload/demos/manually.md +12 -13
  71. package/components/upload/index.vdt +40 -34
  72. package/components/upload/styles.ts +60 -64
  73. package/es/components/button/styles.js +2 -2
  74. package/es/components/card/styles.js +10 -2
  75. package/es/components/checkbox/styles.js +21 -10
  76. package/es/components/collapse/styles.js +6 -1
  77. package/es/components/datepicker/styles.d.ts +1 -1
  78. package/es/components/datepicker/styles.js +4 -1
  79. package/es/components/dialog/base.vdt.js +5 -6
  80. package/es/components/dialog/styles.js +16 -14
  81. package/es/components/drawer/styles.js +20 -5
  82. package/es/components/dropdown/styles.js +1 -1
  83. package/es/components/form/styles.js +1 -1
  84. package/es/components/icon/index.d.ts +1 -0
  85. package/es/components/icon/index.js +2 -1
  86. package/es/components/icon/index.vdt.js +4 -2
  87. package/es/components/icon/styles.js +10 -2
  88. package/es/components/input/styles.js +1 -11
  89. package/es/components/message/message.js +1 -1
  90. package/es/components/message/message.vdt.js +7 -6
  91. package/es/components/message/styles.js +8 -8
  92. package/es/components/pagination/index.vdt.js +8 -8
  93. package/es/components/pagination/styles.js +11 -2
  94. package/es/components/radio/styles.js +16 -6
  95. package/es/components/select/base.vdt.js +5 -6
  96. package/es/components/select/styles.js +4 -24
  97. package/es/components/spinner/index.vdt.js +6 -4
  98. package/es/components/spinner/styles.js +33 -5
  99. package/es/components/steps/index.d.ts +2 -2
  100. package/es/components/steps/index.js +2 -2
  101. package/es/components/steps/index.vdt.js +1 -0
  102. package/es/components/steps/step.vdt.js +17 -8
  103. package/es/components/steps/styles.d.ts +1 -1
  104. package/es/components/steps/styles.js +80 -75
  105. package/es/components/switch/styles.js +20 -34
  106. package/es/components/table/column.vdt.js +43 -7
  107. package/es/components/table/index.spec.js +2 -2
  108. package/es/components/table/styles.js +16 -5
  109. package/es/components/table/useGroup.d.ts +3 -0
  110. package/es/components/table/useGroup.js +24 -1
  111. package/es/components/table/useSortable.d.ts +3 -1
  112. package/es/components/table/useSortable.js +4 -1
  113. package/es/components/tabs/index.d.ts +1 -1
  114. package/es/components/tabs/index.js +1 -1
  115. package/es/components/tabs/index.vdt.js +1 -1
  116. package/es/components/tabs/styles.js +68 -22
  117. package/es/components/tag/base.js +1 -1
  118. package/es/components/tag/styles.js +15 -10
  119. package/es/components/tip/index.vdt.js +1 -3
  120. package/es/components/tip/styles.js +4 -3
  121. package/es/components/tooltip/content.vdt.js +4 -4
  122. package/es/components/tooltip/styles.js +12 -7
  123. package/es/components/transfer/index.vdt.js +3 -1
  124. package/es/components/transfer/styles.js +1 -1
  125. package/es/components/transfer/useCheck.d.ts +1 -0
  126. package/es/components/transfer/useCheck.js +8 -1
  127. package/es/components/upload/index.vdt.js +21 -20
  128. package/es/components/upload/styles.js +22 -30
  129. package/es/i18n/en-US.d.ts +2 -1
  130. package/es/i18n/en-US.js +2 -1
  131. package/es/index.d.ts +2 -2
  132. package/es/index.js +2 -2
  133. package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
  134. package/es/site/data/components/icon/demos/disabled/index.js +18 -0
  135. package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
  136. package/es/site/data/components/icon/demos/disabled/react.js +33 -0
  137. package/es/site/data/components/icon/demos/icons/index.js +1 -1
  138. package/es/site/data/components/icon/demos/icons/react.js +1 -1
  139. package/es/site/data/components/menu/demos/collapse/react.d.ts +11 -0
  140. package/es/site/data/components/menu/demos/size/react.d.ts +7 -0
  141. package/es/site/data/components/message/demos/duration/index.js +2 -2
  142. package/es/site/data/components/message/demos/duration/react.js +2 -2
  143. package/es/site/data/components/select/demos/basic/react.js +1 -2
  144. package/es/site/data/components/steps/demos/basic/react.js +1 -1
  145. package/es/site/data/components/steps/demos/clickable/react.js +15 -0
  146. package/es/site/data/components/steps/demos/error/react.js +22 -2
  147. package/es/site/data/components/steps/demos/line/react.js +15 -11
  148. package/es/site/data/components/steps/demos/simple/react.js +1 -11
  149. package/es/site/data/components/switch/demos/basic/react.js +0 -2
  150. package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
  151. package/es/site/data/components/switch/demos/disabled/index.js +18 -0
  152. package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
  153. package/es/site/data/components/switch/demos/disabled/react.js +27 -0
  154. package/es/site/data/components/switch/demos/onOff/react.js +13 -0
  155. package/es/site/data/components/tag/demos/border/index.js +1 -1
  156. package/es/site/data/components/tag/demos/border/react.js +1 -1
  157. package/es/site/data/components/upload/demos/manually/react.js +5 -7
  158. package/es/site/src/pages/document/index.js +3 -2
  159. package/es/site/src/pages/document/styles.js +1 -1
  160. package/es/styles/fonts/iconfont.eot +0 -0
  161. package/es/styles/fonts/iconfont.js +1 -1
  162. package/es/styles/fonts/iconfont.svg +189 -369
  163. package/es/styles/fonts/iconfont.ttf +0 -0
  164. package/es/styles/fonts/iconfont.woff +0 -0
  165. package/es/styles/theme.d.ts +10 -2
  166. package/es/styles/theme.js +23 -21
  167. package/i18n/en-US.ts +2 -1
  168. package/index.ts +2 -2
  169. package/package.json +4 -3
  170. package/styles/fonts/iconfont.css +172 -289
  171. package/styles/fonts/iconfont.eot +0 -0
  172. package/styles/fonts/iconfont.svg +189 -369
  173. package/styles/fonts/iconfont.ts +255 -369
  174. package/styles/fonts/iconfont.ttf +0 -0
  175. package/styles/fonts/iconfont.woff +0 -0
  176. package/styles/fonts/iconfont.woff2 +0 -0
  177. package/styles/theme.ts +23 -19
@@ -10,7 +10,12 @@ var defaults = {
10
10
  },
11
11
 
12
12
  // transition: '15000s',
13
- border: "1px solid #e5e5e5",
13
+ border: "1px solid #e2e5e8",
14
+
15
+ get borderRadius() {
16
+ return theme.borderRadius;
17
+ },
18
+
14
19
  fontSize: "12px",
15
20
  bgColor: "#fff",
16
21
 
@@ -30,7 +35,7 @@ var defaults = {
30
35
  fontSize: "12px",
31
36
  fontWeight: "bold",
32
37
  textAlign: 'left',
33
- height: "30px",
38
+ height: "40px",
34
39
  delimiterHeight: '12px',
35
40
  delimiterColor: '#bfbfbf'
36
41
  },
@@ -53,6 +58,12 @@ var defaults = {
53
58
 
54
59
  get activeColor() {
55
60
  return theme.color.primary;
61
+ },
62
+
63
+ headerPadding: "8px",
64
+
65
+ get headerBorder() {
66
+ return "1px solid " + theme.color.bg;
56
67
  }
57
68
 
58
69
  },
@@ -60,7 +71,7 @@ var defaults = {
60
71
  sort: {
61
72
  iconHeight: "7px",
62
73
  gap: "10px",
63
- color: "#a6a6a6",
74
+ color: "#d0d5d9",
64
75
  disabledColor: "#ddd"
65
76
  },
66
77
  expandBgColor: '#fdfcff',
@@ -84,10 +95,10 @@ setDefault(function () {
84
95
  }).table;
85
96
  });
86
97
  export function makeStyles() {
87
- return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";border-top:", table.border, ";position:relative;z-index:0;.k-table-wrapper{border-bottom:", table.border, ";overflow:auto;}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, ";}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";border-bottom:", table.border, ";&: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%;}.k-table-title-text{flex:1;}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-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{width:", table.group.width, "!important;height:", table.group.width, "!important;margin-left:", table.group.gap, ";position:relative;color:", table.group.color, ";&:hover{color:", theme.color.primary, ";}.k-icon{transition:transform ", table.transition, ";}&.k-dropdown-open .k-icon{transform:rotate(180deg);}}.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-left:", _sortInstanceProperty(table).gap, ";color:", _sortInstanceProperty(table).color, ";}&.k-asc .k-icon.k-desc,&.k-desc .k-icon.k-asc{color:", _sortInstanceProperty(table).disabledColor, ";}}.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{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) {
98
+ 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:", theme.color.lightBlack, ";}.k-table-title-text{flex:1;}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{width:", table.group.width, "!important;height:", table.group.width, "!important;margin-left:", table.group.gap, ";position:relative;color:", table.group.color, ";&:hover{color:", theme.color.primary, ";}.k-icon{transition:transform ", table.transition, ";}&.k-dropdown-open .k-icon{transform:rotate(180deg);}}.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-left:", _sortInstanceProperty(table).gap, ";color:", _sortInstanceProperty(table).color, ";}&.k-asc .k-icon.k-desc,&.k-desc .k-icon.k-asc{color:", _sortInstanceProperty(table).disabledColor, ";}}.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{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) {
88
99
  return /*#__PURE__*/css(".k-align-", type, "{text-align:", type, ";}");
89
100
  }), ";");
90
101
  }
91
102
  export function makeGroupMenuStyles() {
92
- return /*#__PURE__*/css("max-height:", table.group.menuMaxHeight, ";overflow:auto;.k-dropdown-item.k-active{color:", table.group.activeColor, ";}");
103
+ return /*#__PURE__*/css("max-height:", table.group.menuMaxHeight, ";overflow:auto;.k-dropdown-item.k-active{color:", table.group.activeColor, ";}.k-table-group-header{padding:", table.group.headerPadding, ";border-bottom:", table.group.headerBorder, ";}");
93
104
  }
@@ -1,3 +1,4 @@
1
+ import type { TableColumnGroupItem } from './column';
1
2
  declare type ContextValue = {
2
3
  groupValue: any;
3
4
  onChange: (key: string, groupValue: any) => void;
@@ -10,5 +11,7 @@ export declare function useGroup(): {
10
11
  onSelect: (value: any, groupValue: any, onChange: ContextValue['onChange']) => void;
11
12
  isChecked: (value: any, groupValue: any) => any;
12
13
  getGroupText: (groupValue: any) => string | null;
14
+ keywords: import("../../hooks/useState").State<string>;
15
+ filteredGroup: import("../../hooks/useState").State<TableColumnGroupItem[] | undefined>;
13
16
  };
14
17
  export {};
@@ -1,13 +1,17 @@
1
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
2
2
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
3
3
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
4
+ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
4
5
  import { useInstance } from 'intact';
5
6
  import { isNullOrUndefined } from 'intact-shared';
6
7
  import { toggleArray } from '../utils';
7
8
  import { createContext } from '../context';
9
+ import { useState, watchState } from '../../hooks/useState';
8
10
  export var context = createContext();
9
11
  export function useGroup() {
10
12
  var instance = useInstance();
13
+ var keywords = useState('');
14
+ var filteredGroup = useState(instance.get('group'));
11
15
 
12
16
  function onSelect(value, groupValue, onChange) {
13
17
  var _instance$get = instance.get(),
@@ -60,9 +64,28 @@ export function useGroup() {
60
64
  return null;
61
65
  }
62
66
 
67
+ watchState(keywords, function (v) {
68
+ var _instance$get4 = instance.get(),
69
+ _instance$get4$group = _instance$get4.group,
70
+ group = _instance$get4$group === void 0 ? [] : _instance$get4$group;
71
+
72
+ v = _trimInstanceProperty(v).call(v);
73
+
74
+ if (!v) {
75
+ filteredGroup.set(group);
76
+ } else {
77
+ filteredGroup.set(_filterInstanceProperty(group).call(group, function (item) {
78
+ var _context2, _context3;
79
+
80
+ return _includesInstanceProperty(_context2 = String(item.label)).call(_context2, v) || _includesInstanceProperty(_context3 = String(item.value)).call(_context3, v);
81
+ }));
82
+ }
83
+ });
63
84
  return {
64
85
  onSelect: onSelect,
65
86
  isChecked: isChecked,
66
- getGroupText: getGroupText
87
+ getGroupText: getGroupText,
88
+ keywords: keywords,
89
+ filteredGroup: filteredGroup
67
90
  };
68
91
  }
@@ -3,5 +3,7 @@ export declare const context: {
3
3
  Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
4
4
  };
5
5
  export declare function useSortable(): {
6
- onChange: (key: string) => void;
6
+ onChange: (key: string, event: Event & {
7
+ _ignoreSortable?: boolean;
8
+ }) => void;
7
9
  };
@@ -8,7 +8,10 @@ export function useSortable() {
8
8
 
9
9
  var count = 0;
10
10
 
11
- function onChange(key) {
11
+ function onChange(key, event) {
12
+ // ignore when click group dropdown menu
13
+ if (event._ignoreSortable) return;
14
+
12
15
  var sort = _extends({}, instance.get('sort'));
13
16
 
14
17
  if (sort.key === key) {
@@ -7,7 +7,7 @@ export interface TabsProps<T = any> {
7
7
  value?: T;
8
8
  vertical?: boolean;
9
9
  size?: Sizes;
10
- type?: 'default' | 'card' | 'border-card' | 'no-border-card';
10
+ type?: 'default' | 'card' | 'border-card' | 'no-border-card' | 'flat-card';
11
11
  closable?: boolean;
12
12
  beforeChange?: (value: T) => boolean | Promise<boolean>;
13
13
  }
@@ -13,7 +13,7 @@ var typeDefs = {
13
13
  value: null,
14
14
  vertical: Boolean,
15
15
  size: sizes,
16
- type: ['default', 'card', 'border-card', 'no-border-card'],
16
+ type: ['default', 'card', 'border-card', 'no-border-card', 'flat-card'],
17
17
  closable: Boolean,
18
18
  beforeChange: Function
19
19
  };
@@ -28,7 +28,7 @@ export default function ($props, $blocks, $__proto__) {
28
28
  wrapperRef = _this$scroll.wrapperRef;
29
29
  var classNameObj = (_classNameObj = {
30
30
  'k-tabs': true
31
- }, _classNameObj["k-" + size] = size, _classNameObj['k-vertical'] = vertical, _classNameObj['k-tabs-card'] = type === 'no-border-card', _classNameObj["k-tabs-" + type] = type !== 'default', _classNameObj["k-is-scroll"] = isScroll.value, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
31
+ }, _classNameObj["k-size-" + size] = size, _classNameObj['k-vertical'] = vertical, _classNameObj["k-type-" + type] = true, _classNameObj["k-is-scroll"] = isScroll.value, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
32
32
  return _$cv('div', _extends({
33
33
  'className': _$cn(classNameObj)
34
34
  }, getRestProps(this)), [isScroll.value ? _$cc(Button, {
@@ -1,4 +1,7 @@
1
1
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
2
+
3
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
4
+
2
5
  import { css } from '@emotion/css';
3
6
  import { theme, setDefault } from '../../styles/theme';
4
7
  import { deepDefaults, sizes } from '../../styles/utils';
@@ -24,32 +27,28 @@ var defaults = deepDefaults({
24
27
  return tabs.borderWidth + " solid " + tabs.borderColor;
25
28
  },
26
29
 
27
- margin: "0 10px",
28
-
29
30
  get color() {
30
31
  return theme.color.text;
31
32
  },
32
33
 
33
- closeGutter: "8px",
34
- // vertical
35
- verticalPadding: "0 25px",
36
-
34
+ closeGap: "8px",
35
+ // scroll
36
+ navigatorWidth: "20px",
37
37
  //active
38
- get activeColor() {
39
- return theme.color.primary;
40
- },
38
+ active: {
39
+ get color() {
40
+ return theme.color.primary;
41
+ },
41
42
 
42
- highlight: {
43
- height: "2px",
43
+ bar: {
44
+ height: '2px',
44
45
 
45
- // get bottom() { return `calc(-${tabs.highlight.height} / 2)` },
46
- get bgColor() {
47
- return theme.color.primary;
48
- }
46
+ get bgColor() {
47
+ return theme.color.primary;
48
+ }
49
49
 
50
+ }
50
51
  },
51
- // scroll
52
- navigatorWidth: "20px",
53
52
  // border-card
54
53
  borderCard: {
55
54
  get bgColor() {
@@ -61,9 +60,17 @@ var defaults = deepDefaults({
61
60
  noBorderCard: {
62
61
  get bgColor() {
63
62
  return theme.color.bg;
64
- },
63
+ }
65
64
 
66
- gutter: "4px"
65
+ },
66
+ // define size
67
+ size: {
68
+ large: {
69
+ padding: '24px'
70
+ },
71
+ default: {
72
+ padding: '16px'
73
+ }
67
74
  }
68
75
  }, sizes.reduce(function (memo, size) {
69
76
  memo[size] = {
@@ -76,7 +83,9 @@ var defaults = deepDefaults({
76
83
  },
77
84
 
78
85
  get padding() {
79
- return "0 " + theme[size].padding;
86
+ var _tabs$size$size;
87
+
88
+ return "0 " + (((_tabs$size$size = tabs.size[size]) == null ? void 0 : _tabs$size$size.padding) || theme[size].padding);
80
89
  },
81
90
 
82
91
  get closeFontSize() {
@@ -93,8 +102,45 @@ setDefault(function () {
93
102
  }).tabs;
94
103
  });
95
104
  export function makeStyles() {
96
- return /*#__PURE__*/css("border-bottom:", tabs.border, ";position:relative;line-height:1;.k-tab{margin:", tabs.margin, ";cursor:pointer;display:inline-block;text-align:center;color:", tabs.color, ";position:relative;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&:hover,&.k-active{color:", tabs.activeColor, ";}&.k-disabled{color:", theme.color.disabled, ";cursor:not-allowed;}}.k-tab-close{margin-right:-", tabs.closeGutter, ";margin-left:", tabs.closeGutter, ";position:relative;top:-1px;}.k-tabs-active-bar{transition:all ", tabs.transition, ";position:absolute;left:0;height:", tabs.highlight.height, ";background:", tabs.highlight.bgColor, ";bottom:calc(-", tabs.highlight.height, " / 2);}&.k-vertical{display:inline-block;border-bottom:none;border-right:", tabs.border, ";.k-tab{display:block;margin:0;padding:", tabs.verticalPadding, ";}.k-tabs-active-bar{left:auto;top:0;right:calc(-", tabs.highlight.height, " / 2);width:", tabs.highlight.height, ";height:auto;}}&.k-tabs-card{.k-tab{margin:0;}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;border-left:", tabs.border, ";border-right:", tabs.border, ";&:before{content:'';display:block;position:absolute;height:", tabs.highlight.height, ";background:", theme.color.primary, ";top:0;left:-", tabs.borderWidth, ";right:-", tabs.borderWidth, ";}}&.k-vertical{.k-tabs-active-bar{left:0;width:auto;border-left:none;border-right:none;border-top:", tabs.border, ";border-bottom:", tabs.border, ";&:before{width:", tabs.highlight.height, ";left:0;right:auto;bottom:0;height:auto;}}}}&.k-tabs-border-card{border:", tabs.border, ";border-bottom:none;background:", tabs.borderCard.bgColor, ";.k-tab{margin:0;}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;}&.k-vertical{border-right:none;border-bottom:", tabs.border, ";.k-tabs-active-bar{width:auto;height:0;left:0;bottom:0;right:0;}}}&.k-tabs-no-border-card{border-bottom:none;.k-tab{margin-right:", tabs.noBorderCard.gutter, ";&:before{content:'';display:block;position:absolute;background:", tabs.noBorderCard.bgColor, ";top:0;bottom:0;left:0;right:0;z-index:-1;}}.k-tabs-acitve-bar{border:none;&:before{left:0;right:0;}}&.k-vertical{border-right:none;.k-tab:not(:first-of-type){margin:", tabs.noBorderCard.gutter, " 0 0;}.k-tabs-active-bar{border:none;}}}&:not(.k-vertical){.k-tabs-scroll{overflow:hidden;position:relative;padding-bottom:1px;margin-bottom:-1px;}&.k-tabs-border-card,&.k-tabs-no-border-card{.k-tabs-scroll{padding-bottom:0;margin-bottom:0;}}.k-tabs-wrapper{white-space:nowrap;float:left;transition:transform ", tabs.transition, ";}.k-tabs-prev,.k-tabs-next{position:absolute;top:0;width:", tabs.navigatorWidth, "!important;}.k-tabs-prev{left:0;}.k-tabs-next{right:0;}&.k-is-scroll{padding:0 ", tabs.navigatorWidth, ";}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
105
+ return /*#__PURE__*/css(makeCommonStyles(), ";", makeScrollStyles(), ";&.k-type-default{", makeDefaultStyles(), ";}&.k-type-card{", makeDefaultStyles(), " ", makeCardStyles(), ";}&.k-type-border-card{", makeBorderCardStyles(), ";}&.k-type-no-border-card{", makeNoBorderCardStyles(), ";}");
106
+ }
107
+
108
+ function makeCommonStyles() {
109
+ var active = tabs.active;
110
+ var bar = active.bar;
111
+ return /*#__PURE__*/css("position:relative;.k-tab{cursor:pointer;display:inline-block;text-align:center;color:", tabs.color, ";position:relative;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&:hover,&.k-active{color:", active.color, ";}&.k-disabled{color:", theme.color.disabled, ";cursor:not-allowed;}}.k-tab-close{margin-right:-", tabs.closeGap, ";margin-left:", tabs.closeGap, ";position:relative;top:-1px;color:", theme.color.lightBlack, ";}.k-tabs-active-bar{transition:all ", tabs.transition, ";position:absolute;left:0;height:", bar.height, ";background:", bar.bgColor, ";bottom:calc(-", bar.height, " / 2);}&.k-vertical{display:inline-block;.k-tab{display:block;}.k-tabs-active-bar{left:auto;top:0;right:calc(-", bar.height, " / 2);width:", bar.height, ";height:auto;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
97
112
  var styles = tabs[size];
98
- return "\n &.k-" + size + " {\n .k-tab {\n font-size: " + styles.fontSize + ";\n height: " + styles.height + ";\n line-height: " + styles.height + ";\n padding: " + styles.padding + ";\n }\n .k-tab-close .k-icon {\n font-size: " + styles.closeFontSize + ";\n }\n }\n ";
113
+ return "\n &.k-size-" + size + " {\n .k-tab {\n font-size: " + styles.fontSize + ";\n height: " + styles.height + ";\n line-height: " + styles.height + ";\n padding: " + styles.padding + ";\n }\n .k-tab-close .k-icon {\n font-size: " + styles.closeFontSize + ";\n }\n }\n ";
99
114
  }), ";");
115
+ }
116
+
117
+ function makeScrollStyles() {
118
+ return /*#__PURE__*/css("&:not(.k-vertical){.k-tabs-scroll{overflow:hidden;position:relative;padding-bottom:1px;margin-bottom:-1px;}&.k-tabs-border-card,&.k-tabs-no-border-card{.k-tabs-scroll{padding-bottom:0;margin-bottom:0;}}.k-tabs-wrapper{white-space:nowrap;float:left;transition:transform ", tabs.transition, ";}.k-tabs-prev,.k-tabs-next{position:absolute;top:0;width:", tabs.navigatorWidth, "!important;}.k-tabs-prev{left:0;}.k-tabs-next{right:0;}&.k-is-scroll{padding:0 ", tabs.navigatorWidth, ";}}");
119
+ }
120
+
121
+ function makeDefaultStyles() {
122
+ return /*#__PURE__*/css("border-bottom:", tabs.border, ";&.k-vertical{border-bottom:none;border-right:", tabs.border, ";}");
123
+ }
124
+
125
+ function makeCardActiveBarCommonStyles() {
126
+ return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
127
+ name: "1c3pzdg",
128
+ styles: "background:#fff;top:0;height:auto;z-index:-1"
129
+ } : {
130
+ name: "1c3pzdg",
131
+ styles: "background:#fff;top:0;height:auto;z-index:-1",
132
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
133
+ });
134
+ }
135
+
136
+ function makeCardStyles() {
137
+ return /*#__PURE__*/css(".k-tab{margin:0;}.k-tabs-active-bar{", makeCardActiveBarCommonStyles(), ";border-left:", tabs.border, ";border-right:", tabs.border, ";&:before{content:'';display:block;position:absolute;height:", tabs.active.bar.height, ";background:", theme.color.primary, ";top:0;left:-", tabs.borderWidth, ";right:-", tabs.borderWidth, ";}}&.k-vertical{.k-tabs-active-bar{left:0;width:auto;border-left:none;border-right:none;border-top:", tabs.border, ";border-bottom:", tabs.border, ";&:before{width:", tabs.active.bar.height, ";left:0;right:auto;bottom:0;height:auto;}}}");
138
+ }
139
+
140
+ function makeBorderCardStyles() {
141
+ return /*#__PURE__*/css("border:", tabs.border, ";border-bottom:none;background:", tabs.borderCard.bgColor, ";.k-tab{margin:0;}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;}&.k-vertical{border-right:none;border-bottom:", tabs.border, ";.k-tabs-active-bar{width:auto;height:0;left:0;bottom:0;right:0;}}");
142
+ }
143
+
144
+ function makeNoBorderCardStyles() {
145
+ return /*#__PURE__*/css("border-radius:", theme.borderRadius, ";.k-tab{&:before{content:'';display:block;position:absolute;background:", tabs.noBorderCard.bgColor, ";top:0;bottom:0;left:0;right:0;z-index:-1;}}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;box-shadow:0px 0px 5px rgba(0, 0, 0, 0.08);border-radius:4px 4px 0px 0px;}&.k-vertical{border-right:none;.k-tabs-active-bar{width:auto;height:0;left:0;bottom:0;right:0;}}");
100
146
  }
@@ -17,7 +17,7 @@ var defaults = function defaults() {
17
17
  return {
18
18
  type: 'default',
19
19
  size: 'default',
20
- border: 'solid'
20
+ border: 'none'
21
21
  };
22
22
  };
23
23
 
@@ -5,8 +5,8 @@ import { theme, setDefault } from '../../styles/theme';
5
5
  import '../../styles/global';
6
6
  var types = ['primary', 'warning', 'danger', 'success', 'disabled'];
7
7
  var defaults = deepDefaults({
8
- get borderColor() {
9
- return theme.color.border;
8
+ get border() {
9
+ return "1px solid " + theme.color.border;
10
10
  },
11
11
 
12
12
  get borderRadius() {
@@ -19,6 +19,11 @@ var defaults = deepDefaults({
19
19
 
20
20
  padding: "0 8px",
21
21
  height: '20px',
22
+
23
+ get bgColor() {
24
+ return theme.color.bg;
25
+ },
26
+
22
27
  close: {
23
28
  fontSize: '20px',
24
29
  gap: '8px'
@@ -38,26 +43,26 @@ var defaults = deepDefaults({
38
43
 
39
44
  },
40
45
  large: {
41
- padding: "0px 16px",
42
- height: '32px',
46
+ padding: "0px 8px",
47
+ height: '24px',
43
48
  close: {
44
- fontSize: '24px',
49
+ fontSize: '20px',
45
50
  gap: '12px'
46
51
  }
47
52
  },
48
53
  small: {
49
54
  padding: "0 4px",
50
- height: '18px',
55
+ height: '16px',
51
56
  close: {
52
- fontSize: '18px',
57
+ fontSize: '12px',
53
58
  gap: '4px'
54
59
  }
55
60
  },
56
61
  mini: {
57
- padding: "0 1px",
62
+ padding: "0 2px",
58
63
  height: '14px',
59
64
  close: {
60
- fontSize: '16px',
65
+ fontSize: '12px',
61
66
  gap: '2px'
62
67
  }
63
68
  },
@@ -88,7 +93,7 @@ setDefault(function () {
88
93
  }).tag;
89
94
  });
90
95
  export function makeStyles() {
91
- return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:1px solid ", tag.borderColor, ";border-radius:", tag.borderRadius, ";font-size:", tag.fontSize, ";height:", tag.height, ";.k-tag-close{font-size:", tag.close.fontSize, ";margin-left:", tag.close.gap, ";}&.k-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
96
+ 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, ";}&.k-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
92
97
  var styles = tag[t];
93
98
  return /*#__PURE__*/css("&.k-", t, "{color:", styles.color, ";border-color:", styles.color, ";background:", styles.bgColor, ";}");
94
99
  }), " ", _mapInstanceProperty(sizes).call(sizes, function (s) {
@@ -55,9 +55,7 @@ export default function ($props, $blocks, $__proto__) {
55
55
  'className': 'k-tip-close',
56
56
  'children': (_$blocks['close'] = function ($super) {
57
57
  return _$cc(Icon, {
58
- 'className': 'ion-ios-close-empty',
59
- 'size': 'large',
60
- 'color': type,
58
+ 'className': 'k-icon-close',
61
59
  'hoverable': !disabled
62
60
  });
63
61
  }, __$blocks['close'] = function ($super, data) {
@@ -5,11 +5,12 @@ import { deepDefaults } from '../../styles/utils';
5
5
  var defaults = {
6
6
  title: {
7
7
  fontSize: '14px',
8
- gap: '8px'
8
+ gap: '8px',
9
+ fontWeight: '500'
9
10
  },
10
11
 
11
12
  get color() {
12
- return theme.color.text;
13
+ return theme.color.title;
13
14
  },
14
15
 
15
16
  get padding() {
@@ -24,5 +25,5 @@ setDefault(function () {
24
25
  }).tip;
25
26
  });
26
27
  export function makeStyles() {
27
- return /*#__PURE__*/css("&.k-tip{display:flex;height:auto;padding:0;color:", tip.color, "!important;align-items:flex-start;}.k-tip-wrapper{flex:1;padding:", tip.padding, ";}.k-tip-title{font-size:", tip.title.fontSize, ";margin-bottom:", tip.title.gap, ";}&.k-fade-leave-active{position:relative;}");
28
+ return /*#__PURE__*/css("&.k-tip{display:flex;height:auto;padding:0;color:", tip.color, "!important;align-items:flex-start;}.k-tip-wrapper{flex:1;padding:", tip.padding, ";}.k-tip-title{font-size:", tip.title.fontSize, ";margin-bottom:", tip.title.gap, ";font-weight:", tip.title.fontWeight, ";}&.k-fade-leave-active{position:relative;}.k-tip-close:hover{background:none;}");
28
29
  }
@@ -52,14 +52,14 @@ export default function ($props, $blocks, $__proto__) {
52
52
  "k-tooltip-arrow": true
53
53
  }, _$cn2["k-" + arrowType.value] = arrowType.value, _$cn2)), null, 'tooltip-arrow', arrowRef) : undefined, confirm ? _$ce(2, 'div', (_$blocks['buttons'] = function ($super) {
54
54
  return [_$cc(Button, {
55
+ 'ev-click': this.cancel,
56
+ 'size': 'small',
57
+ 'children': cancelText
58
+ }), _$cc(Button, {
55
59
  'type': 'primary',
56
60
  'ev-click': this.ok,
57
61
  'size': 'small',
58
62
  'children': okText
59
- }), _$cc(Button, {
60
- 'ev-click': this.cancel,
61
- 'size': 'small',
62
- 'children': cancelText
63
63
  })];
64
64
  }, __$blocks['buttons'] = function ($super, data) {
65
65
  var block = $blocks['buttons'];
@@ -13,11 +13,16 @@ var defaults = {
13
13
 
14
14
  bgColor: '#fff',
15
15
  lineHeight: 1.4,
16
- maxWidth: '300px',
16
+ maxWidth: '312px',
17
+
18
+ get boxShadow() {
19
+ return theme.middleBoxShadow;
20
+ },
21
+
17
22
  // arrow
18
23
  arrow: {
19
- borderColor: 'rgba(191, 191, 191, .5)',
20
- width: '8px'
24
+ borderColor: 'rgba(221, 221, 221, .5)',
25
+ width: '6px'
21
26
  },
22
27
  // confirm
23
28
  confirm: {
@@ -26,13 +31,13 @@ var defaults = {
26
31
  // dark
27
32
  dark: {
28
33
  get bgColor() {
29
- return theme.color.text;
34
+ return theme.color.title;
30
35
  },
31
36
 
32
37
  color: '#fff',
33
38
 
34
39
  get arrowBorderColor() {
35
- return theme.color.text;
40
+ return theme.color.title;
36
41
  }
37
42
 
38
43
  },
@@ -53,9 +58,9 @@ var directionMap = {
53
58
  };
54
59
  export default function makeStyles() {
55
60
  var arrowLong = tooltip.arrow.width;
56
- var arrowShort = "calc(" + arrowLong + " - 2px)"; // use &.k-tooltip-content to override css in dropdown menu
61
+ var arrowShort = "calc(" + arrowLong + " - 1px)"; // use &.k-tooltip-content to override css in dropdown menu
57
62
 
58
- return /*#__PURE__*/css("&.k-tooltip-content{max-width:", tooltip.maxWidth, ";min-width:0;padding:", tooltip.padding, ";line-height:", tooltip.lineHeight, ";word-wrap:break-word;pointer-events:none;&.k-hoverable,&.k-always{pointer-events:all;}.k-tooltip-arrow{pointer-events:none;&:before,&{position:absolute;display:block;border-style:solid;border-color:transparent;}&:before{content:' ';}&.k-top,&.k-bottom{&:before,&{border-width:", arrowLong, " ", arrowShort, ";}&:before{left:calc(-1 * ", arrowShort, ");}}&.k-top{top:calc(-2 * ", arrowLong, ");&:before{top:calc(-", arrowLong, " + 1px);}}&.k-bottom{bottom:calc(-2 * ", arrowLong, ");&:before{bottom:calc(-", arrowLong, " + 1px);}}&.k-left,&.k-right{&:before,&{border-width:", arrowShort, " ", arrowLong, ";}&:before{top:calc(-1 * ", arrowShort, ");}}&.k-left{left:calc(-2 * ", arrowLong, ");&:before{left:calc(-", arrowLong, " + 1px);}}&.k-right{right:calc(-2 * ", arrowLong, ");&:before{right:calc(-", arrowLong, " + 1px);}}}", _mapInstanceProperty(themes).call(themes, function (theme) {
63
+ return /*#__PURE__*/css("&.k-tooltip-content{max-width:", tooltip.maxWidth, ";min-width:0;padding:", tooltip.padding, ";line-height:", tooltip.lineHeight, ";word-wrap:break-word;pointer-events:none;box-shadow:", tooltip.boxShadow, ";&.k-hoverable,&.k-always{pointer-events:all;}.k-tooltip-arrow{pointer-events:none;&:before,&{position:absolute;display:block;border-style:solid;border-color:transparent;}&:before{content:' ';}&.k-top,&.k-bottom{&:before,&{border-width:", arrowLong, " ", arrowShort, ";}&:before{left:calc(-1 * ", arrowShort, ");}}&.k-top{top:calc(-2 * ", arrowLong, ");&:before{top:calc(-", arrowLong, " + 1px);}}&.k-bottom{bottom:calc(-2 * ", arrowLong, ");&:before{bottom:calc(-", arrowLong, " + 1px);}}&.k-left,&.k-right{&:before,&{border-width:", arrowShort, " ", arrowLong, ";}&:before{top:calc(-1 * ", arrowShort, ");}}&.k-left{left:calc(-2 * ", arrowLong, ");&:before{left:calc(-", arrowLong, " + 1px);}}&.k-right{right:calc(-2 * ", arrowLong, ");&:before{right:calc(-", arrowLong, " + 1px);}}}", _mapInstanceProperty(themes).call(themes, function (theme) {
59
64
  var _context;
60
65
 
61
66
  var borderColor;
@@ -37,7 +37,8 @@ export default function ($props, $blocks, $__proto__) {
37
37
  var _this$check = this.check,
38
38
  isCheckAll = _this$check.isCheckAll,
39
39
  toggleCheckAll = _this$check.toggleCheckAll,
40
- onCheckboxChange = _this$check.onCheckboxChange;
40
+ onCheckboxChange = _this$check.onCheckboxChange,
41
+ isIndeterminate = _this$check.isIndeterminate;
41
42
  var classNameObj = (_classNameObj = {
42
43
  'k-transfer': true
43
44
  }, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
@@ -50,6 +51,7 @@ export default function ($props, $blocks, $__proto__) {
50
51
  return [_$ce(2, 'div', [this.get(model + "CheckedKeys.length"), _$ct(' /\n '), data.length], 0, 'k-transfer-count'), _$cc(Checkbox, {
51
52
  'className': 'c-ellipsis',
52
53
  'value': isCheckAll(model),
54
+ 'indeterminate': isIndeterminate(model),
53
55
  'ev-click': toggleCheckAll.bind(null, model),
54
56
  'children': title
55
57
  })];
@@ -63,5 +63,5 @@ setDefault(function () {
63
63
  }).transfer;
64
64
  });
65
65
  export function makeStyles() {
66
- 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;}.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, ";}}");
66
+ 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, ";}}");
67
67
  }
@@ -4,4 +4,5 @@ export declare function useCheck({ getEnabledData, getShowedData }: ReturnType<t
4
4
  isCheckAll: (model: Model) => boolean | 0;
5
5
  toggleCheckAll: (model: Model, e: MouseEvent) => void;
6
6
  onCheckboxChange: (model: Model, index: number, e: MouseEvent) => void;
7
+ isIndeterminate: (model: Model) => boolean;
7
8
  };
@@ -33,6 +33,12 @@ export function useCheck(_ref) {
33
33
  }
34
34
  }
35
35
 
36
+ function isIndeterminate(model) {
37
+ var checked = instance.get(model + "CheckedKeys");
38
+ var data = getEnabledData(model);
39
+ return checked.length > 0 && checked.length < data.length;
40
+ }
41
+
36
42
  function onCheckboxChange(model, index, e) {
37
43
  if (startIndex === undefined || !e.shiftKey) {
38
44
  startIndex = index;
@@ -84,6 +90,7 @@ export function useCheck(_ref) {
84
90
  return {
85
91
  isCheckAll: isCheckAll,
86
92
  toggleCheckAll: toggleCheckAll,
87
- onCheckboxChange: onCheckboxChange
93
+ onCheckboxChange: onCheckboxChange,
94
+ isIndeterminate: isIndeterminate
88
95
  };
89
96
  }