@king-design/react 2.1.0 → 2.1.1
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.
- package/__tests__/__snapshots__/React Demos.md +102 -10
- package/components/dropdown/dropdown.d.ts +6 -5
- package/components/dropdown/dropdown.js +40 -68
- package/components/dropdown/index.spec.js +96 -17
- package/components/dropdown/item.d.ts +1 -1
- package/components/dropdown/item.js +16 -4
- package/components/dropdown/usePosition.js +4 -2
- package/components/menu/index.spec.js +26 -15
- package/components/menu/item.d.ts +2 -0
- package/components/menu/item.js +5 -0
- package/components/pagination/index.js +4 -1
- package/components/pagination/index.spec.js +49 -0
- package/components/tooltip/content.d.ts +1 -0
- package/components/tooltip/content.js +18 -1
- package/components/tooltip/content.vdt.js +3 -1
- package/components/tooltip/index.spec.js +108 -0
- package/components/tooltip/styles.d.ts +22 -0
- package/components/tooltip/styles.js +1 -1
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +11 -0
- package/components/virtual.d.ts +8 -0
- package/components/virtual.js +126 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
4
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
5
|
import BasicDemo from '~/components/pagination/demos/basic';
|
|
4
6
|
import GotoDemo from '~/components/pagination/demos/goto';
|
|
5
7
|
import CurrentDemo from '~/components/pagination/demos/current';
|
|
6
8
|
import DisableDemo from '~/components/pagination/demos/disable';
|
|
7
9
|
import { mount, dispatchEvent, wait } from '../../test/utils';
|
|
10
|
+
import { Component } from 'intact-react';
|
|
11
|
+
import { Pagination } from '.';
|
|
8
12
|
describe('Pagination', function () {
|
|
9
13
|
// afterEach(() => unmount());
|
|
10
14
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -167,4 +171,49 @@ describe('Pagination', function () {
|
|
|
167
171
|
}
|
|
168
172
|
}, _callee4);
|
|
169
173
|
})));
|
|
174
|
+
it('should not set value to 0 when total is 0 on intialization', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
175
|
+
var Demo, _mount5, instance;
|
|
176
|
+
|
|
177
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
178
|
+
while (1) {
|
|
179
|
+
switch (_context6.prev = _context6.next) {
|
|
180
|
+
case 0:
|
|
181
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
182
|
+
_inheritsLoose(Demo, _Component);
|
|
183
|
+
|
|
184
|
+
function Demo() {
|
|
185
|
+
var _context5;
|
|
186
|
+
|
|
187
|
+
var _this;
|
|
188
|
+
|
|
189
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
190
|
+
args[_key] = arguments[_key];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context5 = [this]).call(_context5, args)) || this;
|
|
194
|
+
_this.Pagination = Pagination;
|
|
195
|
+
return _this;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
Demo.defaults = function defaults() {
|
|
199
|
+
return {
|
|
200
|
+
page: 1
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
return Demo;
|
|
205
|
+
}(Component);
|
|
206
|
+
|
|
207
|
+
Demo.template = "\n const { Pagination } = this;\n <Pagination total={0} v-model=\"page\" />\n ";
|
|
208
|
+
_mount5 = mount(Demo), instance = _mount5[0]; // await wait();
|
|
209
|
+
|
|
210
|
+
expect(instance.get('page')).to.eql(1);
|
|
211
|
+
|
|
212
|
+
case 4:
|
|
213
|
+
case "end":
|
|
214
|
+
return _context6.stop();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, _callee5);
|
|
218
|
+
})));
|
|
170
219
|
});
|
|
@@ -5,6 +5,7 @@ import { DropdownMenu } from '../dropdown/menu';
|
|
|
5
5
|
import template from './content.vdt';
|
|
6
6
|
import { bind } from '../utils';
|
|
7
7
|
import { useArrow } from './useArrow';
|
|
8
|
+
import { tooltip as tooltipTheme } from './styles';
|
|
8
9
|
export var TooltipContent = /*#__PURE__*/function (_DropdownMenu) {
|
|
9
10
|
_inheritsLoose(TooltipContent, _DropdownMenu);
|
|
10
11
|
|
|
@@ -35,10 +36,24 @@ export var TooltipContent = /*#__PURE__*/function (_DropdownMenu) {
|
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
_proto.onEnter = function onEnter() {
|
|
39
|
+
_proto.onEnter = function onEnter(elem) {
|
|
40
|
+
// fix the width, https://github.com/ksc-fe/kpc/issues/873
|
|
41
|
+
var maxWidth = parseInt(tooltipTheme.maxWidth);
|
|
42
|
+
var width = elem.offsetWidth;
|
|
43
|
+
|
|
44
|
+
if (width === maxWidth) {
|
|
45
|
+
elem.style.width = width + "px";
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
this.dropdown.position();
|
|
40
49
|
};
|
|
41
50
|
|
|
51
|
+
_proto.onAfterLeave = function onAfterLeave(elem) {
|
|
52
|
+
// remove the position after leave, https://github.com/ksc-fe/kpc/issues/873
|
|
53
|
+
var style = elem.style;
|
|
54
|
+
style.left = style.top = style.width = '';
|
|
55
|
+
};
|
|
56
|
+
|
|
42
57
|
_proto.onMouseEnter = function onMouseEnter(e) {
|
|
43
58
|
var dropdown = this.dropdown;
|
|
44
59
|
|
|
@@ -67,6 +82,8 @@ TooltipContent.template = template;
|
|
|
67
82
|
|
|
68
83
|
__decorate([bind], TooltipContent.prototype, "onEnter", null);
|
|
69
84
|
|
|
85
|
+
__decorate([bind], TooltipContent.prototype, "onAfterLeave", null);
|
|
86
|
+
|
|
70
87
|
__decorate([bind], TooltipContent.prototype, "onMouseEnter", null);
|
|
71
88
|
|
|
72
89
|
__decorate([bind], TooltipContent.prototype, "ok", null);
|
|
@@ -38,7 +38,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
38
38
|
'value': !!value && !this.isEmptyChildren,
|
|
39
39
|
'transition': {
|
|
40
40
|
name: 'k-fade',
|
|
41
|
-
onEnter: this.onEnter
|
|
41
|
+
onEnter: this.onEnter,
|
|
42
|
+
onAfterLeave: this.onAfterLeave,
|
|
43
|
+
onLeaveCancelled: this.onAfterLeave
|
|
42
44
|
},
|
|
43
45
|
'className': _$cn(classNameObj)
|
|
44
46
|
}, function ($blocks) {
|
|
@@ -12,7 +12,9 @@ import ContentDemo from '~/components/tooltip/demos/content';
|
|
|
12
12
|
import ConfirmDemo from '~/components/tooltip/demos/confirm';
|
|
13
13
|
import AlwaysDemo from '~/components/tooltip/demos/always';
|
|
14
14
|
import { Tooltip } from './';
|
|
15
|
+
import { Dialog } from '../dialog';
|
|
15
16
|
import { mount, unmount, dispatchEvent, getElement, wait } from '../../test/utils';
|
|
17
|
+
import { tooltip as tooltipTheme } from './styles';
|
|
16
18
|
describe('Tooltip', function () {
|
|
17
19
|
afterEach(function (done) {
|
|
18
20
|
unmount();
|
|
@@ -577,4 +579,110 @@ describe('Tooltip', function () {
|
|
|
577
579
|
}
|
|
578
580
|
}, _callee9);
|
|
579
581
|
})));
|
|
582
|
+
it('should add className', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
583
|
+
var Demo, _mount10, instance, element, trigger, dropdown;
|
|
584
|
+
|
|
585
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context13) {
|
|
586
|
+
while (1) {
|
|
587
|
+
switch (_context13.prev = _context13.next) {
|
|
588
|
+
case 0:
|
|
589
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
590
|
+
_inheritsLoose(Demo, _Component3);
|
|
591
|
+
|
|
592
|
+
function Demo() {
|
|
593
|
+
var _context12;
|
|
594
|
+
|
|
595
|
+
var _this3;
|
|
596
|
+
|
|
597
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
598
|
+
args[_key3] = arguments[_key3];
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context12 = [this]).call(_context12, args)) || this;
|
|
602
|
+
_this3.Tooltip = Tooltip;
|
|
603
|
+
return _this3;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
return Demo;
|
|
607
|
+
}(Component);
|
|
608
|
+
|
|
609
|
+
Demo.template = "\n const Tooltip = this.Tooltip;\n <div>\n <Tooltip content=\"hello\" class=\"a\">\n <div ref=\"test\" class=\"b\">test</div>\n </Tooltip>\n </div>\n ";
|
|
610
|
+
_mount10 = mount(Demo), instance = _mount10[0], element = _mount10[1];
|
|
611
|
+
trigger = instance.refs.test;
|
|
612
|
+
expect(trigger.className).to.eql('b a');
|
|
613
|
+
dispatchEvent(trigger, 'mouseenter');
|
|
614
|
+
_context13.next = 8;
|
|
615
|
+
return wait();
|
|
616
|
+
|
|
617
|
+
case 8:
|
|
618
|
+
dropdown = getElement('.k-tooltip-content');
|
|
619
|
+
expect(dropdown.classList.contains('a')).to.be.true;
|
|
620
|
+
|
|
621
|
+
case 10:
|
|
622
|
+
case "end":
|
|
623
|
+
return _context13.stop();
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}, _callee10);
|
|
627
|
+
})));
|
|
628
|
+
it('should fix the width in small container', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
629
|
+
var Demo, _mount11, instance, element, trigger, expecedWidth, content, width, newWidth;
|
|
630
|
+
|
|
631
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context15) {
|
|
632
|
+
while (1) {
|
|
633
|
+
switch (_context15.prev = _context15.next) {
|
|
634
|
+
case 0:
|
|
635
|
+
Demo = /*#__PURE__*/function (_Component4) {
|
|
636
|
+
_inheritsLoose(Demo, _Component4);
|
|
637
|
+
|
|
638
|
+
function Demo() {
|
|
639
|
+
var _context14;
|
|
640
|
+
|
|
641
|
+
var _this4;
|
|
642
|
+
|
|
643
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
644
|
+
args[_key4] = arguments[_key4];
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
_this4 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context14 = [this]).call(_context14, args)) || this;
|
|
648
|
+
_this4.Tooltip = Tooltip;
|
|
649
|
+
_this4.Dialog = Dialog;
|
|
650
|
+
return _this4;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return Demo;
|
|
654
|
+
}(Component);
|
|
655
|
+
|
|
656
|
+
Demo.template = "\n const {Tooltip, Dialog} = this;\n <div style=\"text-align: right; position: relative; width: 300px;\">\n <Tooltip content=\"\u8FD9\u662F\u4E00\u6BB5\u5F88\u957F\u7684\u63CF\u8FF0\u6587\u5B57\uFF0C\u8FD9\u662F\u4E00\u6BB5\u5F88\u957F\u7684\u63CF\u8FF0\u6587\u5B57\" container={dom => dom}>\n <span class=\"trigger\">test</span>\n </Tooltip>\n </div>\n ";
|
|
657
|
+
_mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
|
|
658
|
+
trigger = element.querySelector('.trigger');
|
|
659
|
+
expecedWidth = parseInt(tooltipTheme.maxWidth);
|
|
660
|
+
dispatchEvent(trigger, 'mouseenter');
|
|
661
|
+
_context15.next = 8;
|
|
662
|
+
return wait();
|
|
663
|
+
|
|
664
|
+
case 8:
|
|
665
|
+
content = getElement('.k-tooltip-content');
|
|
666
|
+
width = content.offsetWidth;
|
|
667
|
+
expect(width).to.eql(expecedWidth);
|
|
668
|
+
dispatchEvent(trigger, 'mouseleave');
|
|
669
|
+
_context15.next = 14;
|
|
670
|
+
return wait();
|
|
671
|
+
|
|
672
|
+
case 14:
|
|
673
|
+
dispatchEvent(trigger, 'mouseenter');
|
|
674
|
+
_context15.next = 17;
|
|
675
|
+
return wait();
|
|
676
|
+
|
|
677
|
+
case 17:
|
|
678
|
+
newWidth = content.offsetWidth;
|
|
679
|
+
expect(newWidth).to.eql(width);
|
|
680
|
+
|
|
681
|
+
case 19:
|
|
682
|
+
case "end":
|
|
683
|
+
return _context15.stop();
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}, _callee11);
|
|
687
|
+
})));
|
|
580
688
|
});
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
+
declare const defaults: {
|
|
3
|
+
padding: string;
|
|
4
|
+
readonly color: string;
|
|
5
|
+
bgColor: string;
|
|
6
|
+
lineHeight: number;
|
|
7
|
+
maxWidth: string;
|
|
8
|
+
arrow: {
|
|
9
|
+
borderColor: string;
|
|
10
|
+
width: string;
|
|
11
|
+
};
|
|
12
|
+
confirm: {
|
|
13
|
+
gaps: string;
|
|
14
|
+
};
|
|
15
|
+
dark: {
|
|
16
|
+
readonly bgColor: string;
|
|
17
|
+
color: string;
|
|
18
|
+
readonly arrowBorderColor: string;
|
|
19
|
+
};
|
|
20
|
+
smallPadding: string;
|
|
21
|
+
};
|
|
22
|
+
export declare let tooltip: typeof defaults;
|
|
2
23
|
export declare type Theme = 'dark' | 'light';
|
|
3
24
|
export declare const themes: Theme[];
|
|
4
25
|
export default function makeStyles(): string;
|
|
26
|
+
export {};
|
|
@@ -23,5 +23,6 @@ export declare class Tooltip<T extends TooltipProps = TooltipProps, E extends To
|
|
|
23
23
|
static typeDefs: Required<TypeDefs<TooltipProps>>;
|
|
24
24
|
static defaults: () => Partial<TooltipProps>;
|
|
25
25
|
static events: Events<TooltipEvents>;
|
|
26
|
+
show(shouldFocus?: boolean): void;
|
|
26
27
|
hide(immediately: boolean): void;
|
|
27
28
|
}
|
|
@@ -25,6 +25,7 @@ var defaults = function defaults() {
|
|
|
25
25
|
at: 'center top',
|
|
26
26
|
collision: 'flipfit'
|
|
27
27
|
},
|
|
28
|
+
collison: 'flipfit',
|
|
28
29
|
hoverable: false,
|
|
29
30
|
always: false,
|
|
30
31
|
confirm: false,
|
|
@@ -48,6 +49,16 @@ export var Tooltip = /*#__PURE__*/function (_Dropdown) {
|
|
|
48
49
|
|
|
49
50
|
var _proto = Tooltip.prototype;
|
|
50
51
|
|
|
52
|
+
_proto.show = function show(shouldFocus) {
|
|
53
|
+
if (shouldFocus === void 0) {
|
|
54
|
+
shouldFocus = false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (this.get('disabled')) return;
|
|
58
|
+
clearTimeout(this.timer);
|
|
59
|
+
this.set('value', true);
|
|
60
|
+
};
|
|
61
|
+
|
|
51
62
|
_proto.hide = function hide(immediately) {
|
|
52
63
|
if (this.get('always')) return;
|
|
53
64
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Component, VNode } from 'intact-react';
|
|
2
|
+
export declare class Virtual extends Component<any> {
|
|
3
|
+
static template(this: Virtual): VNode<import("intact").VNodeTag>;
|
|
4
|
+
private vNodeProps;
|
|
5
|
+
private getVNodeProps;
|
|
6
|
+
private getEventProps;
|
|
7
|
+
private callEvent;
|
|
8
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
4
|
+
var _excluded = ["children"];
|
|
5
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
6
|
+
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js/instance/starts-with";
|
|
7
|
+
import { Component, directClone, createVNode } from 'intact-react';
|
|
8
|
+
import { isTextChildren } from './utils';
|
|
9
|
+
import { EMPTY_OBJ, isFunction, hasOwn } from 'intact-shared';
|
|
10
|
+
import { cx } from '@emotion/css';
|
|
11
|
+
var reactEventReg = /on[A-Z]/;
|
|
12
|
+
export var Virtual = /*#__PURE__*/function (_Component) {
|
|
13
|
+
_inheritsLoose(Virtual, _Component);
|
|
14
|
+
|
|
15
|
+
function Virtual() {
|
|
16
|
+
var _context;
|
|
17
|
+
|
|
18
|
+
var _this;
|
|
19
|
+
|
|
20
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
|
+
args[_key] = arguments[_key];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
25
|
+
_this.vNodeProps = null;
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Virtual.template = function template() {
|
|
30
|
+
var _cx;
|
|
31
|
+
|
|
32
|
+
var _this$get = this.get(),
|
|
33
|
+
children = _this$get.children,
|
|
34
|
+
props = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
35
|
+
|
|
36
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
37
|
+
if (!children || Array.isArray(children) && children.length !== 1) {
|
|
38
|
+
throw new Error('Component must receive one children');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var vNode = Array.isArray(children) ? children[0] : children;
|
|
43
|
+
var clonedVNode = isTextChildren(vNode) ? createVNode('span', null, vNode) : directClone(vNode);
|
|
44
|
+
var vNodeProps = this.vNodeProps = this.getVNodeProps(clonedVNode.props || EMPTY_OBJ);
|
|
45
|
+
var eventProps = this.getEventProps(); // merge className
|
|
46
|
+
|
|
47
|
+
var className = clonedVNode.className || vNodeProps.className;
|
|
48
|
+
className = cx((_cx = {}, _cx[className] = !!className, _cx[props.className] = !!props.className, _cx));
|
|
49
|
+
clonedVNode.props = _extends({}, props, vNodeProps, eventProps, {
|
|
50
|
+
className: className
|
|
51
|
+
});
|
|
52
|
+
clonedVNode.className = className;
|
|
53
|
+
return clonedVNode;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var _proto = Virtual.prototype;
|
|
57
|
+
|
|
58
|
+
_proto.getVNodeProps = function getVNodeProps(props) {
|
|
59
|
+
var vnode = props.vnode;
|
|
60
|
+
if (!vnode) return props; // maybe we render the intact component in react slot property, in this case
|
|
61
|
+
// the $isReact is false. so use the vnode $$typeof field as gauge
|
|
62
|
+
|
|
63
|
+
if (vnode.$$typeof || vnode.__v_isVNode
|
|
64
|
+
/* vue3 vnode */
|
|
65
|
+
) {
|
|
66
|
+
var _props = vnode.props;
|
|
67
|
+
if (!_props) return props;
|
|
68
|
+
var events = {};
|
|
69
|
+
|
|
70
|
+
for (var key in _props) {
|
|
71
|
+
if (reactEventReg.test(key)) {
|
|
72
|
+
events["ev-" + key.substring(2).toLowerCase()] = _props[key];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return _extends({}, props, events, {
|
|
77
|
+
className: _props.className || _props.class
|
|
78
|
+
/* vue-next */
|
|
79
|
+
|
|
80
|
+
});
|
|
81
|
+
} else if (hasOwn.call(vnode, 'componentOptions')
|
|
82
|
+
/* vue2 vnode */
|
|
83
|
+
) {
|
|
84
|
+
var data = vnode.data;
|
|
85
|
+
var on = data && data.on || EMPTY_OBJ;
|
|
86
|
+
var _events = {};
|
|
87
|
+
|
|
88
|
+
for (var _key2 in on) {
|
|
89
|
+
_events["ev-" + _key2] = on[_key2];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return _extends({}, props, _events);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return props;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
_proto.getEventProps = function getEventProps() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
|
|
101
|
+
var props = {};
|
|
102
|
+
|
|
103
|
+
var _loop = function _loop(prop) {
|
|
104
|
+
if (_startsWithInstanceProperty(prop).call(prop, 'ev-')) {
|
|
105
|
+
props[prop] = function (e) {
|
|
106
|
+
return _this2.callEvent(prop, e);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
for (var prop in this.get()) {
|
|
112
|
+
_loop(prop);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return props;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
_proto.callEvent = function callEvent(name, e) {
|
|
119
|
+
var callback = this.vNodeProps[name];
|
|
120
|
+
var callbackOnVirtual = this.get(name);
|
|
121
|
+
if (isFunction(callback)) callback(e);
|
|
122
|
+
if (isFunction(callbackOnVirtual)) callbackOnVirtual(e);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return Virtual;
|
|
126
|
+
}(Component);
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -57,7 +57,7 @@ export * from './components/tree';
|
|
|
57
57
|
export * from './components/treeSelect';
|
|
58
58
|
export * from './components/upload';
|
|
59
59
|
export * from './components/wave';
|
|
60
|
-
export declare const version = "2.1.
|
|
60
|
+
export declare const version = "2.1.1";
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
export {normalize} from 'intact-react';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -59,7 +59,7 @@ export * from './components/tree';
|
|
|
59
59
|
export * from './components/treeSelect';
|
|
60
60
|
export * from './components/upload';
|
|
61
61
|
export * from './components/wave';
|
|
62
|
-
export var version = '2.1.
|
|
62
|
+
export var version = '2.1.1';
|
|
63
63
|
/* generate end */
|
|
64
64
|
|
|
65
65
|
export {normalize} from 'intact-react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "King-Design UI components for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dayjs": "^1.10.7",
|
|
38
38
|
"downloadjs": "^1.4.7",
|
|
39
39
|
"enquire.js": "^2.1.6",
|
|
40
|
-
"intact-react": "3.0.
|
|
40
|
+
"intact-react": "3.0.19",
|
|
41
41
|
"monaco-editor": "^0.26.1",
|
|
42
42
|
"mxgraphx": "^4.0.7",
|
|
43
43
|
"resize-observer-polyfill": "^1.5.1",
|