@king-design/intact 3.4.2 → 3.4.3-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 (97) hide show
  1. package/components/button/demos/disabled.md +14 -4
  2. package/components/button/index.vdt +1 -1
  3. package/components/button/styles.ts +14 -1
  4. package/components/dialog/styles.ts +3 -3
  5. package/components/dropdown/item.ts +7 -2
  6. package/components/editable/index.spec.ts +8 -8
  7. package/components/editable/index.vdt +3 -1
  8. package/components/editable/styles.ts +8 -1
  9. package/components/ellipsis/index.vdt +1 -0
  10. package/components/menu/styles.ts +3 -0
  11. package/components/select/base.ts +7 -1
  12. package/components/select/base.vdt +2 -1
  13. package/components/select/demos/immutable.md +38 -0
  14. package/components/select/useImmutable.ts +46 -0
  15. package/components/switch/index.ts +1 -1
  16. package/components/table/cell.ts +1 -0
  17. package/components/table/cell.vdt +8 -2
  18. package/components/table/column.ts +2 -0
  19. package/components/table/demos/asyncTree.md +70 -0
  20. package/components/table/demos/footer.md +38 -0
  21. package/components/table/index.md +3 -0
  22. package/components/table/row.ts +4 -3
  23. package/components/table/row.vdt +2 -2
  24. package/components/table/styles.ts +1 -1
  25. package/components/table/table.ts +3 -0
  26. package/components/table/table.vdt +10 -2
  27. package/components/table/useTree.ts +9 -2
  28. package/components/tooltip/tooltip.ts +2 -0
  29. package/components/treeSelect/demos/basic.md +1 -0
  30. package/components/treeSelect/index.vdt +1 -0
  31. package/es/components/button/index.vdt.js +1 -1
  32. package/es/components/button/styles.js +3 -3
  33. package/es/components/diagram/shapes/callout.d.ts +1 -1
  34. package/es/components/diagram/shapes/circle.d.ts +1 -1
  35. package/es/components/diagram/shapes/document.d.ts +1 -1
  36. package/es/components/diagram/shapes/ellipse.d.ts +1 -1
  37. package/es/components/diagram/shapes/hexagon.d.ts +1 -1
  38. package/es/components/diagram/shapes/image.d.ts +1 -1
  39. package/es/components/diagram/shapes/parallelogram.d.ts +1 -1
  40. package/es/components/diagram/shapes/rectangle.d.ts +1 -1
  41. package/es/components/diagram/shapes/square.d.ts +1 -1
  42. package/es/components/diagram/shapes/text.d.ts +1 -1
  43. package/es/components/dialog/styles.js +3 -3
  44. package/es/components/dropdown/item.js +5 -2
  45. package/es/components/editable/index.spec.js +8 -8
  46. package/es/components/editable/index.vdt.js +3 -1
  47. package/es/components/editable/styles.d.ts +1 -0
  48. package/es/components/editable/styles.js +4 -1
  49. package/es/components/ellipsis/index.vdt.js +1 -0
  50. package/es/components/menu/styles.js +1 -1
  51. package/es/components/select/base.d.ts +4 -0
  52. package/es/components/select/base.js +11 -1
  53. package/es/components/select/base.vdt.js +2 -1
  54. package/es/components/select/useImmutable.d.ts +4 -0
  55. package/es/components/select/useImmutable.js +46 -0
  56. package/es/components/switch/index.js +1 -1
  57. package/es/components/table/cell.d.ts +1 -0
  58. package/es/components/table/cell.vdt.js +13 -3
  59. package/es/components/table/column.d.ts +1 -0
  60. package/es/components/table/column.js +1 -0
  61. package/es/components/table/row.d.ts +2 -1
  62. package/es/components/table/row.js +3 -2
  63. package/es/components/table/row.vdt.js +3 -1
  64. package/es/components/table/styles.js +1 -1
  65. package/es/components/table/table.d.ts +2 -0
  66. package/es/components/table/table.js +2 -1
  67. package/es/components/table/table.vdt.js +14 -0
  68. package/es/components/table/useTree.d.ts +1 -1
  69. package/es/components/table/useTree.js +30 -2
  70. package/es/components/tooltip/tooltip.d.ts +1 -0
  71. package/es/components/tooltip/tooltip.js +9 -1
  72. package/es/components/treeSelect/index.vdt.js +1 -0
  73. package/es/index.d.ts +2 -2
  74. package/es/index.js +2 -2
  75. package/es/site/data/components/button/demos/disabled/index.d.ts +1 -0
  76. package/es/site/data/components/button/demos/disabled/index.js +1 -0
  77. package/es/site/data/components/button/demos/disabled/react.d.ts +1 -0
  78. package/es/site/data/components/button/demos/disabled/react.js +28 -15
  79. package/es/site/data/components/select/demos/immutable/index.d.ts +9 -0
  80. package/es/site/data/components/select/demos/immutable/index.js +18 -0
  81. package/es/site/data/components/select/demos/immutable/react.d.ts +9 -0
  82. package/es/site/data/components/select/demos/immutable/react.js +53 -0
  83. package/es/site/data/components/table/demos/asyncTree/index.d.ts +20 -0
  84. package/es/site/data/components/table/demos/asyncTree/index.js +53 -0
  85. package/es/site/data/components/table/demos/asyncTree/react.d.ts +20 -0
  86. package/es/site/data/components/table/demos/asyncTree/react.js +76 -0
  87. package/es/site/data/components/table/demos/footer/index.d.ts +12 -0
  88. package/es/site/data/components/table/demos/footer/index.js +25 -0
  89. package/es/site/data/components/table/demos/footer/react.d.ts +11 -0
  90. package/es/site/data/components/table/demos/footer/react.js +46 -0
  91. package/es/site/data/components/treeSelect/demos/basic/react.js +2 -1
  92. package/index.ts +2 -2
  93. package/package.json +2 -2
  94. package/components/descriptions/.DS_Store +0 -0
  95. package/components/menu/.DS_Store +0 -0
  96. package/components/menu/demos/.DS_Store +0 -0
  97. package/styles/.DS_Store +0 -0
