@king-design/intact 3.4.0-beta.2 → 3.4.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 (84) hide show
  1. package/components/descriptions/.DS_Store +0 -0
  2. package/components/descriptions/demos/basic.md +47 -0
  3. package/components/descriptions/demos/custom.md +51 -0
  4. package/components/descriptions/demos/vertical.md +25 -0
  5. package/components/descriptions/descriptions.ts +42 -0
  6. package/components/descriptions/descriptions.vdt +31 -0
  7. package/components/descriptions/index.md +50 -0
  8. package/components/descriptions/index.spec.ts +0 -0
  9. package/components/descriptions/index.ts +2 -0
  10. package/components/descriptions/item.ts +31 -0
  11. package/components/descriptions/item.vdt +32 -0
  12. package/components/descriptions/styles.ts +83 -0
  13. package/components/icon/demos/icons.md +3 -0
  14. package/components/menu/.DS_Store +0 -0
  15. package/components/menu/demos/.DS_Store +0 -0
  16. package/components/switch/demos/beforeChange.md +6 -6
  17. package/components/switch/index.md +1 -1
  18. package/components/switch/index.spec.ts +8 -1
  19. package/components/switch/index.ts +6 -4
  20. package/components/switch/useDraggable.ts +2 -1
  21. package/components/table/column.ts +2 -0
  22. package/components/table/column.vdt +3 -4
  23. package/components/table/index.md +1 -0
  24. package/es/components/descriptions/descriptions.d.ts +20 -0
  25. package/es/components/descriptions/descriptions.js +34 -0
  26. package/es/components/descriptions/descriptions.vdt.js +40 -0
  27. package/es/components/descriptions/index.d.ts +2 -0
  28. package/es/components/descriptions/index.js +2 -0
  29. package/es/components/descriptions/index.spec.d.ts +1 -0
  30. package/es/components/descriptions/index.spec.js +1 -0
  31. package/es/components/descriptions/item.d.ts +17 -0
  32. package/es/components/descriptions/item.js +26 -0
  33. package/es/components/descriptions/item.vdt.js +44 -0
  34. package/es/components/descriptions/styles.d.ts +5 -0
  35. package/es/components/descriptions/styles.js +31 -0
  36. package/es/components/switch/index.d.ts +1 -1
  37. package/es/components/switch/index.js +17 -14
  38. package/es/components/switch/index.spec.js +21 -3
  39. package/es/components/switch/useDraggable.js +7 -4
  40. package/es/components/table/column.d.ts +1 -0
  41. package/es/components/table/column.js +1 -0
  42. package/es/components/table/column.vdt.js +6 -6
  43. package/es/index.d.ts +3 -2
  44. package/es/index.js +3 -2
  45. package/es/site/data/components/descriptions/demos/basic/index.d.ts +17 -0
  46. package/es/site/data/components/descriptions/demos/basic/index.js +32 -0
  47. package/es/site/data/components/descriptions/demos/basic/react.d.ts +16 -0
  48. package/es/site/data/components/descriptions/demos/basic/react.js +55 -0
  49. package/es/site/data/components/descriptions/demos/custom/index.d.ts +6 -0
  50. package/es/site/data/components/descriptions/demos/custom/index.js +14 -0
  51. package/es/site/data/components/descriptions/demos/custom/react.d.ts +5 -0
  52. package/es/site/data/components/descriptions/demos/custom/react.js +45 -0
  53. package/es/site/data/components/descriptions/demos/vertical/index.d.ts +6 -0
  54. package/es/site/data/components/descriptions/demos/vertical/index.js +14 -0
  55. package/es/site/data/components/descriptions/demos/vertical/react.d.ts +5 -0
  56. package/es/site/data/components/descriptions/demos/vertical/react.js +29 -0
  57. package/es/site/data/components/descriptions/index.d.ts +57 -0
  58. package/es/site/data/components/descriptions/index.js +32 -0
  59. package/es/site/data/components/icon/demos/icons/index.js +1 -1
  60. package/es/site/data/components/switch/demos/beforeChange/index.d.ts +3 -3
  61. package/es/site/data/components/switch/demos/beforeChange/index.js +5 -5
  62. package/es/site/data/components/switch/demos/beforeChange/react.d.ts +3 -3
  63. package/es/site/data/components/switch/demos/beforeChange/react.js +7 -5
  64. package/es/styles/fonts/iconfont.eot +0 -0
  65. package/es/styles/fonts/iconfont.js +1 -1
  66. package/es/styles/fonts/iconfont.svg +6 -0
  67. package/es/styles/fonts/iconfont.ttf +0 -0
  68. package/es/styles/fonts/iconfont.woff +0 -0
  69. package/es/styles/fonts/iconfont.woff2 +0 -0
  70. package/es/styles/theme.js +1 -1
  71. package/index.ts +3 -2
  72. package/package.json +1 -1
  73. package/styles/.DS_Store +0 -0
  74. package/styles/fonts/demo_index.html +75 -6
  75. package/styles/fonts/iconfont.css +18 -6
  76. package/styles/fonts/iconfont.eot +0 -0
  77. package/styles/fonts/iconfont.js +1 -1
  78. package/styles/fonts/iconfont.json +21 -0
  79. package/styles/fonts/iconfont.svg +6 -0
  80. package/styles/fonts/iconfont.ts +13 -1
  81. package/styles/fonts/iconfont.ttf +0 -0
  82. package/styles/fonts/iconfont.woff +0 -0
  83. package/styles/fonts/iconfont.woff2 +0 -0
  84. package/styles/theme.ts +1 -1
