@king-design/intact 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/components/config/index.spec.ts +3 -3
- package/components/datepicker/index.spec.ts +3 -0
- package/components/datepicker/useValue.ts +9 -1
- package/components/layout/aside.vdt +1 -1
- package/components/layout/demos/basic.md +1 -1
- package/components/layout/demos/fix.md +1 -1
- package/components/layout/demos/theme.md +2 -3
- package/components/layout/index.md +1 -1
- package/components/layout/styles.ts +9 -20
- package/components/menu/.DS_Store +0 -0
- package/components/menu/demos/.DS_Store +0 -0
- package/components/menu/demos/collapse.md +4 -1
- package/components/menu/demos/showCollapseArrow.md +93 -0
- package/components/menu/demos/size.md +0 -1
- package/components/menu/demos/theme.md +0 -1
- package/components/menu/index.md +2 -1
- package/components/menu/index.spec.ts +41 -20
- package/components/menu/index.ts +2 -1
- package/components/menu/item.vdt +3 -2
- package/components/menu/menu.ts +10 -0
- package/components/menu/menu.vdt +12 -3
- package/components/menu/styles.ts +195 -88
- package/components/menu/title.ts +12 -0
- package/components/menu/title.vdt +25 -0
- package/components/radio/styles.ts +1 -1
- package/components/select/demos/searchable.md +2 -2
- package/components/select/index.spec.ts +1 -1
- package/components/select/option.vdt +1 -0
- package/components/select/select.ts +4 -1
- package/components/table/column.vdt +5 -3
- package/components/table/demos/sort.md +1 -0
- package/components/table/useSortable.ts +8 -2
- package/es/components/cascader/index.d.ts +45 -0
- package/es/components/config/index.spec.js +22 -14
- package/es/components/datepicker/index.d.ts +63 -0
- package/es/components/datepicker/index.spec.js +10 -5
- package/es/components/datepicker/useValue.js +9 -1
- package/es/components/diagram/index.d.ts +1 -1
- package/es/components/layout/aside.vdt.js +1 -1
- package/es/components/layout/styles.js +2 -17
- package/es/components/menu/index.d.ts +1 -0
- package/es/components/menu/index.js +2 -1
- package/es/components/menu/index.spec.js +59 -28
- package/es/components/menu/item.vdt.js +3 -3
- package/es/components/menu/menu.d.ts +2 -0
- package/es/components/menu/menu.js +12 -1
- package/es/components/menu/menu.vdt.js +9 -4
- package/es/components/menu/styles.d.ts +15 -12
- package/es/components/menu/styles.js +38 -38
- package/es/components/menu/title.d.ts +7 -0
- package/es/components/menu/title.js +22 -0
- package/es/components/menu/title.vdt.js +25 -0
- package/es/components/radio/styles.js +1 -1
- package/es/components/select/index.spec.js +1 -1
- package/es/components/select/option.vdt.js +1 -0
- package/es/components/select/select.d.ts +33 -0
- package/es/components/select/select.js +4 -1
- package/es/components/steps/context.d.ts +3 -3
- package/es/components/table/column.vdt.js +6 -6
- package/es/components/table/useSortable.d.ts +7 -3
- package/es/components/table/useSortable.js +5 -1
- package/es/components/timepicker/panelPicker.d.ts +54 -0
- package/es/components/treeSelect/index.d.ts +28 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/packages/kpc-react/__tests__/components/drawer.spec.js +4 -4
- package/es/site/data/components/layout/demos/basic/react.js +2 -2
- package/es/site/data/components/layout/demos/fix/react.js +2 -2
- package/es/site/data/components/layout/demos/theme/index.js +1 -1
- package/es/site/data/components/layout/demos/theme/react.js +4 -6
- package/es/site/data/components/menu/demos/collapse/react.d.ts +1 -1
- package/es/site/data/components/menu/demos/collapse/react.js +12 -2
- package/es/site/data/components/menu/demos/showCollapseArrow/index.d.ts +10 -0
- package/es/site/data/components/menu/demos/showCollapseArrow/index.js +23 -0
- package/es/site/data/components/menu/demos/showCollapseArrow/react.d.ts +10 -0
- package/es/site/data/components/menu/demos/showCollapseArrow/react.js +117 -0
- package/es/site/data/components/menu/demos/size/react.d.ts +1 -1
- package/es/site/data/components/menu/demos/size/react.js +1 -3
- package/es/site/data/components/menu/demos/theme/react.js +1 -3
- package/es/site/data/components/select/demos/searchable/react.js +4 -2
- package/es/site/data/components/table/demos/sort/react.js +2 -1
- package/es/styles/theme.js +1 -2
- package/index.ts +2 -2
- package/package.json +2 -3
- package/styles/theme.ts +1 -2
|
@@ -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';
|
|
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';
|
|
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';
|
|
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").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").VNode<import("intact").VNodeTag>)[]) => import("intact").VNode<typeof Option> | undefined;
|
|
23
|
+
filter: (children: Children) => Children;
|
|
24
|
+
};
|
|
25
|
+
label: {
|
|
26
|
+
getLabel: () => Children;
|
|
27
|
+
activeIndices: import("intact").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").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
|
+
Consumer: import("misstime").ComponentConstructor<import("intact").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").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
6
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
7
|
useContext: () => import("intact").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';
|
|
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").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").RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
33
|
+
endRef: import("intact").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").Children[];
|
|
53
|
+
protected getLabel(): string | string[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TypeDefs, Children, Key } from 'intact';
|
|
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").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/es/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,4 +60,4 @@ 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";
|
package/es/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,5 +61,5 @@ 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 */
|
|
@@ -12,10 +12,10 @@ describe('Drawer', function () {
|
|
|
12
12
|
container = document.createElement('div');
|
|
13
13
|
document.body.appendChild(container);
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
afterEach(function () {
|
|
16
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
17
|
+
document.body.removeChild(container);
|
|
18
|
+
});
|
|
19
19
|
it('should render react element correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
20
20
|
var Test, App;
|
|
21
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -97,8 +97,8 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
97
97
|
className: "ion-star"
|
|
98
98
|
}), "menu 2"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
99
99
|
key: "3"
|
|
100
|
-
}, /*#__PURE__*/React.createElement(
|
|
101
|
-
className: "
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
+
className: "ion-heart"
|
|
102
102
|
}), "menu 3", /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem, {
|
|
103
103
|
key: "3-1"
|
|
104
104
|
}, "sub menu 1"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
@@ -93,8 +93,8 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
93
93
|
className: "ion-star"
|
|
94
94
|
}), "menu 2"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
95
95
|
key: "3"
|
|
96
|
-
}, /*#__PURE__*/React.createElement(
|
|
97
|
-
className: "
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
97
|
+
className: "ion-heart"
|
|
98
98
|
}), "menu 3", /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem, {
|
|
99
99
|
key: "3-1"
|
|
100
100
|
}, "sub menu 1"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
@@ -15,7 +15,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
15
15
|
_this.state = {
|
|
16
16
|
expandedKeys: [],
|
|
17
17
|
selectedKey: '3-1',
|
|
18
|
-
theme: '
|
|
18
|
+
theme: 'light'
|
|
19
19
|
};
|
|
20
20
|
return _this;
|
|
21
21
|
}
|
|
@@ -90,8 +90,8 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
90
90
|
className: "ion-star"
|
|
91
91
|
}), "menu 2"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
92
92
|
key: "3"
|
|
93
|
-
}, /*#__PURE__*/React.createElement(
|
|
94
|
-
className: "
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
94
|
+
className: "ion-heart"
|
|
95
95
|
}), "menu 3", /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem, {
|
|
96
96
|
key: "3-1"
|
|
97
97
|
}, "sub menu 1"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
@@ -117,9 +117,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
117
117
|
value: "light"
|
|
118
118
|
}, "light"), /*#__PURE__*/React.createElement(Button, {
|
|
119
119
|
value: "dark"
|
|
120
|
-
}, "dark")
|
|
121
|
-
value: "white"
|
|
122
|
-
}, "white")))));
|
|
120
|
+
}, "dark")))));
|
|
123
121
|
};
|
|
124
122
|
return Demo;
|
|
125
123
|
}(React.Component);
|
|
@@ -3,7 +3,7 @@ import { MenuProps } from '@king-design/react';
|
|
|
3
3
|
interface Props extends MenuProps {
|
|
4
4
|
}
|
|
5
5
|
export default class Demo extends React.Component<{}, Props> {
|
|
6
|
-
state: MenuProps<import("
|
|
6
|
+
state: MenuProps<import("misstime").Key>;
|
|
7
7
|
private __test;
|
|
8
8
|
setTheme(theme?: string): void;
|
|
9
9
|
render(): React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
3
|
import { __decorate } from "tslib";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { Menu, MenuItem, Switch, Icon } from '@king-design/react';
|
|
5
|
+
import { Menu, MenuItem, MenuTitle, Switch, Icon } from '@king-design/react';
|
|
6
6
|
import { bind } from '@king-design/react';
|
|
7
7
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
8
8
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -100,7 +100,17 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
100
100
|
to: "/"
|
|
101
101
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
102
102
|
className: "ion-gear-b"
|
|
103
|
-
}), "menu 4")
|
|
103
|
+
}), "menu 4"), /*#__PURE__*/React.createElement(MenuTitle, null, /*#__PURE__*/React.createElement(Icon, {
|
|
104
|
+
className: "ion-cloud"
|
|
105
|
+
}), "menu 5"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
106
|
+
key: "5-1"
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
108
|
+
className: "ion-stats-bars"
|
|
109
|
+
}), "sub menu 1"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
110
|
+
key: "5-2"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
112
|
+
className: "ion-upload"
|
|
113
|
+
}), "sub menu 2")));
|
|
104
114
|
};
|
|
105
115
|
return Demo;
|
|
106
116
|
}(React.Component);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
import type { MenuProps } from 'kpc';
|
|
5
|
+
interface Props extends MenuProps {
|
|
6
|
+
}
|
|
7
|
+
export default class extends Component<Props> {
|
|
8
|
+
static template: string | import("intact").Template<any>;
|
|
9
|
+
static defaults(): MenuProps<import("intact").Key>;
|
|
10
|
+
}
|
|
@@ -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
|
+
import './index.styl';
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
function default_1() {
|
|
9
|
+
return _Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
default_1.defaults = function defaults() {
|
|
12
|
+
return {
|
|
13
|
+
expandedKeys: [],
|
|
14
|
+
selectedKey: '2',
|
|
15
|
+
size: 'default',
|
|
16
|
+
theme: 'light',
|
|
17
|
+
showCollapseArrow: false
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
return default_1;
|
|
21
|
+
}(Component);
|
|
22
|
+
default_1.template = template;
|
|
23
|
+
export { default_1 as default };
|