@king-design/intact 2.0.2 → 2.0.5
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/components/dropdown/dropdown.ts +5 -6
- package/components/portal.ts +1 -1
- package/components/skeleton/demos/animate.md +30 -0
- package/components/skeleton/demos/avator.md +30 -0
- package/components/skeleton/demos/basic.md +30 -0
- package/components/skeleton/demos/custom.md +39 -0
- package/components/skeleton/demos/rows.md +32 -0
- package/components/skeleton/index.md +24 -0
- package/components/skeleton/index.ts +2 -0
- package/components/skeleton/item.ts +30 -0
- package/components/skeleton/item.vdt +28 -0
- package/components/skeleton/skeleton.ts +33 -0
- package/components/skeleton/skeleton.vdt +32 -0
- package/components/skeleton/style.ts +105 -0
- package/components/table/cell.ts +4 -0
- package/components/table/demos/basic.md +8 -2
- package/components/table/index.spec.ts +38 -54
- package/components/table/useChecked.ts +1 -1
- package/components/tree/useFilter.ts +1 -2
- package/es/components/dropdown/dropdown.js +7 -7
- package/es/components/portal.js +1 -1
- package/es/components/skeleton/index.d.ts +2 -0
- package/es/components/skeleton/index.js +2 -0
- package/es/components/skeleton/item.d.ts +16 -0
- package/es/components/skeleton/item.js +26 -0
- package/es/components/skeleton/item.vdt.js +35 -0
- package/es/components/skeleton/skeleton.d.ts +17 -0
- package/es/components/skeleton/skeleton.js +30 -0
- package/es/components/skeleton/skeleton.vdt.js +37 -0
- package/es/components/skeleton/style.d.ts +6 -0
- package/es/components/skeleton/style.js +35 -0
- package/es/components/table/cell.js +5 -0
- package/es/components/table/index.spec.js +76 -52
- package/es/components/table/useChecked.js +1 -1
- package/es/components/tree/useFilter.js +1 -2
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/es/packages/kpc-react/__tests__/components/form.spec.d.ts +1 -0
- package/es/packages/kpc-react/__tests__/components/form.spec.js +46 -0
- package/es/site/data/components/skeleton/demos/animate/index.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/animate/index.js +23 -0
- package/es/site/data/components/skeleton/demos/animate/react.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/animate/react.js +38 -0
- package/es/site/data/components/skeleton/demos/avator/index.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/avator/index.js +23 -0
- package/es/site/data/components/skeleton/demos/avator/react.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/avator/react.js +37 -0
- package/es/site/data/components/skeleton/demos/basic/index.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/basic/index.js +23 -0
- package/es/site/data/components/skeleton/demos/basic/react.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/basic/react.js +36 -0
- package/es/site/data/components/skeleton/demos/custom/index.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/custom/index.js +23 -0
- package/es/site/data/components/skeleton/demos/custom/react.d.ts +11 -0
- package/es/site/data/components/skeleton/demos/custom/react.js +60 -0
- package/es/site/data/components/skeleton/demos/rows/index.d.ts +13 -0
- package/es/site/data/components/skeleton/demos/rows/index.js +24 -0
- package/es/site/data/components/skeleton/demos/rows/react.d.ts +13 -0
- package/es/site/data/components/skeleton/demos/rows/react.js +38 -0
- package/es/site/data/components/skeleton/index.d.ts +57 -0
- package/es/site/data/components/skeleton/index.js +42 -0
- package/es/site/data/components/table/demos/basic/react.js +8 -2
- package/es/site/src/components/footer/styles.js +1 -1
- package/es/site/src/pages/colorProcess/index.d.ts +21 -0
- package/es/site/src/pages/colorProcess/index.js +79 -0
- package/es/site/src/pages/colorProcess/style.d.ts +3 -0
- package/es/site/src/pages/colorProcess/style.js +53 -0
- package/es/site/src/pages/font/index.d.ts +12 -0
- package/es/site/src/pages/font/index.js +22 -0
- package/es/site/src/pages/font/styles.d.ts +1 -0
- package/es/site/src/pages/font/styles.js +9 -0
- package/es/site/src/pages/iframe/colorProcess/styles.js +2 -2
- package/es/site/src/pages/index/BestPractice/styles.js +1 -1
- package/es/site/src/pages/index/ColorProcess/styles.js +2 -2
- package/es/site/src/pages/index/KingVersion/styles.js +1 -1
- package/es/site/src/pages/index/NewFunction/index.d.ts +2 -0
- package/es/site/src/pages/index/NewFunction/index.js +8 -2
- package/es/site/src/pages/index/NewFunction/styles.js +1 -1
- package/es/site/src/pages/index/styles.js +2 -1
- package/es/site/src/pages/resource/index.d.ts +1 -0
- package/es/site/src/pages/resource/index.js +4 -1
- package/es/site/src/pages/styles.js +1 -1
- package/es/site/src/router/index.js +75 -5
- package/index.ts +3 -2
- package/package.json +7 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, TypeDefs } from 'intact';
|
|
2
|
+
declare type ItemType = 'text' | 'avator' | 'image' | 'button' | 'input';
|
|
3
|
+
export declare const ItemTypeMap: ItemType[];
|
|
4
|
+
export interface SkeletonItemProps {
|
|
5
|
+
type?: ItemType;
|
|
6
|
+
}
|
|
7
|
+
export interface SkeletonItemEvents {
|
|
8
|
+
}
|
|
9
|
+
export interface SkeletonItemBlocks {
|
|
10
|
+
}
|
|
11
|
+
export declare class SkeletonItem extends Component<SkeletonItemProps, SkeletonItemEvents, SkeletonItemBlocks> {
|
|
12
|
+
static template: string | import("intact").Template<any>;
|
|
13
|
+
static typeDefs: Required<TypeDefs<SkeletonItemProps>>;
|
|
14
|
+
static defaults: () => Partial<SkeletonItemProps>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import template from './item.vdt';
|
|
4
|
+
export var ItemTypeMap = ['text', 'avator', 'image', 'button', 'input'];
|
|
5
|
+
var typeDefs = {
|
|
6
|
+
type: ItemTypeMap
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
var defaults = function defaults() {
|
|
10
|
+
return {
|
|
11
|
+
type: 'text'
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export var SkeletonItem = /*#__PURE__*/function (_Component) {
|
|
16
|
+
_inheritsLoose(SkeletonItem, _Component);
|
|
17
|
+
|
|
18
|
+
function SkeletonItem() {
|
|
19
|
+
return _Component.apply(this, arguments) || this;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return SkeletonItem;
|
|
23
|
+
}(Component);
|
|
24
|
+
SkeletonItem.template = template;
|
|
25
|
+
SkeletonItem.typeDefs = typeDefs;
|
|
26
|
+
SkeletonItem.defaults = defaults;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact';
|
|
3
|
+
import { makeItemStyles } from './style';
|
|
4
|
+
import { getRestProps } from '../utils';
|
|
5
|
+
var _$tmp0 = {
|
|
6
|
+
'd': 'M64 896V128h896v768H64z m64-128l192-192 116.352 116.352L640 448l256 307.2V192H128v576z m224-480a96 96 0 1 1-0.064 192.064A96 96 0 0 1 352 288z'
|
|
7
|
+
};
|
|
8
|
+
var _$tmp1 = {
|
|
9
|
+
'viewBox': '0 0 1024 1024',
|
|
10
|
+
'xmlns': 'http://www.w3.org/2000/svg'
|
|
11
|
+
};
|
|
12
|
+
export default function ($props, $blocks, $__proto__) {
|
|
13
|
+
var _classNameObj, _ItemklsObj;
|
|
14
|
+
|
|
15
|
+
$blocks || ($blocks = {});
|
|
16
|
+
$props || ($props = {});
|
|
17
|
+
var $this = this;
|
|
18
|
+
|
|
19
|
+
var _this$get = this.get(),
|
|
20
|
+
type = _this$get.type;
|
|
21
|
+
|
|
22
|
+
var classNameObj = (_classNameObj = {
|
|
23
|
+
'k-skeleton-item': true
|
|
24
|
+
}, _classNameObj[makeItemStyles()] = true, _classNameObj);
|
|
25
|
+
var ItemklsObj = (_ItemklsObj = {
|
|
26
|
+
'k-skeleton-item-box': true
|
|
27
|
+
}, _ItemklsObj["skeleton-item-" + type] = true, _ItemklsObj);
|
|
28
|
+
|
|
29
|
+
var skeletonItem = _$cv('div', _extends({
|
|
30
|
+
'className': _$cn(ItemklsObj)
|
|
31
|
+
}, getRestProps(this)), type === 'image' ? _$ce(512, 'svg', _$ce(2, 'path', null, 1, null, _$tmp0), 2, null, _$tmp1) : undefined);
|
|
32
|
+
|
|
33
|
+
return _$ce(2, 'div', skeletonItem, 0, _$cn(classNameObj));
|
|
34
|
+
}
|
|
35
|
+
;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, TypeDefs } from 'intact';
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
animated?: boolean;
|
|
5
|
+
rows?: number;
|
|
6
|
+
avator?: boolean;
|
|
7
|
+
size?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SkeletonEvents {
|
|
10
|
+
}
|
|
11
|
+
export interface SkeletonBlocks {
|
|
12
|
+
}
|
|
13
|
+
export declare class Skeleton extends Component<SkeletonProps, SkeletonEvents, SkeletonBlocks> {
|
|
14
|
+
static template: string | import("intact").Template<any>;
|
|
15
|
+
static typeDefs: Required<TypeDefs<SkeletonProps>>;
|
|
16
|
+
static defaults: () => Partial<SkeletonProps>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import template from './skeleton.vdt';
|
|
4
|
+
var typeDefs = {
|
|
5
|
+
loading: Boolean,
|
|
6
|
+
animated: Boolean,
|
|
7
|
+
rows: Number,
|
|
8
|
+
avator: Boolean,
|
|
9
|
+
size: String
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var defaults = function defaults() {
|
|
13
|
+
return {
|
|
14
|
+
rows: 2,
|
|
15
|
+
size: 'large'
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export var Skeleton = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(Skeleton, _Component);
|
|
21
|
+
|
|
22
|
+
function Skeleton() {
|
|
23
|
+
return _Component.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return Skeleton;
|
|
27
|
+
}(Component);
|
|
28
|
+
Skeleton.template = template;
|
|
29
|
+
Skeleton.typeDefs = typeDefs;
|
|
30
|
+
Skeleton.defaults = defaults;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _fillInstanceProperty from "@babel/runtime-corejs3/core-js/instance/fill";
|
|
2
|
+
import { map as _$ma, createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn } from 'intact';
|
|
3
|
+
import { SkeletonItem } from './item';
|
|
4
|
+
import { makeStyles, kls } from './style';
|
|
5
|
+
var _$tmp0 = {
|
|
6
|
+
'type': 'avator'
|
|
7
|
+
};
|
|
8
|
+
export default function ($props, $blocks, $__proto__) {
|
|
9
|
+
var _context, _classNameObj;
|
|
10
|
+
|
|
11
|
+
$blocks || ($blocks = {});
|
|
12
|
+
$props || ($props = {});
|
|
13
|
+
var $this = this;
|
|
14
|
+
|
|
15
|
+
var _this$get = this.get(),
|
|
16
|
+
rows = _this$get.rows,
|
|
17
|
+
avator = _this$get.avator,
|
|
18
|
+
animated = _this$get.animated,
|
|
19
|
+
children = _this$get.children,
|
|
20
|
+
loading = _this$get.loading,
|
|
21
|
+
size = _this$get.size;
|
|
22
|
+
|
|
23
|
+
var targetRows = typeof rows !== 'number' ? 3 : rows < 1 ? 1 : parseInt(rows);
|
|
24
|
+
|
|
25
|
+
var skeletonList = _fillInstanceProperty(_context = Array(targetRows + 2)).call(_context);
|
|
26
|
+
|
|
27
|
+
var skeletonItems = _$ma(skeletonList, function ($value, $key) {
|
|
28
|
+
return _$cc(SkeletonItem);
|
|
29
|
+
}, $this);
|
|
30
|
+
|
|
31
|
+
var classNameObj = (_classNameObj = {
|
|
32
|
+
'k-skeleton': true,
|
|
33
|
+
'k-animated': animated
|
|
34
|
+
}, _classNameObj[makeStyles(size)] = true, _classNameObj);
|
|
35
|
+
return loading ? _$ce(2, 'div', children ? _$ce(2, 'div', children, 0) : avator ? _$ce(2, 'div', [_$cc(SkeletonItem, _$tmp0), _$ce(2, 'div', skeletonItems, 0, 'k-skeleton-items')], 4, _$cn(kls('avator-box'))) : _$ce(2, 'div', skeletonItems, 0, 'k-skeleton-items'), 2, _$cn(classNameObj)) : undefined;
|
|
36
|
+
}
|
|
37
|
+
;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import '../../styles/global';
|
|
2
|
+
export declare const kls: (className: string) => string;
|
|
3
|
+
declare type ItemSize = 'default' | 'large' | 'small' | 'mini';
|
|
4
|
+
export declare function makeStyles(size: ItemSize): string;
|
|
5
|
+
export declare function makeItemStyles(): string;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
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)."; }
|
|
2
|
+
|
|
3
|
+
import { deepDefaults } from '../../styles/utils';
|
|
4
|
+
import { theme, setDefault } from '../../styles/theme';
|
|
5
|
+
import { css, keyframes } from '@emotion/css';
|
|
6
|
+
import '../../styles/global';
|
|
7
|
+
export var kls = function kls(className) {
|
|
8
|
+
return "k-skeleton-" + className;
|
|
9
|
+
};
|
|
10
|
+
var defaults = {
|
|
11
|
+
item: {
|
|
12
|
+
bgColor: '#dcdde0'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var skeleton;
|
|
16
|
+
setDefault(function () {
|
|
17
|
+
skeleton = deepDefaults(theme, {
|
|
18
|
+
skeleton: defaults
|
|
19
|
+
}).skeleton;
|
|
20
|
+
});
|
|
21
|
+
export function makeStyles(size) {
|
|
22
|
+
return /*#__PURE__*/css("&.k-animated{.", kls('item'), "{&>.k-skeleton-item-box{background:linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);background-size:400% 100%;animation:", skeletonLoading, " 1.4s ease infinite;}}}.k-skeleton-items{.", kls('item'), ":first-child{.skeleton-item-text{width:33%;}}.", kls('item'), ":last-child{.skeleton-item-text{width:61%;}}}.", kls('avator-box'), "{display:flex;&>div:last-child{flex-grow:1;padding-left:20px;}}.skeleton-item-button,.skeleton-item-input{height:", theme[size].height, ";}");
|
|
23
|
+
}
|
|
24
|
+
var skeletonLoading = /*#__PURE__*/keyframes(process.env.NODE_ENV === "production" ? {
|
|
25
|
+
name: "1jmexzm",
|
|
26
|
+
styles: "0%{background-position:100% 50%;}to{background-position:0 50%;}"
|
|
27
|
+
} : {
|
|
28
|
+
name: "1jmexzm",
|
|
29
|
+
styles: "0%{background-position:100% 50%;}to{background-position:0 50%;}",
|
|
30
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
31
|
+
});
|
|
32
|
+
export function makeItemStyles() {
|
|
33
|
+
var skeletonItem = skeleton.item;
|
|
34
|
+
return /*#__PURE__*/css("&>div{background:", skeletonItem.bgColor, ";}.skeleton-item-text{width:100%;height:16px;border-radius:4px;margin-top:16px;}.skeleton-item-avator{width:40px;height:40px;border-radius:50%;}.skeleton-item-image{display:flex;justify-content:center;align-items:center;width:200px;height:200px;&>svg{width:48px;height:48px;fill:", skeletonItem.bgColor, ";}}.skeleton-item-button{width:64px;background:", skeletonItem.bgColor, ";}.skeleton-item-input{width:160px;background:", skeletonItem.bgColor, ";}");
|
|
35
|
+
}
|
|
@@ -988,56 +988,80 @@ describe('Table', function () {
|
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
}, _callee21);
|
|
991
|
-
})));
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
991
|
+
})));
|
|
992
|
+
it('should update children in TableCell', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
993
|
+
var update, Test, Demo, _mount24, instance, element;
|
|
994
|
+
|
|
995
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context25) {
|
|
996
|
+
while (1) {
|
|
997
|
+
switch (_context25.prev = _context25.next) {
|
|
998
|
+
case 0:
|
|
999
|
+
update = sinon.spy();
|
|
1000
|
+
|
|
1001
|
+
Test = /*#__PURE__*/function (_Component3) {
|
|
1002
|
+
_inheritsLoose(Test, _Component3);
|
|
1003
|
+
|
|
1004
|
+
function Test() {
|
|
1005
|
+
return _Component3.apply(this, arguments) || this;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
var _proto = Test.prototype;
|
|
1009
|
+
|
|
1010
|
+
_proto.beforeUpdate = function beforeUpdate() {
|
|
1011
|
+
update();
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
return Test;
|
|
1015
|
+
}(Component);
|
|
1016
|
+
|
|
1017
|
+
Test.template = "<div>test</div>";
|
|
1018
|
+
|
|
1019
|
+
Demo = /*#__PURE__*/function (_Component4) {
|
|
1020
|
+
_inheritsLoose(Demo, _Component4);
|
|
1021
|
+
|
|
1022
|
+
function Demo() {
|
|
1023
|
+
var _context24;
|
|
1024
|
+
|
|
1025
|
+
var _this3;
|
|
1026
|
+
|
|
1027
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1028
|
+
args[_key3] = arguments[_key3];
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
_this3 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context24 = [this]).call(_context24, args)) || this;
|
|
1032
|
+
_this3.Table = Table;
|
|
1033
|
+
_this3.TableColumn = TableColumn;
|
|
1034
|
+
_this3.Test = Test;
|
|
1035
|
+
return _this3;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
Demo.defaults = function defaults() {
|
|
1039
|
+
return {
|
|
1040
|
+
data: [{
|
|
1041
|
+
a: 1
|
|
1042
|
+
}, {
|
|
1043
|
+
a: 2
|
|
1044
|
+
}]
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
return Demo;
|
|
1049
|
+
}(Component);
|
|
1050
|
+
|
|
1051
|
+
Demo.template = "\n const {Table, TableColumn, Test} = this;\n <Table data={this.get('data')} ref=\"table\">\n <TableColumn key=\"a\">\n <b:template>\n <Test />\n </b:template>\n </TableColumn>\n </Table>\n ";
|
|
1052
|
+
_mount24 = mount(Demo), instance = _mount24[0], element = _mount24[1];
|
|
1053
|
+
element.querySelector('tbody tr').click();
|
|
1054
|
+
_context25.next = 9;
|
|
1055
|
+
return wait();
|
|
1056
|
+
|
|
1057
|
+
case 9:
|
|
1058
|
+
expect(update.callCount).to.eql(1);
|
|
1059
|
+
|
|
1060
|
+
case 10:
|
|
1061
|
+
case "end":
|
|
1062
|
+
return _context25.stop();
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}, _callee22);
|
|
1066
|
+
})));
|
|
1043
1067
|
});
|
|
@@ -211,7 +211,7 @@ export function useChecked(getEnableKeys, getAllKeys, isDisabledKey, getGrid, lo
|
|
|
211
211
|
|
|
212
212
|
instance.on('$change:data', updateAllCheckedStatus);
|
|
213
213
|
instance.on('clickRow', function (data, index, key) {
|
|
214
|
-
if (instance.get('rowCheckable')) {
|
|
214
|
+
if (instance.get('rowCheckable') && instance.get('checkType') !== 'none') {
|
|
215
215
|
toggleChecked(key, index);
|
|
216
216
|
}
|
|
217
217
|
});
|
|
@@ -43,10 +43,9 @@ export function useFilter(getNodes, getExpandedKeys) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function updateFilterUpward(node) {
|
|
46
|
-
if (!node) return; // should expand the node
|
|
46
|
+
if (!node || _filterInstanceProperty(node)) return; // should expand the node
|
|
47
47
|
|
|
48
48
|
getExpandedKeys().add(node.key);
|
|
49
|
-
if (_filterInstanceProperty(node)) return;
|
|
50
49
|
node.filter = true;
|
|
51
50
|
updateFilterUpward(node.parent);
|
|
52
51
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -38,6 +38,7 @@ export * from './components/radio';
|
|
|
38
38
|
export * from './components/rate';
|
|
39
39
|
export * from './components/scrollSelect';
|
|
40
40
|
export * from './components/select';
|
|
41
|
+
export * from './components/skeleton';
|
|
41
42
|
export * from './components/slider';
|
|
42
43
|
export * from './components/spin';
|
|
43
44
|
export * from './components/spinner';
|
|
@@ -56,4 +57,4 @@ export * from './components/tree';
|
|
|
56
57
|
export * from './components/treeSelect';
|
|
57
58
|
export * from './components/upload';
|
|
58
59
|
export * from './components/wave';
|
|
59
|
-
export declare const version = "2.0.
|
|
60
|
+
export declare const version = "2.0.5";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -40,6 +40,7 @@ export * from './components/radio';
|
|
|
40
40
|
export * from './components/rate';
|
|
41
41
|
export * from './components/scrollSelect';
|
|
42
42
|
export * from './components/select';
|
|
43
|
+
export * from './components/skeleton';
|
|
43
44
|
export * from './components/slider';
|
|
44
45
|
export * from './components/spin';
|
|
45
46
|
export * from './components/spinner';
|
|
@@ -58,5 +59,5 @@ export * from './components/tree';
|
|
|
58
59
|
export * from './components/treeSelect';
|
|
59
60
|
export * from './components/upload';
|
|
60
61
|
export * from './components/wave';
|
|
61
|
-
export var version = '2.0.
|
|
62
|
+
export var version = '2.0.5';
|
|
62
63
|
/* generate end */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import * as ReactDOM from 'react-dom';
|
|
5
|
+
import { Tooltip, Form, FormItem } from '../../';
|
|
6
|
+
import { getElement, wait, dispatchEvent } from '../../../../test/utils';
|
|
7
|
+
describe('Form', function () {
|
|
8
|
+
it('should show Tooltip in append slot', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
9
|
+
var click, container, trigger;
|
|
10
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
11
|
+
while (1) {
|
|
12
|
+
switch (_context.prev = _context.next) {
|
|
13
|
+
case 0:
|
|
14
|
+
click = sinon.spy(function () {
|
|
15
|
+
return console.log(1);
|
|
16
|
+
});
|
|
17
|
+
container = document.createElement('div');
|
|
18
|
+
document.body.appendChild(container);
|
|
19
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormItem, {
|
|
20
|
+
label: "\u6D4B\u8BD5",
|
|
21
|
+
value: "1",
|
|
22
|
+
slotAppend: /*#__PURE__*/React.createElement(Tooltip, {
|
|
23
|
+
content: "\u6D4B\u8BD5"
|
|
24
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
25
|
+
className: "k-icon ion-ionic"
|
|
26
|
+
}))
|
|
27
|
+
})), container);
|
|
28
|
+
trigger = container.querySelector('.k-icon');
|
|
29
|
+
expect(trigger).to.be.exist;
|
|
30
|
+
dispatchEvent(trigger, 'mouseover');
|
|
31
|
+
_context.next = 9;
|
|
32
|
+
return wait();
|
|
33
|
+
|
|
34
|
+
case 9:
|
|
35
|
+
expect(getElement('.k-tooltip-content')).to.be.exist;
|
|
36
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
37
|
+
document.body.removeChild(container);
|
|
38
|
+
|
|
39
|
+
case 12:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, _callee);
|
|
45
|
+
})));
|
|
46
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
interface Props {
|
|
4
|
+
showSkeleton?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default class extends Component<Props> {
|
|
7
|
+
static template: string | import("intact").Template<any>;
|
|
8
|
+
static defaults(): {
|
|
9
|
+
showSkeleton: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
|
|
9
|
+
function default_1() {
|
|
10
|
+
return _Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
default_1.defaults = function defaults() {
|
|
14
|
+
return {
|
|
15
|
+
showSkeleton: true
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return default_1;
|
|
20
|
+
}(Component);
|
|
21
|
+
|
|
22
|
+
default_1.template = template;
|
|
23
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { Skeleton } from '@king-design/react';
|
|
5
|
+
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
|
|
9
|
+
function Demo() {
|
|
10
|
+
var _context;
|
|
11
|
+
|
|
12
|
+
var _this;
|
|
13
|
+
|
|
14
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
+
args[_key] = arguments[_key];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
19
|
+
_this.state = {
|
|
20
|
+
showSkeleton: true
|
|
21
|
+
};
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var _proto = Demo.prototype;
|
|
26
|
+
|
|
27
|
+
_proto.render = function render() {
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Skeleton, {
|
|
29
|
+
loading: this.state.showSkeleton,
|
|
30
|
+
avator: true,
|
|
31
|
+
animated: true
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return Demo;
|
|
36
|
+
}(React.Component);
|
|
37
|
+
|
|
38
|
+
export { Demo as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
interface Props {
|
|
4
|
+
showSkeleton?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default class extends Component<Props> {
|
|
7
|
+
static template: string | import("intact").Template<any>;
|
|
8
|
+
static defaults(): {
|
|
9
|
+
showSkeleton: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
|
|
9
|
+
function default_1() {
|
|
10
|
+
return _Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
default_1.defaults = function defaults() {
|
|
14
|
+
return {
|
|
15
|
+
showSkeleton: true
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return default_1;
|
|
20
|
+
}(Component);
|
|
21
|
+
|
|
22
|
+
default_1.template = template;
|
|
23
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { Skeleton } from '@king-design/react';
|
|
5
|
+
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
|
|
9
|
+
function Demo() {
|
|
10
|
+
var _context;
|
|
11
|
+
|
|
12
|
+
var _this;
|
|
13
|
+
|
|
14
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
+
args[_key] = arguments[_key];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
19
|
+
_this.state = {
|
|
20
|
+
showSkeleton: true
|
|
21
|
+
};
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var _proto = Demo.prototype;
|
|
26
|
+
|
|
27
|
+
_proto.render = function render() {
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Skeleton, {
|
|
29
|
+
loading: this.state.showSkeleton,
|
|
30
|
+
avator: true
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return Demo;
|
|
35
|
+
}(React.Component);
|
|
36
|
+
|
|
37
|
+
export { Demo as default };
|