@@ -0,0 +1,40 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, map as _$ma, createUnknownComponentVNode as _$cc } from 'intact';
3
+ import { DescriptionItem } from './item';
4
+ import { makeStyles } from './styles';
5
+ import { getRestProps } from '../utils';
6
+ export default function ($props, $blocks, $__proto__) {
7
+ var _classNameObj;
8
+ $blocks || ($blocks = {});
9
+ $props || ($props = {});
10
+ var $this = this;
11
+ var _$blocks = {};
12
+ var __$blocks = {};
13
+ var _this$get = this.get(),
14
+ children = _this$get.children,
15
+ className = _this$get.className,
16
+ columns = _this$get.columns,
17
+ title = _this$get.title,
18
+ vertical = _this$get.vertical,
19
+ items = _this$get.items;
20
+ var k = this.config.k;
21
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-descriptions"] = true, _classNameObj[k + "-vertical"] = vertical, _classNameObj[className] = className, _classNameObj[makeStyles(k, columns)] = true, _classNameObj);
22
+ return _$cv('div', _extends({}, getRestProps(this), {
23
+ 'className': _$cn(classNameObj)
24
+ }), [$blocks.title || title ? _$ce(2, 'div', (_$blocks['title'] = function ($super) {
25
+ return title ? title : undefined;
26
+ }, __$blocks['title'] = function ($super, data) {
27
+ var block = $blocks['title'];
28
+ var callBlock = function callBlock() {
29
+ return _$blocks['title'].call($this, $super, data);
30
+ };
31
+ return block ? block.call($this, callBlock, data) : callBlock();
32
+ }, __$blocks['title'](_$no)), 0, _$cn(k + "-descriptions-title")) : undefined, _$ce(2, 'div', items ? _$ma(items, function ($value, $key) {
33
+ return _$cc(DescriptionItem, {
34
+ 'label': $value.label,
35
+ 'content': $value.content,
36
+ 'append': $value.append
37
+ });
38
+ }, $this) : children, 0, _$cn(k + "-descriptions-content"))]);
39
+ }
40
+ ;
@@ -0,0 +1,2 @@
1
+ export * from './descriptions';
2
+ export * from './item';
@@ -0,0 +1,2 @@
1
+ export * from './descriptions';
2
+ export * from './item';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,17 @@
1
+ import { Component, TypeDefs, VNode } from "intact";
2
+ export interface DescriptionItemProps {
3
+ label?: string | number | VNode;
4
+ content?: string | number | VNode;
5
+ append?: string | number | VNode;
6
+ }
7
+ export interface DescriptionItemBlocks {
8
+ append: null;
9
+ label: null;
10
+ }
11
+ export interface DescriptionItemEvents {
12
+ }
13
+ export declare class DescriptionItem extends Component<DescriptionItemProps, DescriptionItemEvents, DescriptionItemBlocks> {
14
+ static template: string | import("intact").Template<any>;
15
+ static typeDefs: Required<TypeDefs<DescriptionItemProps>>;
16
+ private config;
17
+ }
@@ -0,0 +1,26 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import { Component, VNode } from "intact";
4
+ import template from './item.vdt';
5
+ import { useConfigContext } from '../config';
6
+ var typeDefs = {
7
+ label: [String, Number, VNode],
8
+ content: [String, Number, VNode],
9
+ append: [String, Number, VNode]
10
+ };
11
+ export var DescriptionItem = /*#__PURE__*/function (_Component) {
12
+ _inheritsLoose(DescriptionItem, _Component);
13
+ function DescriptionItem() {
14
+ var _context;
15
+ var _this;
16
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17
+ args[_key] = arguments[_key];
18
+ }
19
+ _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
20
+ _this.config = useConfigContext();
21
+ return _this;
22
+ }
23
+ return DescriptionItem;
24
+ }(Component);
25
+ DescriptionItem.template = template;
26
+ DescriptionItem.typeDefs = typeDefs;
@@ -0,0 +1,44 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, createUnknownComponentVNode as _$cc } from 'intact';
3
+ import { makeStyles } from './styles';
4
+ import { getRestProps } from '../utils';
5
+ import { Ellipsis } from '../ellipsis';
6
+ export default function ($props, $blocks, $__proto__) {
7
+ var _classNameObj;
8
+ $blocks || ($blocks = {});
9
+ $props || ($props = {});
10
+ var $this = this;
11
+ var _$blocks = {};
12
+ var __$blocks = {};
13
+ var _this$get = this.get(),
14
+ children = _this$get.children,
15
+ className = _this$get.className,
16
+ span = _this$get.span,
17
+ label = _this$get.label,
18
+ content = _this$get.content,
19
+ append = _this$get.append;
20
+ var k = this.config.k;
21
+ var classNameObj = (_classNameObj = {}, _classNameObj[k + "-description-item"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
22
+ return _$cv('div', _extends({}, getRestProps(this), {
23
+ 'className': _$cn(classNameObj)
24
+ }), [_$ce(2, 'div', (_$blocks['label'] = function ($super) {
25
+ return label ? label : undefined;
26
+ }, __$blocks['label'] = function ($super, data) {
27
+ var block = $blocks['label'];
28
+ var callBlock = function callBlock() {
29
+ return _$blocks['label'].call($this, $super, data);
30
+ };
31
+ return block ? block.call($this, callBlock, data) : callBlock();
32
+ }, __$blocks['label'](_$no)), 0, _$cn(k + "-description-item-label")), _$ce(2, 'div', [_$cc(Ellipsis, {
33
+ 'children': content || children
34
+ }), $blocks.append || append ? _$ce(2, 'div', (_$blocks['append'] = function ($super) {
35
+ return append ? append : undefined;
36
+ }, __$blocks['append'] = function ($super, data) {
37
+ var block = $blocks['append'];
38
+ var callBlock = function callBlock() {
39
+ return _$blocks['append'].call($this, $super, data);
40
+ };
41
+ return block ? block.call($this, callBlock, data) : callBlock();
42
+ }, __$blocks['append'](_$no)), 0, _$cn(k + "-description-option")) : undefined], 0, _$cn(k + "-description-centent"))]);
43
+ }
44
+ ;
@@ -0,0 +1,5 @@
1
+ import '../../styles/global';
2
+ export declare const makeStyles: {
3
+ (k: string, column: number): string;
4
+ clearCache(): {};
5
+ };
@@ -0,0 +1,31 @@
1
+ import { css } from '@emotion/css';
2
+ import { theme, setDefault } from '../../styles/theme';
3
+ import { deepDefaults } from '../../styles/utils';
4
+ import '../../styles/global';
5
+ import { cache } from '../utils';
6
+ var defaults = {
7
+ title: {
8
+ get color() {
9
+ return theme.color.title;
10
+ },
11
+ weight: 500,
12
+ size: '14px'
13
+ },
14
+ label: {
15
+ get color() {
16
+ return theme.color.lightBlack;
17
+ },
18
+ padding: '0 16px 0 0'
19
+ }
20
+ };
21
+ var descriptions;
22
+ setDefault(function () {
23
+ descriptions = deepDefaults(theme, {
24
+ descriptions: defaults
25
+ }).descriptions;
26
+ makeStyles == null || makeStyles.clearCache();
27
+ });
28
+ export var makeStyles = cache(function makeStyles(k, column) {
29
+ var itemWidth = 100 / column + "%";
30
+ return /*#__PURE__*/css("&.", k, "-vertical{.", k, "-description-item{display:flex;flex-direction:column;align-items:baseline;.", k, "-description-centent{width:auto;}}}.", k, "-descriptions-title{color:", descriptions.title.color, ";font-weight:", descriptions.title.weight, ";font-size:", descriptions.title.size, ";display:flex;align-items:center;}.", k, "-descriptions-content{display:flex;flex-wrap:wrap;padding-top:16px;}.", k, "-description-item{display:flex;align-items:center;padding-bottom:16px;flex:0 0 ", itemWidth, ";width:", itemWidth, ";}.", k, "-description-centent{display:flex;align-items:center;max-width:60%;}.", k, "-description-item-label{color:", descriptions.label.color, ";padding:", descriptions.label.padding, ";display:flex;align-items:center;}.", k, "-description-option{display:inline-block;margin-left:8px;line-height:0px;}");
31
+ });
@@ -13,7 +13,7 @@ export interface SwitchProps<True = any, False = any> {
13
13
  size?: Sizes;
14
14
  disabled?: boolean;
15
15
  loading?: boolean;
16
- beforeChange?: (value: True | False | undefined) => boolean | Promise<boolean>;
16
+ beforeChange?: (from: True | False | undefined, to: True | False | undefined) => boolean | Promise<boolean>;
17
17
  }
18
18
  export interface SwitchEvents {
19
19
  click: [MouseEvent];
@@ -59,7 +59,9 @@ export var Switch = /*#__PURE__*/function (_Component) {
59
59
  };
60
60
  _proto.onClickOnHandle = function onClickOnHandle(e) {
61
61
  // we can not stop propagation, otherwise the click can not be listen at outer
62
- e._switchIgnore = true;
62
+ var _this$get = this.get(),
63
+ beforeChange = _this$get.beforeChange;
64
+ e._switchIgnore = !beforeChange;
63
65
  };
64
66
  _proto.onKeypress = function onKeypress(e) {
65
67
  this.trigger('keypress', e);
@@ -69,11 +71,11 @@ export var Switch = /*#__PURE__*/function (_Component) {
69
71
  };
70
72
  _proto.toggle = /*#__PURE__*/function () {
71
73
  var _toggle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(isKeypress) {
72
- var _this$get, disabled, beforeChange, value, ret;
74
+ var _this$get2, disabled, beforeChange, value, trueValue, falseValue, toValue, ret;
73
75
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
74
76
  while (1) switch (_context2.prev = _context2.next) {
75
77
  case 0:
76
- _this$get = this.get(), disabled = _this$get.disabled, beforeChange = _this$get.beforeChange, value = _this$get.value;
78
+ _this$get2 = this.get(), disabled = _this$get2.disabled, beforeChange = _this$get2.beforeChange, value = _this$get2.value, trueValue = _this$get2.trueValue, falseValue = _this$get2.falseValue;
77
79
  if (!disabled) {
78
80
  _context2.next = 3;
79
81
  break;
@@ -85,7 +87,7 @@ export var Switch = /*#__PURE__*/function (_Component) {
85
87
  this.elementRef.value.blur();
86
88
  }
87
89
  if (!beforeChange) {
88
- _context2.next = 15;
90
+ _context2.next = 16;
89
91
  break;
90
92
  }
91
93
  this.set({
@@ -93,33 +95,34 @@ export var Switch = /*#__PURE__*/function (_Component) {
93
95
  loading: true
94
96
  });
95
97
  _context2.prev = 6;
96
- _context2.next = 9;
97
- return beforeChange(value);
98
- case 9:
98
+ toValue = this.isChecked() ? falseValue : trueValue;
99
+ _context2.next = 10;
100
+ return beforeChange(value, toValue);
101
+ case 10:
99
102
  ret = _context2.sent;
100
103
  if (ret) {
101
- _context2.next = 12;
104
+ _context2.next = 13;
102
105
  break;
103
106
  }
104
107
  return _context2.abrupt("return");
105
- case 12:
106
- _context2.prev = 12;
108
+ case 13:
109
+ _context2.prev = 13;
107
110
  this.set({
108
111
  disabled: false,
109
112
  loading: false
110
113
  });
111
- return _context2.finish(12);
112
- case 15:
114
+ return _context2.finish(13);
115
+ case 16:
113
116
  if (this.isChecked()) {
114
117
  this.uncheck();
115
118
  } else {
116
119
  this.check();
117
120
  }
118
- case 16:
121
+ case 17:
119
122
  case "end":
120
123
  return _context2.stop();
121
124
  }
122
- }, _callee, this, [[6,, 12, 15]]);
125
+ }, _callee, this, [[6,, 13, 16]]);
123
126
  }));
124
127
  function toggle(_x) {
125
128
  return _toggle.apply(this, arguments);
@@ -241,7 +241,7 @@ describe('Switch', function () {
241
241
  }, _callee6);
242
242
  })));