@@ -137,11 +137,11 @@ const tbody = (
137
137
  const spreaded = isSpreaded(key);
138
138
  const hasChildren = !!childrenKey && Array.isArray(value[childrenKey]);
139
139
  const indentSize = indent ? indent * level : 0;
140
-
141
140
  let row = <TableRow
142
141
  key={key}
143
142
  cols={cols}
144
143
  data={value}
144
+ loaded={value.loaded}
145
145
  checkType={checkType}
146
146
  hasFixedLeft={hasFixedLeft}
147
147
  onClick={this.clickRow}
@@ -199,7 +199,15 @@ const tbody = (
199
199
 
200
200
  return hidden || !spreaded;
201
201
  });
202
-
202
+ if ($blocks.footer) {
203
+ rows.push(
204
+ <tr key="table-footer">
205
+ <td colspan={colCount} class={`${k}-table-footer`}>
206
+ <b:footer />
207
+ </td>
208
+ </tr>
209
+ );
210
+ }
203
211
  return animation[0] ?
204
212
  <TransitionGroup name="k-fade-in-left" move={!draggingKey.value}>{rows}</TransitionGroup> :
205
213
  rows;
@@ -11,8 +11,15 @@ export function useTree(data: State<any[] | undefined>) {
11
11
  return inArray(instance.get('spreadKeys'), key);
12
12
  }
13
13
 
