@king-design/react 3.0.0 → 3.0.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__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +268 -268
- package/components/dropdown/usePosition.js +2 -2
- package/components/form/styles.js +1 -1
- package/components/layout/body.d.ts +1 -0
- package/components/layout/body.js +7 -2
- package/components/layout/header.d.ts +2 -0
- package/components/layout/header.js +9 -3
- package/components/layout/helpers.d.ts +1 -0
- package/components/layout/helpers.js +1 -0
- package/components/layout/index.spec.d.ts +1 -0
- package/components/layout/index.spec.js +53 -0
- package/components/layout/layout.d.ts +1 -0
- package/components/layout/layout.js +3 -2
- package/components/layout/styles.js +5 -5
- package/components/menu/styles.js +2 -2
- package/components/menu/useDropdown.js +6 -1
- package/components/table/index.spec.js +1 -1
- package/components/table/row.js +8 -1
- package/components/table/styles.js +1 -1
- package/components/table/table.d.ts +1 -1
- package/components/table/table.js +1 -1
- package/components/table/usePagination.js +1 -1
- package/components/utils.d.ts +1 -0
- package/components/utils.js +16 -0
- package/components/virtual.js +5 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/styles/utils.d.ts +1 -0
- package/styles/utils.js +3 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
3
2
|
import { useInstance, findDomFromVNode } from 'intact-react';
|
|
4
3
|
import { position } from '../position';
|
|
5
4
|
import { noop } from 'intact-shared';
|
|
6
5
|
import { isObject } from 'intact-shared';
|
|
6
|
+
import { isEqualObject } from '../utils';
|
|
7
7
|
export function usePosition() {
|
|
8
8
|
var instance = useInstance();
|
|
9
9
|
var positioned = {
|
|
@@ -18,7 +18,7 @@ export function usePosition() {
|
|
|
18
18
|
instance.watch(item, function (newValue, oldValue) {
|
|
19
19
|
// return if object is the same
|
|
20
20
|
if (isObject(newValue) && isObject(oldValue) && // is not event object
|
|
21
|
-
!(newValue instanceof Event) &&
|
|
21
|
+
!(newValue instanceof Event) && isEqualObject(newValue, oldValue)) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -50,7 +50,7 @@ setDefault(function () {
|
|
|
50
50
|
}).form;
|
|
51
51
|
});
|
|
52
52
|
export function makeItemStyles() {
|
|
53
|
-
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-wrapper{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-wrapper{border:none;}}.k-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
53
|
+
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";flex-shrink:0;}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-wrapper{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-wrapper{border:none;}}.k-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
54
54
|
}
|
|
55
55
|
export function makeFormStyles() {
|
|
56
56
|
var _context;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import { Component, inject } from 'intact-react';
|
|
3
|
+
import { Component, inject, provide } from 'intact-react';
|
|
4
4
|
import template from './template.vdt';
|
|
5
|
-
import { LAYOUT, getStyle } from './helpers';
|
|
5
|
+
import { LAYOUT, getStyle, BODY } from './helpers';
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
7
|
export var Body = /*#__PURE__*/function (_Component) {
|
|
8
8
|
_inheritsLoose(Body, _Component);
|
|
@@ -23,6 +23,10 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
23
23
|
|
|
24
24
|
var _proto = Body.prototype;
|
|
25
25
|
|
|
26
|
+
_proto.init = function init() {
|
|
27
|
+
provide(BODY, this);
|
|
28
|
+
};
|
|
29
|
+
|
|
26
30
|
_proto.getClassNames = function getClassNames() {
|
|
27
31
|
var _ref;
|
|
28
32
|
|
|
@@ -45,6 +49,7 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
45
49
|
|
|
46
50
|
if (!hasFixedAside && !hasFixedHeader) return style;
|
|
47
51
|
return addStyle(style, {
|
|
52
|
+
// FIXME: we must use padding instead of margin, otherwise the table's width is wired
|
|
48
53
|
paddingLeft: hasFixedAside ? getStyle(asideWidth) : null,
|
|
49
54
|
marginTop: hasFixedHeader ? getStyle(headerHeight) : null
|
|
50
55
|
});
|
|
@@ -5,6 +5,8 @@ export interface HeaderProps {
|
|
|
5
5
|
height?: number | string;
|
|
6
6
|
style?: string | Record<string, string>;
|
|
7
7
|
theme?: MenuProps['theme'];
|
|
8
|
+
blur?: boolean;
|
|
9
|
+
boxShadow?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare class Header extends Component<HeaderProps> {
|
|
10
12
|
static template: string | import("intact").Template<any>;
|
|
@@ -9,7 +9,9 @@ var typeDefs = {
|
|
|
9
9
|
fixed: Boolean,
|
|
10
10
|
height: [Number, String],
|
|
11
11
|
style: [String, Object],
|
|
12
|
-
theme: themes
|
|
12
|
+
theme: themes,
|
|
13
|
+
blur: Boolean,
|
|
14
|
+
boxShadow: Boolean
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
var defaults = function defaults() {
|
|
@@ -44,11 +46,15 @@ export var Header = /*#__PURE__*/function (_Component) {
|
|
|
44
46
|
var _this$get = this.get(),
|
|
45
47
|
className = _this$get.className,
|
|
46
48
|
fixed = _this$get.fixed,
|
|
47
|
-
theme = _this$get.theme
|
|
49
|
+
theme = _this$get.theme,
|
|
50
|
+
blur = _this$get.blur,
|
|
51
|
+
boxShadow = _this$get.boxShadow;
|
|
48
52
|
|
|
49
53
|
return _ref = {
|
|
50
54
|
'k-layout-header': true,
|
|
51
|
-
'k-fixed': fixed
|
|
55
|
+
'k-fixed': fixed,
|
|
56
|
+
'k-blur': blur,
|
|
57
|
+
'k-box-shadow': boxShadow
|
|
52
58
|
}, _ref["k-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles()] = true, _ref;
|
|
53
59
|
};
|
|
54
60
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const ROOT_LAYOUT = "RootLayout";
|
|
2
2
|
export declare const LAYOUT = "Layout";
|
|
3
|
+
export declare const BODY = "LayoutBody";
|
|
3
4
|
export declare const defaultHeight = "64px";
|
|
4
5
|
export declare const defaultWidth = "200px";
|
|
5
6
|
export declare function getStyle(height: number | string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
4
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
5
|
+
import { mount, unmount } from '../../test/utils';
|
|
6
|
+
import { Component } from 'intact-react';
|
|
7
|
+
import { Layout, Header, Aside, Body } from './';
|
|
8
|
+
describe('Layout', function () {
|
|
9
|
+
afterEach(function () {
|
|
10
|
+
unmount();
|
|
11
|
+
});
|
|
12
|
+
it('nest Layout in Body with fixed header', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
13
|
+
var Demo, _mount, instance, element;
|
|
14
|
+
|
|
15
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
16
|
+
while (1) {
|
|
17
|
+
switch (_context2.prev = _context2.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(Demo, _Component);
|
|
21
|
+
|
|
22
|
+
function Demo() {
|
|
23
|
+
var _context;
|
|
24
|
+
|
|
25
|
+
var _this;
|
|
26
|
+
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
+
args[_key] = arguments[_key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
32
|
+
_this.Layout = Layout;
|
|
33
|
+
_this.Header = Header;
|
|
34
|
+
_this.Aside = Aside;
|
|
35
|
+
_this.Body = Body;
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return Demo;
|
|
40
|
+
}(Component);
|
|
41
|
+
|
|
42
|
+
Demo.template = "\n const { Layout, Header, Aside, Body } = this;\n <Layout>\n <Header fixed />\n <Body>\n <Layout>\n <Aside fixed />\n <Body>body</Body>\n </Layout>\n </Body>\n </Layout>\n ";
|
|
43
|
+
_mount = mount(Demo), instance = _mount[0], element = _mount[1];
|
|
44
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
45
|
+
|
|
46
|
+
case 4:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context2.stop();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, _callee);
|
|
52
|
+
})));
|
|
53
|
+
});
|
|
@@ -4,7 +4,7 @@ import { Component, inject, provide } from 'intact-react';
|
|
|
4
4
|
import template from './template.vdt';
|
|
5
5
|
import { makeLayoutStyles } from './styles';
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
|
-
import { ROOT_LAYOUT, LAYOUT, getStyle } from './helpers';
|
|
7
|
+
import { ROOT_LAYOUT, LAYOUT, getStyle, BODY } from './helpers';
|
|
8
8
|
import { useParse } from './useParse';
|
|
9
9
|
export var Layout = /*#__PURE__*/function (_Component) {
|
|
10
10
|
_inheritsLoose(Layout, _Component);
|
|
@@ -21,6 +21,7 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
21
21
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
22
22
|
_this.parse = useParse();
|
|
23
23
|
_this.layout = inject(LAYOUT, null);
|
|
24
|
+
_this.body = inject(BODY, null);
|
|
24
25
|
return _this;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -52,7 +53,7 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
52
53
|
_proto.getStyles = function getStyles() {
|
|
53
54
|
var style = this.get('style');
|
|
54
55
|
var layout = this.layout;
|
|
55
|
-
if (!layout) return style;
|
|
56
|
+
if (!layout || this.body) return style;
|
|
56
57
|
|
|
57
58
|
var _layout$parse = layout.parse(),
|
|
58
59
|
hasFixedHeader = _layout$parse.hasFixedHeader,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
|
-
import { deepDefaults, getLeft } from '../../styles/utils';
|
|
4
|
+
import { deepDefaults, getLeft, setAlpha } from '../../styles/utils';
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
import { menu } from '../menu/styles';
|
|
7
7
|
var sizes = ['small', 'large'];
|
|
@@ -21,7 +21,7 @@ var defaults = {
|
|
|
21
21
|
|
|
22
22
|
light: {
|
|
23
23
|
get color() {
|
|
24
|
-
return menu.light.
|
|
24
|
+
return menu.light.item.color;
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
get bgColor() {
|
|
@@ -35,7 +35,7 @@ var defaults = {
|
|
|
35
35
|
},
|
|
36
36
|
white: {
|
|
37
37
|
get color() {
|
|
38
|
-
return menu.white.
|
|
38
|
+
return menu.white.item.color;
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
get bgColor() {
|
|
@@ -68,10 +68,10 @@ export function makeLayoutStyles() {
|
|
|
68
68
|
return /*#__PURE__*/css("display:flex;flex-direction:column;flex:1;transition:padding-left ", layout.transition, ";&.k-has-aside{flex-direction:row;}.k-layout-footer{padding:", layout.footerPadding, ";}.k-layout-body{flex:1;}");
|
|
69
69
|
}
|
|
70
70
|
export function makeHeaderStyles() {
|
|
71
|
-
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.k-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
71
|
+
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.k-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}>.k-menu{background:transparent!important;}&.k-blur{backdrop-filter:blur(20px);background:", setAlpha(layout.bgColor, 0.1), ";}&.k-box-shadow{border-bottom:none!important;box-shadow:", theme.boxShadow, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
72
72
|
if (theme === 'dark') return;
|
|
73
73
|
var styles = layout[theme];
|
|
74
|
-
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";}");
|
|
74
|
+
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";&.k-blur{background:", setAlpha(styles.bgColor, 0.1), ";}}");
|
|
75
75
|
}), ";");
|
|
76
76
|
}
|
|
77
77
|
export function makeAsideStyles() {
|
|
@@ -132,9 +132,9 @@ export function makeMenuStyles() {
|
|
|
132
132
|
}
|
|
133
133
|
export function makeTitleStyles() {
|
|
134
134
|
var item = menu.item;
|
|
135
|
-
return /*#__PURE__*/css("display:flex;align-items:center;padding:",
|
|
135
|
+
return /*#__PURE__*/css("display:flex;align-items:center;padding:", item.padding, ";color:", item.color, ";white-space:nowrap;overflow:hidden;flex-wrap:nowrap;");
|
|
136
136
|
}
|
|
137
137
|
export function makeItemStyles() {
|
|
138
138
|
var item = menu.item;
|
|
139
|
-
return /*#__PURE__*/css(".k-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.k-menu-name{flex:1;display:flex;align-items:center;}.k-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.k-expanded{>.k-menu-title{color:", menu.item.hoverColor, ";.k-menu-arrow{transform:rotateX(180deg);}}}&.k-highlighted{>.k-menu-title{color:", menu.item.hoverColor, ";}}&.k-active{>.k-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.k-disabled{>.k-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.k-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
139
|
+
return /*#__PURE__*/css(".k-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.k-menu-name{flex:1;display:flex;align-items:center;min-width:0;span{overflow:hidden;text-overflow:ellipsis;min-width:0;}}.k-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.k-expanded{>.k-menu-title{color:", menu.item.hoverColor, ";.k-menu-arrow{transform:rotateX(180deg);}}}&.k-highlighted{>.k-menu-title{color:", menu.item.hoverColor, ";}}&.k-active{>.k-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.k-disabled{>.k-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.k-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
140
140
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useInstance, onBeforeMount, onBeforeUpdate, inject } from 'intact-react';
|
|
1
|
+
import { useInstance, onBeforeMount, onBeforeUpdate, inject, createVNode } from 'intact-react';
|
|
2
2
|
import { Menu } from './';
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
4
|
import { isComponentVNode, eachChildren, isTextVNode, isStringOrNumberNotEmpty } from '../utils';
|
|
@@ -38,6 +38,11 @@ export function useDropdown(rootMenu, parentMenu) {
|
|
|
38
38
|
iconVNode = vNode;
|
|
39
39
|
}
|
|
40
40
|
} else {
|
|
41
|
+
if (isStringOrNumberNotEmpty(vNode) || isTextVNode(vNode)) {
|
|
42
|
+
// wrap with span for showing text ellipsis
|
|
43
|
+
vNode = createVNode('span', null, vNode);
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
titleVNodes.push(vNode);
|
|
42
47
|
}
|
|
43
48
|
});
|
|
@@ -1141,7 +1141,7 @@ describe('Table', function () {
|
|
|
1141
1141
|
table = instance.refs.table;
|
|
1142
1142
|
pagination = table.pagination.paginationRef;
|
|
1143
1143
|
spy = sinon.spy();
|
|
1144
|
-
table.on('
|
|
1144
|
+
table.on('page', spy); // check all
|
|
1145
1145
|
|
|
1146
1146
|
table.checkAll();
|
|
1147
1147
|
expect(table.getCheckedData()).to.have.length(10); // next page
|
package/components/table/row.js
CHANGED
|
@@ -3,6 +3,7 @@ import { __decorate } from "tslib";
|
|
|
3
3
|
import { Component } from 'intact-react';
|
|
4
4
|
import template from './row.vdt';
|
|
5
5
|
import { bind } from '../utils';
|
|
6
|
+
import { isEqualObject } from '../utils';
|
|
6
7
|
export var TableRow = /*#__PURE__*/function (_Component) {
|
|
7
8
|
_inheritsLoose(TableRow, _Component);
|
|
8
9
|
|
|
@@ -21,8 +22,14 @@ export var TableRow = /*#__PURE__*/function (_Component) {
|
|
|
21
22
|
for (key in lastProps) {
|
|
22
23
|
// ignore index
|
|
23
24
|
if (key === 'index') continue;
|
|
25
|
+
var lastValue = lastProps[key];
|
|
26
|
+
var nextValue = nextProps[key]; // deeply compare for offsetMap
|
|
24
27
|
|
|
25
|
-
if (
|
|
28
|
+
if (key === 'offsetMap' && isEqualObject(lastValue, nextValue)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (lastValue !== nextValue) {
|
|
26
33
|
isSame = false;
|
|
27
34
|
break;
|
|
28
35
|
}
|
|
@@ -107,5 +107,5 @@ export function makeStyles() {
|
|
|
107
107
|
}), ">.k-pagination{margin:16px 0;}");
|
|
108
108
|
}
|
|
109
109
|
export function makeGroupMenuStyles() {
|
|
110
|
-
return /*#__PURE__*/css("
|
|
110
|
+
return /*#__PURE__*/css("min-width:", table.group.menuMinWidth, "!important;.k-dropdown-item.k-active{color:", table.group.activeColor, ";}.k-table-group-header{padding:", table.group.headerPadding, ";border-bottom:", table.group.headerBorder, ";}.k-table-group-body{max-height:", table.group.menuMaxHeight, ";overflow:auto;}.k-table-group-footer{text-align:right;border-top:", table.group.headerBorder, ";padding:8px;.k-btn{margin-left:8px;}}");
|
|
111
111
|
}
|
|
@@ -54,7 +54,7 @@ export interface TableEvents<T = any, K extends TableRowKey = number> {
|
|
|
54
54
|
uncheckRow: [T, number, K];
|
|
55
55
|
checkAll: [];
|
|
56
56
|
uncheckAll: [];
|
|
57
|
-
|
|
57
|
+
page: [PaginationChangeData];
|
|
58
58
|
}
|
|
59
59
|
export interface TableBlocks<T = unknown> {
|
|
60
60
|
empty: null;
|
package/components/utils.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare function range(start: number, end: number): number[];
|
|
|
24
24
|
export declare function strPad(str: number | string, length: number, pad?: string): string;
|
|
25
25
|
declare type EqualArrayValue = any | EqualArrayValue[];
|
|
26
26
|
export declare function isEqualArray(a: EqualArrayValue, b: EqualArrayValue): boolean;
|
|
27
|
+
export declare function isEqualObject(a: Record<string, any>, b: Record<string, any>): boolean;
|
|
27
28
|
export declare function last<T>(arr: T[]): T | undefined;
|
|
28
29
|
export declare const expandAnimationCallbacks: {
|
|
29
30
|
name: string;
|
package/components/utils.js
CHANGED
|
@@ -290,6 +290,22 @@ export function isEqualArray(a, b) {
|
|
|
290
290
|
|
|
291
291
|
return false;
|
|
292
292
|
}
|
|
293
|
+
export function isEqualObject(a, b) {
|
|
294
|
+
if (a === b) return true;
|
|
295
|
+
|
|
296
|
+
if (a && b) {
|
|
297
|
+
var keysA = _Object$keys(a);
|
|
298
|
+
|
|
299
|
+
var keysB = _Object$keys(b);
|
|
300
|
+
|
|
301
|
+
if (keysA.length !== keysB.length) return false;
|
|
302
|
+
return keysA.every(function (key) {
|
|
303
|
+
return a[key] === b[key];
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
293
309
|
export function last(arr) {
|
|
294
310
|
return arr[arr.length - 1];
|
|
295
311
|
}
|
package/components/virtual.js
CHANGED
|
@@ -82,14 +82,17 @@ export var Virtual = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
/* vue2 vnode */
|
|
83
83
|
) {
|
|
84
84
|
var data = vnode.data;
|
|
85
|
-
|
|
85
|
+
if (!data) return props;
|
|
86
|
+
var on = data.on || EMPTY_OBJ;
|
|
86
87
|
var _events = {};
|
|
87
88
|
|
|
88
89
|
for (var _key2 in on) {
|
|
89
90
|
_events["ev-" + _key2] = on[_key2];
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
return _extends({}, props, _events
|
|
93
|
+
return _extends({}, props, _events, {
|
|
94
|
+
className: data.staticClass
|
|
95
|
+
});
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
return props;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.0.
|
|
2
|
+
* @king-design v3.0.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 declare const version = "3.0.
|
|
62
|
+
export declare const version = "3.0.1";
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
export {normalize} from 'intact-react';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.0.
|
|
2
|
+
* @king-design v3.0.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -61,7 +61,7 @@ export * from './components/tree';
|
|
|
61
61
|
export * from './components/treeSelect';
|
|
62
62
|
export * from './components/upload';
|
|
63
63
|
export * from './components/wave';
|
|
64
|
-
export var version = '3.0.
|
|
64
|
+
export var version = '3.0.1';
|
|
65
65
|
/* generate end */
|
|
66
66
|
|
|
67
67
|
export {normalize} from 'intact-react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/react",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.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.21",
|
|
41
41
|
"monaco-editor": "^0.26.1",
|
|
42
42
|
"mxgraphx": "^4.0.7",
|
|
43
43
|
"resize-observer-polyfill": "^1.5.1",
|
package/styles/utils.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export declare function palette(color: string, level: number): string;
|
|
|
10
10
|
export declare function getLeft(padding: string): string;
|
|
11
11
|
export declare function getRight(padding: string): string;
|
|
12
12
|
export declare function darken(color: string, number: number): string;
|
|
13
|
+
export declare function setAlpha(color: string, number: number): string;
|
|
13
14
|
export declare type Sizes = 'large' | 'default' | 'small' | 'mini';
|
|
14
15
|
export declare const sizes: Sizes[];
|
package/styles/utils.js
CHANGED
|
@@ -111,4 +111,7 @@ export function getRight(padding) {
|
|
|
111
111
|
export function darken(color, number) {
|
|
112
112
|
return tinycolor(color).darken(number).toHexString();
|
|
113
113
|
}
|
|
114
|
+
export function setAlpha(color, number) {
|
|
115
|
+
return tinycolor(color).setAlpha(number).toRgbString();
|
|
116
|
+
}
|
|
114
117
|
export var sizes = ['large', 'default', 'small', 'mini'];
|