243
243
  it('beforeChange', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
244
- var _mount7, instance, element, _element$querySelecto5, el1, el2;
244
+ var _mount7, instance, element, _element$querySelecto5, el1, el2, _element$querySelecto6, dragg1, dragg2;
245
245
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
246
246
  while (1) switch (_context7.prev = _context7.next) {
247
247
  case 0:
@@ -252,9 +252,27 @@ describe('Switch', function () {
252
252
  _context7.next = 6;
253
253
  return wait(1000);
254
254
  case 6:
255
- expect(instance.get('value1')).to.be.true;
255
+ expect(instance.get('value1')).eql(1);
256
256
  expect(instance.get('value2')).to.be.false;
257
- case 8:
257
+ _context7.next = 10;
258
+ return wait();
259
+ case 10:
260
+ _element$querySelecto6 = element.querySelectorAll('.k-switch-handle'), dragg1 = _element$querySelecto6[0], dragg2 = _element$querySelecto6[1];
261
+ dispatchEvent(dragg2, 'mousedown', {
262
+ which: 1,
263
+ clientX: 0
264
+ });
265
+ dispatchEvent(document, 'mousemove', {
266
+ clientX: 30
267
+ });
268
+ dispatchEvent(document, 'mouseup', {
269
+ clientX: 30
270
+ });
271
+ _context7.next = 16;
272
+ return wait();
273
+ case 16:
274
+ expect(instance.get('value2')).to.be.false;
275
+ case 17:
258
276
  case "end":
259
277
  return _context7.stop();
260
278
  }
@@ -10,7 +10,10 @@ export function useDraggable(elementRef) {
10
10
  var width;
11
11
  var maxWidth;
12
12
  function onStart(e) {
13
- if (instance.get('disabled')) return;
13
+ var _instance$get = instance.get(),
14
+ disabled = _instance$get.disabled,
15
+ beforeChange = _instance$get.beforeChange;
16
+ if (disabled || beforeChange) return;
14
17
  x = e.clientX;
15
18
  height = barRef.value.clientHeight;
16
19
  width = barRef.value.clientWidth;
@@ -39,9 +42,9 @@ export function useDraggable(elementRef) {
39
42
  } else if (percent < 0.5) {
40
43
  instance.uncheck();
41
44
  }
42
- var _instance$get = instance.get(),
43
- _width = _instance$get.width,
44
- _height = _instance$get.height;
45
+ var _instance$get2 = instance.get(),
46
+ _width = _instance$get2.width,
47
+ _height = _instance$get2.height;
45
48
  if (!instance.isChecked() && _width && _height) {
46
49
  barWidth.set(+_height);
47
50
  } else {
@@ -5,6 +5,7 @@ export interface TableColumnProps {
5
5
  sortable?: boolean;
6
6
  width?: string | number;
7
7
  group?: TableColumnGroupItem[];
8
+ hideGroupHeader?: boolean;
8
9
  multiple?: boolean;
9
10
  ignore?: boolean;
10
11
  fixed?: 'left' | 'right';
@@ -13,6 +13,7 @@ var typeDefs = {
13
13
  sortable: Boolean,
14
14
  width: [String, Number],
15
15
  group: Array,
16
+ hideGroupHeader: Boolean,
16
17
  multiple: Boolean,
17
18
  ignore: Boolean,
18
19
  fixed: ['left', 'right'],
@@ -33,7 +33,8 @@ export default function ($props, $blocks, $__proto__) {
33
33
  sortable = _this$get.sortable,
34
34
  cols = _this$get.cols,
35
35
  rows = _this$get.rows,
36
- hidden = _this$get.hidden;
36
+ hidden = _this$get.hidden,
37
+ hideGroupHeader = _this$get.hideGroupHeader;
37
38
  var _this$group = this.group,
38
39
  onSelect = _this$group.onSelect,
39
40
  isChecked = _this$group.isChecked,
@@ -87,8 +88,8 @@ export default function ($props, $blocks, $__proto__) {
87
88
  return block ? block.call($this, callBlock, data) : callBlock();
88
89
  }, __$blocks['title'](_$no)), 0, _$cn(k + "-table-title-text c-ellipsis")), group ? _$cc(Dropdown, {
89
90
  'position': {
90
- my: 'center top',
91
- at: 'center bottom+5',
91
+ my: 'left top',
92
+ at: 'left bottom+5',
92
93
  collision: 'flipfit'
93
94
  },
94
95
  'key': 'dropdown',
@@ -104,7 +105,7 @@ export default function ($props, $blocks, $__proto__) {
104
105
  'color': isEmptyValue(groupValue) ? null : 'primary'
105
106
  }), _$cc(DropdownMenu, {
106
107
  'className': _$cn((_$cn2 = {}, _$cn2[k + "-table-group-dropdown"] = true, _$cn2[makeGroupMenuStyles(k)] = true, _$cn2)),
107
- 'children': [_$ce(2, 'div', _$cc(Input, {
108
+ 'children': [!hideGroupHeader ? _$ce(2, 'div', _$cc(Input, {
108
109
  'size': 'small',
109
110
  'fluid': true,
110
111
  'placeholder': _$('请输入关键字'),
@@ -126,7 +127,7 @@ export default function ($props, $blocks, $__proto__) {
126
127
  return block ? block.call($this, callBlock, data) : callBlock();
127
128
  }), __$blocks;
128
129
  }.call($this, _$em)
129
- }), 2, _$cn(k + "-table-group-header")), _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
130
+ }), 2, _$cn(k + "-table-group-header")) : undefined, _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
130
131
  var _$cn3;
131
132
  return _$cc(DropdownItem, {
132
133
  'ev-select': function evSelect() {
@@ -147,7 +148,6 @@ export default function ($props, $blocks, $__proto__) {
147
148
  }), _$cc(Button, {
148
149
  'size': 'small',
149
150
  'disabled': isEmptyValue(localGroupValue.value),
150
- 'type': 'secondary',
151
151
  'ev-click': function evClick() {
152
152
  return reset(onChange);
153
153
  },
package/es/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.4.0-beta.2
2
+ * @king-design v3.4.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -23,6 +23,7 @@ export * from './components/colorpicker';
23
23
  export * from './components/config';
24
24
  export * from './components/copy';
25
25
  export * from './components/datepicker';
26
+ export * from './components/descriptions';
26
27
  export * from './components/dialog';
27
28
  export * from './components/divider';
28
29
  export * from './components/drawer';
@@ -63,4 +64,4 @@ export * from './components/treeSelect';
63
64
  export * from './components/upload';
64
65
  export * from './components/view';
65
66
  export * from './components/wave';
66
- export declare const version = "3.4.0-beta.2";
67
+ export declare const version = "3.4.2";
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.4.0-beta.2
2
+ * @king-design v3.4.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -24,6 +24,7 @@ export * from './components/colorpicker';
24
24
  export * from './components/config';
25
25
  export * from './components/copy';
26
26
  export * from './components/datepicker';
27
+ export * from './components/descriptions';
27
28
  export * from './components/dialog';
28
29
  export * from './components/divider';
29
30
  export * from './components/drawer';
@@ -64,5 +65,5 @@ export * from './components/treeSelect';
64
65
  export * from './components/upload';
65
66
  export * from './components/view';
66
67
  export * from './components/wave';
67
- export var version = '3.4.0-beta.2';
68
+ export var version = '3.4.2';
68
69
  /* generate end */
@@ -0,0 +1,17 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ import './index.styl';
4
+ export default class extends Component {
5
+ static template: string | import("intact").Template<any>;
6
+ static defaults(): {
7
+ items: ({
8
+ label: string;
9
+ content: string;
10
+ append?: undefined;
11
+ } | {
12
+ label: string;
13
+ content: string;
14
+ append: string;
15
+ })[];
16
+ };
17
+ }
@@ -0,0 +1,32 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ export { default as data } from './index.json';
3
+ import { Component } from 'intact';
4
+ import template from './index.vdt';
5
+ import './index.styl';
6
+ var default_1 = /*#__PURE__*/function (_Component) {
7
+ _inheritsLoose(default_1, _Component);
8
+ function default_1() {
9
+ return _Component.apply(this, arguments) || this;
10
+ }
11
+ default_1.defaults = function defaults() {
12
+ return {
13
+ items: [{
14
+ label: 'label1',
15
+ content: '测试1'
16
+ }, {
17
+ label: 'label2',
18
+ content: '测试测试'
19
+ }, {
20
+ label: 'label3',
21
+ content: '测试3'
22
+ }, {
23
+ label: 'label4',
24
+ content: '测试4',
25
+ append: 'option'
26
+ }]
27
+ };
28
+ };
29
+ return default_1;
30
+ }(Component);
31
+ default_1.template = template;
32
+ export { default_1 as default };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ state: {
5
+ items: ({
6
+ label: string;
7
+ content: string;
8
+ append?: undefined;
9
+ } | {
10
+ label: string;
11
+ content: string;
12
+ append: string;
13
+ })[];
14
+ };
15
+ render(): React.JSX.Element;
16
+ }
@@ -0,0 +1,55 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
3
+ import React from 'react';
4
+ import { Descriptions, DescriptionItem } from '@king-design/react';
5
+ import './index.styl';
6
+ var Demo = /*#__PURE__*/function (_React$Component) {
7
+ _inheritsLoose(Demo, _React$Component);
8
+ function Demo() {
9
+ var _context;
10
+ var _this;
11
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12
+ args[_key] = arguments[_key];
13
+ }
14
+ _this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
15
+ _this.state = {
16
+ items: [{
17
+ label: 'label1',
18
+ content: '测试1'
19
+ }, {
20
+ label: 'label2',
21
+ content: '测试测试'
22
+ }, {
23
+ label: 'label3',
24
+ content: '测试3'
25
+ }, {
26
+ label: 'label4',
27
+ content: '测试4',
28
+ append: 'option'
29
+ }]
30
+ };
31
+ return _this;
32
+ }
33
+ var _proto = Demo.prototype;
34
+ _proto.render = function render() {
35
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Descriptions, {
36
+ title: "\u57FA\u7840\u4FE1\u606F",
37
+ items: this.state.items,
38
+ columns: 4
39
+ }), /*#__PURE__*/React.createElement(Descriptions, {
40
+ title: "\u57FA\u7840\u4FE1\u606F"
41
+ }, /*#__PURE__*/React.createElement(DescriptionItem, {
42
+ label: "\u6D4B\u8BD51"
43
+ }, "\u6D4B\u8BD51"), /*#__PURE__*/React.createElement(DescriptionItem, {
44
+ label: "\u6D4B\u8BD52"
45
+ }, "\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F\u6D4B\u8BD5\u8D85\u957F"), /*#__PURE__*/React.createElement(DescriptionItem, {
46
+ label: "\u6D4B\u8BD53"
47
+ }, "\u6D4B\u8BD53"), /*#__PURE__*/React.createElement(DescriptionItem, {
48
+ label: "\u6D4B\u8BD54"
49
+ }, "\u6D4B\u8BD54"), /*#__PURE__*/React.createElement(DescriptionItem, {
50
+ label: "\u6D4B\u8BD55"
51
+ }, "\u6D4B\u8BD55")));
52
+ };
53
+ return Demo;
54
+ }(React.Component);
55
+ export { Demo as default };
@@ -0,0 +1,6 @@
1
+ export { default as data } from './index.json';
2
+ import { Component } from 'intact';
3
+ import './index.styl';
4
+ export default class extends Component {
5
+ static template: string | import("intact").Template<any>;
6
+ }
@@ -0,0 +1,14 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ export { default as data } from './index.json';
3
+ import { Component } from 'intact';
4
+ import template from './index.vdt';
5
+ import './index.styl';
6
+ var default_1 = /*#__PURE__*/function (_Component) {
7
+ _inheritsLoose(default_1, _Component);
8
+ function default_1() {
9
+ return _Component.apply(this, arguments) || this;
10
+ }
11
+ return default_1;
12
+ }(Component);
13
+ default_1.template = template;
14
+ export { default_1 as default };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.styl';
3
+ export default class Demo extends React.Component {
4
+ render(): React.JSX.Element;
5
+ }
@@ -0,0 +1,45 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import React from 'react';
3
+ import { Descriptions, DescriptionItem, Copy, Button, Tooltip, Icon } from '@king-design/react';
4
+ import './index.styl';
5
+ var Demo = /*#__PURE__*/function (_React$Component) {
6
+ _inheritsLoose(Demo, _React$Component);
7
+ function Demo() {
8
+ return _React$Component.apply(this, arguments) || this;
9
+ }
10
+ var _proto = Demo.prototype;
11
+ _proto.render = function render() {
12
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Descriptions, {
13
+ title: "\u57FA\u7840\u4FE1\u606F",
14
+ slotTitle: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "\u81EA\u5B9A\u4E49\u6807\u9898"), /*#__PURE__*/React.createElement(Tooltip, {
15
+ content: "custom title"
16
+ }, /*#__PURE__*/React.createElement(Icon, {
17
+ className: "k-icon-question"
18
+ })))
19
+ }, /*#__PURE__*/React.createElement(DescriptionItem, {
20
+ label: "label1",
21
+ slotAppend: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Copy, {
22
+ text: "success"
23
+ }))
24
+ }, "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(DescriptionItem, {
25
+ label: "label2"
26
+ }, "\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(DescriptionItem, {
27
+ label: "label3",
28
+ slotLabel: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "\u81EA\u5B9A\u4E49label"), /*#__PURE__*/React.createElement(Tooltip, {
29
+ content: "custom label"
30
+ }, /*#__PURE__*/React.createElement(Icon, {
31
+ className: "k-icon-question"
32
+ })))
33
+ }, "\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(DescriptionItem, {
34
+ label: "label4"
35
+ }, /*#__PURE__*/React.createElement("span", null, "\u6D4B\u8BD54"), /*#__PURE__*/React.createElement(Button, {
36
+ type: "link"
37
+ }, "\u5206\u914D\u9879\u76EE")), /*#__PURE__*/React.createElement(DescriptionItem, {
38
+ label: "label5"
39
+ }, "\u6D4B\u8BD55"), /*#__PURE__*/React.createElement(DescriptionItem, {
40
+ label: "label6"
41
+ }, "\u6D4B\u8BD56")));
42
+ };
43
+ return Demo;
44
+ }(React.Component);
45
+ export { Demo as default };