14
- function toggleSpreadRow(key: TableRowKey) {
15
- instance.set('spreadKeys', toggleArray(instance.get('spreadKeys'), key));
14
+ async function toggleSpreadRow(key: TableRowKey, rowData?: any) {
15
+ const {spreadKeys, load} = instance.get();
16
+ instance.set('spreadKeys', toggleArray(spreadKeys, key));
17
+ if (load && data.value && !rowData.loaded) {
18
+ rowData.loaded = false;
19
+ await load(rowData);
20
+ rowData.loaded = true;
21
+ instance.forceUpdate();
22
+ }
16
23
  }
17
24
 
18
25
  function loopData<T>(
@@ -73,6 +73,8 @@ export class Tooltip<
73
73
  static defaults = defaults;
74
74
  static events = events;
75
75
 
76
+ public $isTooltip = true;
77
+
76
78
  show(shouldFocus: boolean = false) {
77
79
  if (this.get('disabled')) return;
78
80
 
@@ -19,6 +19,7 @@ import {TreeSelect} from 'kpc';
19
19
  <TreeSelect
20
20
  v-model="value"
21
21
  data={this.get('data')}
22
+ showLine={false}
22
23
  />
23
24
  ```
24
25
 
@@ -37,6 +37,7 @@ const { k } = this.config;
37
37
  multiple={multiple}
38
38
  selectable={!checkbox}
39
39
  load={load}
40
+ showLine={showLine}
40
41
  filter={filterable ? this.filter : null}
41
42
 
42
43
  ev-transitionEnd={this.position}
@@ -55,7 +55,7 @@ export default function ($props, $blocks, $__proto__) {
55
55
  }
56
56
  });
57
57
  }
58
- var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = !color, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('disabled')] = disabled || loading, _classNameObj[cls('ghost')] = ghost, _classNameObj[cls('custom')] = color, _classNameObj[makeButtonStyles(k, iconSide, color)] = true, _classNameObj);
58
+ var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = !color, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('custom')] = color, _classNameObj[cls('disabled')] = disabled || loading, _classNameObj[cls('ghost')] = ghost, _classNameObj[makeButtonStyles(k, iconSide, color)] = true, _classNameObj);
59
59
  var loadingIcon = _$cc(Icon, {
60
60
  'className': _$cn("ion-load-c " + k + "-icon-loading"),
61
61
  'size': size /*loadingSizeMap[size]*/,
@@ -11,7 +11,7 @@ var btnStyles = {
11
11
  return theme.color.text;
12
12
  },
13
13
  bgColor: '#fff',
14
- lineHeight: '1.15',
14
+ lineHeight: '1',
15
15
  get padding() {
16
16
  return "0 16px";
17
17
  },
@@ -199,8 +199,8 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide, color
199
199
  // extract static styles to individual css method for performance
200
200
  css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";.", k, "-icon{color:inherit;}&.", k, "-default,&.", k, "-none,&.", k, "-flat{.", k, "-icon{color:", theme.color.lightBlack, ";}&:hover{.", k, "-icon{color:inherit;}}}&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.", k, "-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
201
201
  var typeStyles = button[type];
202
- return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}}");
203
- }), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}", color && /*#__PURE__*/css("&.", k, "-custom{color:", color, ";border-color:", color, ";&:hover,&:focus{background:", palette(color, -4), ";}&:active{background:", palette(color, -3), ";}}"), " &.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
202
+ return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}&.", k, "-disabled{&,&:hover{background:", palette(typeStyles.bgColor, -2), ";color:", palette(typeStyles.color, -2), ";border-color:", palette(typeStyles.borderColor, -2), ";}}}");
203
+ }), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}&.", k, "-disabled{border:none;}}", color && /*#__PURE__*/css("&.", k, "-custom{color:", color, ";border-color:", color, ";&:hover,&:focus{background:", palette(color, -4), ";}&:active{background:", palette(color, -3), ";}&.", k, "-disabled{border:none;}}"), " &.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
204
204
  var styles = button[size];
205
205
  return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.", k, "-btn-icon{width:", styles.height, ";}}");
206
206
  }), "&.", k, "-btn-icon{width:", button.height, ";padding:0;.", k, "-icon{margin:0;}}&.", k, "-fluid{width:100%;padding:0;}&.", k, "-circle{border-radius:calc(", button.large.height, " / 2);}&.", k, "-loading{", _mapInstanceProperty(types).call(types, function (type) {
@@ -12,7 +12,7 @@ export declare class DCallout extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -12,7 +12,7 @@ export declare class DCircle extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -12,7 +12,7 @@ export declare class DDocument extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -12,7 +12,7 @@ export declare class DEllipse extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -12,7 +12,7 @@ export declare class DHexagon extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -18,7 +18,7 @@ export declare class DImage extends DShape<DImageProps> {
18
18
  rotatable?: boolean | undefined;
19
19
  editable?: boolean | undefined;
20
20
  connectable?: boolean | undefined;
21
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
21
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
22
22
  label?: string | number | undefined;
23
23
  style?: Record<string, string | number> | undefined;
24
24
  data?: any;
@@ -12,7 +12,7 @@ export declare class DParallelogram extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -18,7 +18,7 @@ export declare class DRectangle extends DShape<DRectangleProps> {
18
18
  rotatable?: boolean | undefined;
19
19
  editable?: boolean | undefined;
20
20
  connectable?: boolean | undefined;
21
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
21
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
22
22
  label?: string | number | undefined;
23
23
  style?: Record<string, string | number> | undefined;
24
24
  data?: any;
@@ -13,7 +13,7 @@ export declare class DSquare extends DRectangle {
13
13
  rotatable?: boolean | undefined;
14
14
  editable?: boolean | undefined;
15
15
  connectable?: boolean | undefined;
16
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
16
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
17
17
  label?: string | number | undefined;
18
18
  style?: Record<string, string | number> | undefined;
19
19
  data?: any;
@@ -12,7 +12,7 @@ export declare class DText extends DShape {
12
12
  rotatable?: boolean | undefined;
13
13
  editable?: boolean | undefined;
14
14
  connectable?: boolean | undefined;
15
- strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
15
+ strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
16
16
  label?: string | number | undefined;
17
17
  style?: Record<string, string | number> | undefined;
18
18
  data?: any;
@@ -58,11 +58,11 @@ var defaults = {
58
58
  padding: "0 24px",
59
59
  bodyMarginTop: "-25px",
60
60
  tipIconMarginBottom: '10px',
61
- tipIconFontSize: '37px',
62
- tipIconLineHeight: '37px',
61
+ tipIconFontSize: '24px',
62
+ tipIconLineHeight: '24px',
63
63
  // with title
64
64
  titleFontWeight: '500',
65
- titleTipIconFontSize: '37px',
65
+ titleTipIconFontSize: '24px',
66
66
  titleFontSize: '14px',
67
67
  wrapperPaddingLeft: '8px',
68
68
  titleBodyMarginTop: '-36px'
@@ -50,8 +50,11 @@ export var DropdownItem = /*#__PURE__*/function (_Component) {
50
50
  // hide all dropdowns
51
51
  var dropdown = this.dropdown;
52
52
  do {
53
- dropdown.hide(true);
54
- } while (dropdown = dropdown.dropdown);
53
+ if (!dropdown.$isTooltip) {
54
+ dropdown.hide(true);
55
+ }
56
+ dropdown = dropdown.dropdown;
57
+ } while (dropdown);
55
58
  }
56
59
  };
57
60
  _proto.hasSubMenu = function hasSubMenu() {
@@ -24,7 +24,7 @@ describe('Editable', function () {
24
24
  case 5:
25
25
  expect(element.innerHTML).to.matchSnapshot();
26
26
  // input
27
- input = element.querySelector('input');
27
+ input = element.querySelector('textarea');
28
28
  input.value = 'test';
29
29
  dispatchEvent(input, 'blur');
30
30
  _context.next = 11;
@@ -39,7 +39,7 @@ describe('Editable', function () {
39
39
  return wait();
40
40
  case 16:
41
41
  expect(element.innerHTML).to.matchSnapshot();
42
- input = element.querySelector('input');
42
+ input = element.querySelector('textarea');
43
43
  input.value = 'new';
44
44
  dispatchEvent(input, 'keydown', {
45
45
  keyCode: 27
@@ -56,7 +56,7 @@ describe('Editable', function () {
56
56
  return wait();
57
57
  case 27:
58
58
  expect(element.innerHTML).to.matchSnapshot();
59
- input = element.querySelector('input');
59
+ input = element.querySelector('textarea');
60
60
  input.value = 'new';
61
61
  dispatchEvent(input, 'keydown', {
62
62
  keyCode: 13
@@ -84,7 +84,7 @@ describe('Editable', function () {
84
84
  _context2.next = 5;
85
85
  return wait();
86
86
  case 5:
87
- input = findDomFromVNode(first.$lastInput, true).querySelector('input');
87
+ input = findDomFromVNode(first.$lastInput, true).querySelector('textarea');
88
88
  dispatchEvent(input, 'focus');
89
89
  input.value = 'a';
90
90
  dispatchEvent(input, 'input');
@@ -98,7 +98,7 @@ describe('Editable', function () {
98
98
  _context2.next = 16;
99
99
  return wait();
100
100
  case 16:
101
- input = findDomFromVNode(second.$lastInput, true).querySelector('input');
101
+ input = findDomFromVNode(second.$lastInput, true).querySelector('textarea');
102
102
  input.value = 'a';
103
103
  dispatchEvent(input, 'input');
104
104
  dispatchEvent(input, 'blur');
@@ -111,7 +111,7 @@ describe('Editable', function () {
111
111
  _context2.next = 26;
112
112
  return wait();
113
113
  case 26:
114
- input = findDomFromVNode(third.$lastInput, true).querySelector('input');
114
+ input = findDomFromVNode(third.$lastInput, true).querySelector('textarea');
115
115
  input.value = 'a';
116
116
  dispatchEvent(input, 'input');
117
117
  dispatchEvent(input, 'blur');
@@ -164,7 +164,7 @@ describe('Editable', function () {
164
164
  _context4.next = 7;
165
165
  return wait();
166
166
  case 7:
167
- input = element.querySelector("input");
167
+ input = element.querySelector("textarea");
168
168
  input.value = 'aa';
169
169
  dispatchEvent(input, 'blur');
170
170
  _context4.next = 12;
@@ -175,7 +175,7 @@ describe('Editable', function () {
175
175
  _context4.next = 16;
176
176
  return wait();
177
177
  case 16:
178
- input = element.querySelector("input");
178
+ input = element.querySelector("textarea");
179
179
  expect(input.value).to.eql('aa');
180
180
  case 18:
181
181
  case "end":
@@ -31,7 +31,9 @@ export default function ($props, $blocks, $__proto__) {
31
31
  'ref': this.inputRef,
32
32
  'frozenOnInput': true,
33
33
  'ev-$mounted': this.select,
34
- 'autoWidth': true
34
+ 'width': 300,
35
+ 'type': 'textarea',
36
+ 'rows': 'auto'
35
37
  }, null, this.inputRef), 0, 'c-ellipsis'), !disabled && !editing ? _$cc(Tooltip, {
36
38
  'content': tip,
37
39
  'children': _$cc(Icon, {
@@ -1,6 +1,7 @@
1
1
  import '../../styles/global';
2
2
  declare const defaults: {
3
3
  iconGap: string;
4
+ readonly smallPadding: string;
4
5
  invalid: {
5
6
  readonly border: string;
6
7
  };
@@ -5,6 +5,9 @@ import '../../styles/global';
5
5
  import { cache } from '../utils';
6
6
  var defaults = {
7
7
  iconGap: '0 0 0 8px',
8
+ get smallPadding() {
9
+ return theme.small.padding;
10
+ },
8
11
  // invalid
9
12
  invalid: {
10
13
  get border() {
@@ -21,5 +24,5 @@ setDefault(function () {
21
24
  });
22
25
  export { editable };
23
26
  export var makeStyles = cache(function makeStyles(k) {
24
- return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-wrapper{border:", editable.invalid.border, "!important;}}");
27
+ return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-wrapper{border:", editable.invalid.border, "!important;}}&.", k, "-editable{.", k, "-type-textarea{.", k, "-textarea{padding:0 ", editable.smallPadding, ";}}}");
25
28
  });
@@ -31,6 +31,7 @@ export default function ($props, $blocks, $__proto__) {
31
31
  'position': position,
32
32
  'theme': theme,
33
33
  'className': _$cn(className),
34
+ 'hoverable': true,
34
35
  'children': wrapper,
35
36
  '$blocks': function ($blocks) {
36
37
  var _$blocks = {},
@@ -115,7 +115,7 @@ export var makeMenuStyles = cache(function makeMenuStyles(k) {
115
115
  return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 16px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100% - ", menu.header.height, ");overflow-y:auto;overflow-x:hidden;scrollbar-width:none;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border-right:1px solid ", theme.color.disabledBg, ";background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
116
116
  var styles = menu[size];
117
117
  return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}.", k, "-menu-arrow-box{left:calc(", styles.width, " - 2px);}}");
118
- }), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
118
+ }), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-header{padding:0;}.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
119
119
  });
120
120
  export var makeTitleStyles = cache(function makeTitleStyles(k) {
121
121
  var item = menu.item;
@@ -51,6 +51,10 @@ export declare abstract class BaseSelect<T extends BaseSelectProps<any> = BaseSe
51
51
  };
52
52
  private focusout;
53
53
  private draggable;
54
+ immutable: {
55
+ immutableValues: State<any[]>;
56
+ isClosable: (key: string) => boolean;
57
+ };
54
58
  protected config: {
55
59
  cls: (name: string) => string;
56
60
  readonly k: string;
@@ -2,6 +2,8 @@ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
2
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
3
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
4
4
  import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
5
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
6
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
5
7
  import { __decorate } from "tslib";
6
8
  import { Component, provide, createRef } from 'intact';
7
9
  import template from './base.vdt';
@@ -14,6 +16,7 @@ import { useInput } from './useInput';
14
16
  import { useFocusout } from './useFocusout';
15
17
  import { isNullOrUndefined } from 'intact-shared';
16
18
  import { useDraggable } from './useDraggble';
19
+ import { useImmutable } from './useImmutable';
17
20
  import { useConfigContext } from '../config';
18
21
  var typeDefs = {
19
22
  value: null,
@@ -60,6 +63,7 @@ export var BaseSelect = /*#__PURE__*/function (_Component) {
60
63
  _this.input = useInput(_this.resetKeywords);
61
64
  _this.focusout = useFocusout();
62
65
  _this.draggable = useDraggable();
66
+ _this.immutable = useImmutable();
63
67
  _this.config = useConfigContext();
64
68
  return _this;
65
69
  }
@@ -104,7 +108,13 @@ export var BaseSelect = /*#__PURE__*/function (_Component) {
104
108
  };
105
109
  _proto.clear = function clear(e) {
106
110
  e.stopPropagation();
107
- this.set('value', this.get('multiple') ? [] : null);
111
+ var _this$get2 = this.get(),
112
+ value = _this$get2.value,
113
+ multiple = _this$get2.multiple;
114
+ var immutableValues = this.immutable.immutableValues.value;
115
+ this.set('value', multiple ? Array.isArray(value) ? _filterInstanceProperty(value).call(value, function (key) {
116
+ return _includesInstanceProperty(immutableValues).call(immutableValues, key);
117
+ }) : [] : null);
108
118
  };
109
119
  _proto.onKeydown = function onKeydown(e) {
110
120
  this.trigger('keydown', e);
@@ -57,6 +57,7 @@ export default function ($props, $blocks, $__proto__) {
57
57
  var _this$focusout = this.focusout,
58
58
  onFocusout = _this$focusout.onFocusout,
59
59
  triggerRef = _this$focusout.triggerRef;
60
+ var isClosable = this.immutable.isClosable;
60
61
  var filterInput = filterable ? _$cc(Input, {
61
62
  'className': _$cn(k + "-select-input"),
62
63
  'value': keywords,
@@ -139,7 +140,7 @@ export default function ($props, $blocks, $__proto__) {
139
140
  'children': _$ma(label, function ($label, $key) {
140
141
  return _$cc(Tag, {
141
142
  'key': isStringOrNumber($label) ? $label : isStringOrNumber(value[$key]) ? value[$key] : $key,
142
- 'closable': true,
143
+ 'closable': isClosable(value[$key]),
143
144
  'ev-close': this.delete.bind(this, $key),
144
145
  'disabled': disabled,
145
146
  'size': size,
@@ -0,0 +1,4 @@
1
+ export declare function useImmutable(): {
2
+ immutableValues: import("../../hooks/useState").State<any[]>;
3
+ isClosable: (key: string) => boolean;
4
+ };
@@ -0,0 +1,46 @@
1
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
2
+ import { useInstance } from 'intact';
3
+ import { Option } from './option';
4
+ import { OptionGroup } from './group';
5
+ import { eachChildren, isComponentVNode } from '../utils';
6
+ import { useState } from '../../hooks/useState';
7
+ export function useImmutable() {
8
+ var instance = useInstance();
9
+ var immutableValues = useState([]);
10
+ function setImmutableValues() {
11
+ var _instance$get = instance.get(),
12
+ children = _instance$get.children,
13
+ multiple = _instance$get.multiple;
14
+ if (!multiple) return;
15
+ updateImmutableValues(children);
16
+ }
17
+ function updateImmutableValues(children) {
18
+ var _immutableValues = [];
19
+ var loop = function loop(children) {
20
+ eachChildren(children, function (vNode) {
21
+ if (isComponentVNode(vNode, Option)) {
22
+ var _vNode$props = vNode.props,
23
+ disabled = _vNode$props.disabled,
24
+ value = _vNode$props.value;
25
+ if (disabled) {
26
+ _immutableValues.push(value);
27
+ }
28
+ } else if (isComponentVNode(vNode, OptionGroup)) {
29
+ loop(vNode.props.children);
30
+ }
31
+ });
32
+ };
33
+ loop(children);
34
+ immutableValues.set(_immutableValues);
35
+ }
36
+ function isClosable(key) {
37
+ var _context;
38
+ return !_includesInstanceProperty(_context = immutableValues.value).call(_context, key);
39
+ }
40
+ setImmutableValues();
41
+ // instance.on('$receive:children', setImmutableValues);
42
+ return {
43
+ immutableValues: immutableValues,
44
+ isClosable: isClosable
45
+ };
46
+ }
@@ -28,7 +28,7 @@ var defaults = function defaults() {
28
28
  value: false,
29
29
  trueValue: true,
30
30
  falseValue: false,
31
- size: 'default',
31
+ size: 'small',
32
32
  loading: false
33
33
  };
34
34
  };
@@ -15,6 +15,7 @@ export interface TableCellProps {
15
15
  rowspan: number;
16
16
  onClickArrow: (e: MouseEvent) => void;
17
17
  hasChildren: boolean;
18
+ loaded: boolean;
18
19
  }
19
20
  export declare class TableCell extends Component<TableCellProps> {
20
21
  static template: string | import("intact").Template<any>;
@@ -1,9 +1,10 @@
1
- import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn } from 'intact';
1
+ import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn } from 'intact';
2
2
  import { getClassAndStyleForFixed } from './useFixedColumns';
3
3
  import { get, noop } from 'intact-shared';
4
4
  import { Button } from '../button';
5
5
  import { Icon } from '../icon';
6
6
  import { getTextByChildren } from '../utils';
7
+ import { Ellipsis } from '../ellipsis';
7
8
  export default function ($props, $blocks, $__proto__) {
8
9
  var _classNameObj;
9
10
  $blocks || ($blocks = {});
@@ -21,7 +22,8 @@ export default function ($props, $blocks, $__proto__) {
21
22
  colspan = _this$get.colspan,
22
23
  rowspan = _this$get.rowspan,
23
24
  onClickArrow = _this$get.onClickArrow,
24
- hasChildren = _this$get.hasChildren;
25
+ hasChildren = _this$get.hasChildren,
26
+ loaded = _this$get.loaded;
25
27
  var k = this.config.k;
26
28
  var blocks = props.$blocks;
27
29
  var children = get(data, props.key);
@@ -31,6 +33,11 @@ export default function ($props, $blocks, $__proto__) {
31
33
  children = template(noop, [data, rowIndex]);
32
34
  }
33
35
  }
36
+ if (props.ellipsis) {
37
+ children = _$cc(Ellipsis, {
38
+ 'children': children
39
+ });
40
+ }
34
41
  var _getClassAndStyleForF = getClassAndStyleForFixed(props, offset, k, checkType),
35
42
  className = _getClassAndStyleForF.className,
36
43
  style = _getClassAndStyleForF.style;
@@ -46,9 +53,12 @@ export default function ($props, $blocks, $__proto__) {
46
53
  'size': 'mini',
47
54
  'className': _$cn(k + "-table-arrow"),
48
55
  'ev-click': onClickArrow,
49
- 'children': _$cc(Icon, {
56
+ 'children': loaded !== false ? _$cc(Icon, {
50
57
  'className': _$cn(k + "-icon-right"),
51
58
  'size': 'small'
59
+ }) : _$cc(Icon, {
60
+ 'className': _$cn(k + "-tree-icon ion-load-c"),
61
+ 'rotate': true
52
62
  })
53
63
  }) : undefined, children], 0, _$cn(classNameObj), {
54
64
  'style': style,
@@ -14,6 +14,7 @@ export interface TableColumnProps {
14
14
  exportCell?: (data: any, index: number) => string;
15
15
  minWidth?: number;
16
16
  hidden?: boolean;
17
+ ellipsis?: boolean;
17
18
  cols?: number;
18
19
  rows?: number;
19
20
  prevVNode?: VNodeComponentClass<TableColumn> | null;
@@ -22,6 +22,7 @@ var typeDefs = {
22
22
  exportCell: Function,
23
23
  minWidth: Number,
24
24
  hidden: Boolean,
25
+ ellipsis: Boolean,
25
26
  // offset: null,
26
27
  cols: null,
27
28
  rows: null,
@@ -20,10 +20,11 @@ export interface TableRowProps {
20
20
  spreaded: boolean;
21
21
  hasChildren: boolean;
22
22
  indent: number;
23
- onToggleSpreadRow: (key: TableRowKey) => void;
23
+ onToggleSpreadRow: (key: TableRowKey, rowData?: any) => void;
24
24
  onBeforeUnmount: (key: TableRowKey) => void;
25
25
  offsetMap: Record<Key, number>;
26
26
  animation: boolean;
27
+ loaded: boolean;
27
28
  draggable: boolean;
28
29
  draggingKey: TableRowKey | null;
29
30
  onRowDragStart: DragCallback;
@@ -70,8 +70,9 @@ export var TableRow = /*#__PURE__*/function (_Component) {
70
70
  e.stopPropagation();
71
71
  var _this$get3 = this.get(),
72
72
  onToggleSpreadRow = _this$get3.onToggleSpreadRow,
73
- key = _this$get3.key;
74
- onToggleSpreadRow(key);
73
+ key = _this$get3.key,
74
+ data = _this$get3.data;
75
+ onToggleSpreadRow(key, data);
75
76
  };
76
77
  _proto.onMouseEnter = function onMouseEnter(e) {
77
78
  // for tooltip