@king-design/react 3.1.5 → 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/__tests__/components/drawer.spec.tsx +4 -4
- package/components/cascader/index.d.ts +45 -0
- package/components/config/index.spec.js +22 -14
- package/components/datepicker/index.d.ts +63 -0
- package/components/datepicker/index.spec.js +10 -5
- package/components/datepicker/useValue.js +9 -1
- package/components/diagram/index.d.ts +1 -1
- 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.d.ts +33 -0
- package/components/select/select.js +4 -1
- package/components/steps/context.d.ts +3 -3
- package/components/table/column.vdt.js +6 -6
- package/components/table/useSortable.d.ts +7 -3
- package/components/table/useSortable.js +5 -1
- package/components/timepicker/panelPicker.d.ts +54 -0
- package/components/treeSelect/index.d.ts +28 -0
- 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
|
@@ -10,53 +10,50 @@ var defaults = {
|
|
|
10
10
|
return theme.transition.large;
|
|
11
11
|
},
|
|
12
12
|
width: '200px',
|
|
13
|
-
bgColor: '#
|
|
13
|
+
bgColor: '#1c1c20',
|
|
14
14
|
fontSize: '14px',
|
|
15
15
|
get borderRadius() {
|
|
16
16
|
return theme.borderRadius;
|
|
17
17
|
},
|
|
18
|
+
get border() {
|
|
19
|
+
return "1px solid " + theme.color.darkBorder;
|
|
20
|
+
},
|
|
18
21
|
item: {
|
|
19
22
|
height: '40px',
|
|
20
|
-
padding: '0
|
|
21
|
-
|
|
23
|
+
padding: '0 17px',
|
|
24
|
+
bodyPadding: '0 4px',
|
|
25
|
+
color: '#aeaeb9',
|
|
22
26
|
hoverColor: '#fff',
|
|
23
|
-
|
|
24
|
-
return theme.color.text;
|
|
25
|
-
},
|
|
27
|
+
disabledColor: '#53535a',
|
|
26
28
|
get activeBgColor() {
|
|
27
29
|
return theme.color.primary;
|
|
28
30
|
},
|
|
29
|
-
|
|
31
|
+
get hoverBgColor() {
|
|
32
|
+
return palette(theme.color.primary, 4);
|
|
33
|
+
},
|
|
34
|
+
dotFontSize: '12px',
|
|
35
|
+
subTitleColor: '#858592'
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
height: '40px',
|
|
39
|
+
padding: '0 17px',
|
|
40
|
+
color: '#fff'
|
|
30
41
|
},
|
|
31
42
|
icon: {
|
|
32
43
|
width: '16px',
|
|
33
44
|
gap: '11px'
|
|
34
45
|
},
|
|
35
46
|
header: {
|
|
36
|
-
height: '
|
|
47
|
+
height: '52px',
|
|
37
48
|
fontSize: '14px',
|
|
49
|
+
color: '#fff',
|
|
38
50
|
borderBottom: '1px solid #1b1b1d'
|
|
39
51
|
},
|
|
40
|
-
// sub-menu
|
|
41
|
-
subBgColor: '#000',
|
|
42
52
|
light: {
|
|
43
|
-
bgColor: '#e5e5e9',
|
|
44
|
-
subBgColor: '#d5d5d9',
|
|
45
|
-
border: '1px solid #d5d5d9',
|
|
46
|
-
item: {
|
|
47
|
-
get color() {
|
|
48
|
-
return theme.color.text;
|
|
49
|
-
},
|
|
50
|
-
get hoverColor() {
|
|
51
|
-
return theme.color.primary;
|
|
52
|
-
},
|
|
53
|
-
disabledColor: '#999'
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
white: {
|
|
57
53
|
bgColor: '#fff',
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
get border() {
|
|
55
|
+
return "1px solid " + theme.color.disabledBg;
|
|
56
|
+
},
|
|
60
57
|
item: {
|
|
61
58
|
get color() {
|
|
62
59
|
return theme.color.text;
|
|
@@ -64,8 +61,15 @@ var defaults = {
|
|
|
64
61
|
get hoverColor() {
|
|
65
62
|
return theme.color.primary;
|
|
66
63
|
},
|
|
67
|
-
get
|
|
68
|
-
return theme.color.
|
|
64
|
+
get hoverBg() {
|
|
65
|
+
return theme.color.hoverBg;
|
|
66
|
+
},
|
|
67
|
+
disabledColor: '#b6bec2',
|
|
68
|
+
subTitleColor: '#5e686f'
|
|
69
|
+
},
|
|
70
|
+
title: {
|
|
71
|
+
get color() {
|
|
72
|
+
return theme.color.title;
|
|
69
73
|
}
|
|
70
74
|
},
|
|
71
75
|
active: {
|
|
@@ -106,16 +110,12 @@ setDefault(function () {
|
|
|
106
110
|
});
|
|
107
111
|
export { menu };
|
|
108
112
|
export var makeMenuStyles = cache(function makeMenuStyles(k) {
|
|
109
|
-
var _context;
|
|
110
113
|
// we must increase the priority by adding &.${k}-menu
|
|
111
114
|
// to override the css of dropdownMenu
|
|
112
|
-
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";font-size:", menu.header.fontSize, ";font-weight:bold;border-
|
|
113
|
-
var styles = menu[theme];
|
|
114
|
-
return /*#__PURE__*/css("&.", k, "-", theme, "{background:", styles.bgColor, ";.", k, "-menu-header{color:", styles.item.color, ";border-bottom:", styles.border, ";}.", k, "-menu-item{.", k, "-menu-title{color:", styles.item.color, ";&:hover{color:", styles.item.hoverColor, ";}}&.", k, "-highlighted{>.", k, "-menu-title{color:", styles.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-title{color:", styles.item.disabledColor, "!important;}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", styles.subBgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", styles.border, ";}}}");
|
|
115
|
-
}), " &.", k, "-white{.", k, "-menu-item.", k, "-active{>.", k, "-menu-title{color:", menu.white.active.color, "!important;background:", menu.white.active.bgColor, ";}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
115
|
+
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 21px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100vh - ", menu.header.height, ");overflow-y:auto;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border:1px solid ", theme.color.disabledBg, ";background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
116
116
|
var styles = menu[size];
|
|
117
|
-
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}}");
|
|
118
|
-
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + ", getLeft(menu.item.padding), " * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-arrow{display:none;}}&.", k, "-dropdown-menu{width:
|
|
117
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}.", k, "-menu-arrow-box{left:calc(", styles.width, " - 2px);}}");
|
|
118
|
+
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
|
|
119
119
|
});
|
|
120
120
|
export var makeTitleStyles = cache(function makeTitleStyles(k) {
|
|
121
121
|
var item = menu.item;
|
|
@@ -123,12 +123,12 @@ export var makeTitleStyles = cache(function makeTitleStyles(k) {
|
|
|
123
123
|
});
|
|
124
124
|
export var makeItemStyles = cache(function makeItemStyles(k) {
|
|
125
125
|
var item = menu.item;
|
|
126
|
-
return /*#__PURE__*/css(".", k, "-menu-title{cursor:pointer;height:", item.height, ";&:hover{
|
|
126
|
+
return /*#__PURE__*/css(".", k, "-menu-item-title{transition:all ", menu.transition, ";cursor:pointer;height:", item.height, ";&:hover{padding:", item.padding, ";border-radius:", menu.borderRadius, ";background:#2a2a30;}&>.", k, "-menu-item-arrow:before{font-size:small;}}.", k, "-menu-name{flex:1;display:flex;align-items:center;min-width:0;span{overflow:hidden;text-overflow:ellipsis;min-width:0;}.", k, "-icon{color:inherit;}}.", k, "-menu-item-arrow{color:", item.color, ";margin:0 0 0 ", menu.icon.gap, ";transition:transform ", menu.transition, ";}&.", k, "-expanded{>.", k, "-menu-item-title{color:", item.hoverColor, ";.", k, "-menu-item-arrow{transform:rotate(180deg);}}}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-active{>.", k, "-menu-item-title{border-radius:", menu.borderRadius, ";color:", item.activeBgColor, "!important;background:", item.hoverBgColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", item.disabledColor, "!important;cursor:not-allowed;}}.", k, "-menu-dot{font-size:", item.dotFontSize, ";transform:scale(.4);}");
|
|
127
127
|
});
|
|
128
128
|
export var makeNestedMenuStyles = cache(function makeNestedMenuStyles(k, hasIcon, parentPaddingLeft) {
|
|
129
129
|
if (parentPaddingLeft === void 0) {
|
|
130
130
|
parentPaddingLeft = getLeft(menu.item.padding);
|
|
131
131
|
}
|
|
132
|
-
var paddingLeft = "" + parentPaddingLeft + (hasIcon ? ' + ' + menu.icon.width
|
|
133
|
-
return [/*#__PURE__*/css("&.", k, "-menu{width:auto;background:", menu.
|
|
132
|
+
var paddingLeft = "" + parentPaddingLeft + (hasIcon ? ' + ' + menu.icon.width + ' + ' + menu.icon.gap : '');
|
|
133
|
+
return [/*#__PURE__*/css("&.", k, "-menu{position:relative;width:auto;background:", menu.bgColor, ";border:none;.", k, "-menu-body{padding:0;.", k, "-menu-item-title{padding-left:calc(", paddingLeft, ");}.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.item.subTitleColor, ";}}}"), paddingLeft];
|
|
134
134
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import { Component, inject } from 'intact-react';
|
|
4
|
+
import { ROOT_MENU } from './menu';
|
|
5
|
+
import template from './title.vdt';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
7
|
+
export var MenuTitle = /*#__PURE__*/function (_Component) {
|
|
8
|
+
_inheritsLoose(MenuTitle, _Component);
|
|
9
|
+
function MenuTitle() {
|
|
10
|
+
var _context;
|
|
11
|
+
var _this;
|
|
12
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
args[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
16
|
+
_this.rootMenu = inject(ROOT_MENU);
|
|
17
|
+
_this.config = useConfigContext();
|
|
18
|
+
return _this;
|
|
19
|
+
}
|
|
20
|
+
return MenuTitle;
|
|
21
|
+
}(Component);
|
|
22
|
+
MenuTitle.template = template;
|
|
@@ -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;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Children, TypeDefs } from 'intact-react';
|
|
2
|
+
import { Option } from './option';
|
|
3
|
+
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from './base';
|
|
4
|
+
export interface SelectProps<T = string, Multipe extends boolean = boolean> extends BaseSelectProps<T, Multipe> {
|
|
5
|
+
filter?: (keywords: string, props: any) => boolean;
|
|
6
|
+
searchable?: boolean;
|
|
7
|
+
creatable?: boolean;
|
|
8
|
+
labelMap?: Map<any, Children>;
|
|
9
|
+
card?: boolean;
|
|
10
|
+
autoDisableArrow?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SelectEvents extends BaseSelectEvents {
|
|
13
|
+
}
|
|
14
|
+
export interface SelectBlocks<T> extends BaseSelectBlocks<T> {
|
|
15
|
+
menu: null;
|
|
16
|
+
}
|
|
17
|
+
export declare class Select<T = string, Multipe extends boolean = false> extends BaseSelect<SelectProps<T, Multipe>, SelectEvents, SelectBlocks<T>> {
|
|
18
|
+
static template: string | import('intact-react').Template<any>;
|
|
19
|
+
static typeDefs: Required<TypeDefs<SelectProps<string, boolean>>>;
|
|
20
|
+
static defaults: () => Partial<SelectProps<string, boolean>>;
|
|
21
|
+
filterable: {
|
|
22
|
+
getCreatedVNode: (children: (string | number | import('intact-react').VNode<import('intact-react').VNodeTag>)[]) => import('intact-react').VNode<typeof Option> | undefined;
|
|
23
|
+
filter: (children: Children) => Children;
|
|
24
|
+
};
|
|
25
|
+
label: {
|
|
26
|
+
getLabel: () => Children;
|
|
27
|
+
activeIndices: import('intact-react').NonNullableRefObject<number[]>;
|
|
28
|
+
};
|
|
29
|
+
init(): void;
|
|
30
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
|
|
31
|
+
protected getLabel(): Children;
|
|
32
|
+
private getAllShowedValues;
|
|
33
|
+
}
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
|
-
Provider: import("
|
|
3
|
-
Consumer: import("
|
|
4
|
-
useContext: () => import("
|
|
2
|
+
Provider: import("misstime").ComponentConstructor<import('intact-react').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
|
+
Consumer: import("misstime").ComponentConstructor<import('intact-react').Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
|
+
useContext: () => import("misstime").RefObject<any>;
|
|
5
5
|
};
|
|
@@ -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 {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TypeDefs } from 'intact-react';
|
|
2
|
+
import { BasePicker } from '../datepicker/basepicker';
|
|
3
|
+
import dayjs from '../datepicker/dayjs';
|
|
4
|
+
import { State } from '../../hooks/useState';
|
|
5
|
+
import { PanelTypes } from '../datepicker/usePanel';
|
|
6
|
+
import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
|
|
7
|
+
export declare class PanelPicker<Multipe extends boolean = false, Range extends boolean = false> extends BasePicker<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks> {
|
|
8
|
+
static template: string | import('intact-react').Template<any>;
|
|
9
|
+
static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
|
|
10
|
+
formats: {
|
|
11
|
+
getValueFormat: () => string;
|
|
12
|
+
getShowFormat: () => string;
|
|
13
|
+
createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
14
|
+
createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
15
|
+
getShowString: (value: dayjs.Dayjs) => string;
|
|
16
|
+
getValueString: (value: dayjs.Dayjs) => string;
|
|
17
|
+
};
|
|
18
|
+
disabled: {
|
|
19
|
+
isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
|
|
20
|
+
isDisabledConfirm: () => boolean;
|
|
21
|
+
maxDate: State<dayjs.Dayjs | null>;
|
|
22
|
+
minDate: State<dayjs.Dayjs | null>;
|
|
23
|
+
isDisabledTime: (value: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
24
|
+
isDisabledTimeByStep: (value: string, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
25
|
+
};
|
|
26
|
+
panel: {
|
|
27
|
+
startPanel: State<PanelTypes>;
|
|
28
|
+
endPanel: State<PanelTypes>;
|
|
29
|
+
changePanel: (type: PanelTypes, flag?: import("../datepicker/usePanel").PanelFlags) => void;
|
|
30
|
+
getPanel: (flag: import("../datepicker/usePanel").PanelFlags) => State<PanelTypes>;
|
|
31
|
+
reset: () => void;
|
|
32
|
+
startRef: import('intact-react').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
33
|
+
endRef: import('intact-react').RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
34
|
+
};
|
|
35
|
+
value: {
|
|
36
|
+
format: () => string | string[];
|
|
37
|
+
onConfirm: () => void;
|
|
38
|
+
getTimeValue: (flag: import("../datepicker/usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
39
|
+
convertToDayjs: (v: import("../datepicker/basepicker").Value | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value] | import("../datepicker/basepicker").Value[] | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value][] | null | undefined) => import("../datepicker/basepicker").DayjsValue;
|
|
40
|
+
value: State<import("../datepicker/basepicker").StateValue>;
|
|
41
|
+
setValue: (v: import("../datepicker/basepicker").StateValueItem, fromInput: boolean) => void;
|
|
42
|
+
getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
|
|
43
|
+
onChangeTime: (date: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
44
|
+
onChangeTimeByStep: (v: string, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
45
|
+
};
|
|
46
|
+
step: {
|
|
47
|
+
options: State<{
|
|
48
|
+
value: string;
|
|
49
|
+
label: string;
|
|
50
|
+
}[] | null>;
|
|
51
|
+
};
|
|
52
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-react').Children[];
|
|
53
|
+
protected getLabel(): string | string[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TypeDefs, Children, Key } from 'intact-react';
|
|
2
|
+
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
3
|
+
import { TreeProps } from '../tree';
|
|
4
|
+
import type { DataItem } from '../tree/useNodes';
|
|
5
|
+
export interface TreeSelectProps<K extends Key = Key, Multipe extends boolean = boolean, Checkbox extends boolean = boolean> extends BaseSelectProps<K, Multipe, Checkbox extends true ? K[] : K | null> {
|
|
6
|
+
data?: TreeProps<K>['data'];
|
|
7
|
+
uncorrelated?: boolean;
|
|
8
|
+
load?: TreeProps<K>['load'];
|
|
9
|
+
showLine?: boolean;
|
|
10
|
+
defaultExpandAll?: boolean;
|
|
11
|
+
checkbox?: Checkbox;
|
|
12
|
+
filter?: (keywords: string, data: DataItem<K>) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface TreeSelectEvents extends BaseSelectEvents {
|
|
15
|
+
}
|
|
16
|
+
export interface TreeSelectBlocks<K> extends BaseSelectBlocks<K> {
|
|
17
|
+
}
|
|
18
|
+
export declare class TreeSelect<K extends Key = Key, Checkbox extends boolean = false, Multipe extends boolean = Checkbox extends true ? true : false> extends BaseSelect<TreeSelectProps<K, Multipe, Checkbox>, TreeSelectEvents, TreeSelectBlocks<K>> {
|
|
19
|
+
static template: string | import('intact-react').Template<any>;
|
|
20
|
+
static typeDefs: Required<TypeDefs<TreeSelectProps<Key, boolean, boolean>>>;
|
|
21
|
+
static defaults: () => Partial<TreeSelectProps<Key, boolean, boolean>>;
|
|
22
|
+
private value;
|
|
23
|
+
init(): void;
|
|
24
|
+
expandAll(): void;
|
|
25
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
|
|
26
|
+
protected getLabel(): Children;
|
|
27
|
+
private filter;
|
|
28
|
+
}
|
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',
|