@king-design/react 3.1.6 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/React Demos.md +22 -16
- package/components/config/index.spec.js +22 -14
- package/components/layout/aside.vdt.js +1 -1
- package/components/layout/styles.js +2 -17
- package/components/menu/index.d.ts +1 -0
- package/components/menu/index.js +2 -1
- package/components/menu/index.spec.js +59 -28
- package/components/menu/item.vdt.js +3 -3
- package/components/menu/menu.d.ts +2 -0
- package/components/menu/menu.js +12 -1
- package/components/menu/menu.vdt.js +9 -4
- package/components/menu/styles.d.ts +15 -12
- package/components/menu/styles.js +38 -38
- package/components/menu/title.d.ts +7 -0
- package/components/menu/title.js +22 -0
- package/components/menu/title.vdt.js +25 -0
- package/components/radio/styles.js +1 -1
- package/components/select/index.spec.js +1 -1
- package/components/select/option.vdt.js +1 -0
- package/components/select/select.js +4 -1
- package/components/table/column.vdt.js +6 -6
- package/components/table/useSortable.d.ts +7 -3
- package/components/table/useSortable.js +5 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/styles/theme.js +1 -2
- package/yarn-error.log +0 -528
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact-react';
|
|
3
|
+
import { Icon } from '../icon';
|
|
4
|
+
import { getRestProps, findChildren, isComponentVNode } from '../utils';
|
|
5
|
+
import { makeTitleStyles } from './styles';
|
|
6
|
+
export default function ($props, $blocks, $__proto__) {
|
|
7
|
+
var _classNameObj, _$cn2;
|
|
8
|
+
$blocks || ($blocks = {});
|
|
9
|
+
$props || ($props = {});
|
|
10
|
+
var $this = this;
|
|
11
|
+
var rootMenu = this.rootMenu;
|
|
12
|
+
var _rootMenu$get = rootMenu.get(),
|
|
13
|
+
collapse = _rootMenu$get.collapse;
|
|
14
|
+
var _this$get = this.get(),
|
|
15
|
+
children = _this$get.children,
|
|
16
|
+
className = _this$get.className;
|
|
17
|
+
var k = this.config.k;
|
|
18
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-menu-title"] = true, _classNameObj[className] = className, _classNameObj);
|
|
19
|
+
return _$cv('div', _extends({
|
|
20
|
+
'className': _$cn(classNameObj)
|
|
21
|
+
}, getRestProps(this)), _$ce(2, 'div', !collapse ? _$ce(2, 'span', children, 0) : findChildren(children, function (vNode) {
|
|
22
|
+
return isComponentVNode(vNode, Icon);
|
|
23
|
+
}), 0, _$cn((_$cn2 = {}, _$cn2[k + "-menu-name"] = true, _$cn2[makeTitleStyles(k)] = true, _$cn2))));
|
|
24
|
+
}
|
|
25
|
+
;
|
|
@@ -409,7 +409,7 @@ describe('Select', function () {
|
|
|
409
409
|
_context12.next = 12;
|
|
410
410
|
return wait();
|
|
411
411
|
case 12:
|
|
412
|
-
expect(instance.get('days')).have.length(
|
|
412
|
+
expect(instance.get('days')).have.length(6);
|
|
413
413
|
// unselect all
|
|
414
414
|
select.click();
|
|
415
415
|
_context12.next = 16;
|
|
@@ -58,7 +58,10 @@ export var Select = /*#__PURE__*/function (_BaseSelect) {
|
|
|
58
58
|
var loop = function loop(children) {
|
|
59
59
|
eachChildren(children, function (vNode) {
|
|
60
60
|
if (isComponentVNode(vNode, Option)) {
|
|
61
|
-
|
|
61
|
+
var props = vNode.props;
|
|
62
|
+
if (!props.disabled) {
|
|
63
|
+
values.push(props.value);
|
|
64
|
+
}
|
|
62
65
|
} else if (isComponentVNode(vNode, OptionGroup)) {
|
|
63
66
|
loop(vNode.props.children);
|
|
64
67
|
}
|
|
@@ -16,6 +16,7 @@ import { context as FixedColumnsContext } from './useFixedColumns';
|
|
|
16
16
|
import { stopPropagation } from '../utils';
|
|
17
17
|
import { Input } from '../input';
|
|
18
18
|
import { _$ } from '../../i18n';
|
|
19
|
+
import { ignoreSortable } from './useSortable';
|
|
19
20
|
export default function ($props, $blocks, $__proto__) {
|
|
20
21
|
var _this = this;
|
|
21
22
|
$blocks || ($blocks = {});
|
|
@@ -73,7 +74,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
73
74
|
'ev-mousedown': function evMousedown(e) {
|
|
74
75
|
e._vNode = _this.$vNode;
|
|
75
76
|
onStart(e);
|
|
76
|
-
}
|
|
77
|
+
},
|
|
78
|
+
'ev-click': ignoreSortable
|
|
77
79
|
}) : undefined, _$ce(2, 'div', [_$ce(2, 'div', (_$blocks['title'] = function ($super) {
|
|
78
80
|
return title;
|
|
79
81
|
}, __$blocks['title'] = function ($super, data) {
|
|
@@ -96,9 +98,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
96
98
|
'ref': dropdownRef,
|
|
97
99
|
'children': [_$cc(Icon, {
|
|
98
100
|
'className': _$cn(k + "-icon-down-squared " + k + "-table-group"),
|
|
99
|
-
'ev-click':
|
|
100
|
-
return e._ignoreSortable = true;
|
|
101
|
-
},
|
|
101
|
+
'ev-click': ignoreSortable,
|
|
102
102
|
'hoverable': true,
|
|
103
103
|
'color': isEmptyValue(groupValue) ? null : 'primary'
|
|
104
104
|
}), _$cc(DropdownMenu, {
|
|
@@ -161,10 +161,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
161
161
|
})], 4, _$cn(k + "-table-group-footer")) : undefined]
|
|
162
162
|
})]
|
|
163
163
|
}, 'dropdown', dropdownRef) : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, {
|
|
164
|
-
'className': _$cn(k + "-icon-up " + k + "-asc"),
|
|
164
|
+
'className': _$cn(k + "-icon-up-bold " + k + "-asc"),
|
|
165
165
|
'size': 'mini'
|
|
166
166
|
}), _$cc(Icon, {
|
|
167
|
-
'className': _$cn(k + "-icon-down " + k + "-desc"),
|
|
167
|
+
'className': _$cn(k + "-icon-down-bold " + k + "-desc"),
|
|
168
168
|
'size': 'mini'
|
|
169
169
|
})], 4, _$cn((_$cn4 = {}, _$cn4[k + "-column-sort"] = true, _$cn4[k + "-" + type] = type, _$cn4))) : undefined], 0, _$cn(k + "-table-title"))], 0, _$cn(classNameObj), {
|
|
170
170
|
'style': style,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
type SortEvent = Event & {
|
|
2
|
+
_ignoreSortable?: boolean;
|
|
3
|
+
};
|
|
1
4
|
export declare const context: {
|
|
2
5
|
Provider: import('intact-react').ComponentConstructor<import('intact-react').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
6
|
Consumer: import('intact-react').ComponentConstructor<import('intact-react').Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
7
|
useContext: () => import('intact-react').RefObject<any>;
|
|
5
8
|
};
|
|
6
9
|
export declare function useSortable(): {
|
|
7
|
-
onChange: (key: string, event:
|
|
8
|
-
|
|
9
|
-
}) => void;
|
|
10
|
+
onChange: (key: string, event: SortEvent) => void;
|
|
11
|
+
ignoreSortable: typeof ignoreSortable;
|
|
10
12
|
};
|
|
13
|
+
export declare function ignoreSortable(e: SortEvent): void;
|
|
14
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.2.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -60,7 +60,7 @@ export * from './components/tree';
|
|
|
60
60
|
export * from './components/treeSelect';
|
|
61
61
|
export * from './components/upload';
|
|
62
62
|
export * from './components/wave';
|
|
63
|
-
export declare const version = "3.
|
|
63
|
+
export declare const version = "3.2.0";
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
export {normalize} from 'intact-react';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.2.0
|
|
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.
|
|
64
|
+
export var version = '3.2.0';
|
|
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.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "King-Design UI components for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@emotion/css": "^11.5.0",
|
|
37
37
|
"dayjs": "^1.10.7",
|
|
38
38
|
"enquire.js": "^2.1.6",
|
|
39
|
-
"intact-react": "3.0.
|
|
39
|
+
"intact-react": "3.0.30",
|
|
40
40
|
"monaco-editor": "^0.26.1",
|
|
41
41
|
"mxgraphx": "^4.0.7",
|
|
42
42
|
"resize-observer-polyfill": "^1.5.1",
|
package/styles/theme.js
CHANGED
|
@@ -32,7 +32,7 @@ export function defaultTheme() {
|
|
|
32
32
|
info: '#0091ea',
|
|
33
33
|
bg: '#f3f5f6',
|
|
34
34
|
title: '#151b1e',
|
|
35
|
-
darkBorder: '#
|
|
35
|
+
darkBorder: '#2f2f36',
|
|
36
36
|
placeholder: '#bec3c5',
|
|
37
37
|
get link() {
|
|
38
38
|
return theme.color.primary;
|
|
@@ -41,7 +41,6 @@ export function defaultTheme() {
|
|
|
41
41
|
return palette(theme.color.primary, -1);
|
|
42
42
|
},
|
|
43
43
|
hoverBg: '#f3f5f6',
|
|
44
|
-
// get hoverBg() { return palette(theme.color.primary, -4) },
|
|
45
44
|
disabled: '#bec3c5',
|
|
46
45
|
disabledBg: '#f0f2f4',
|
|
47
46
|
disabledBorder: '#d0d5d9',
|