@king-design/intact 3.1.3 → 3.1.4-beta.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/button/demos/disabled.md +2 -2
- package/components/button/demos/ghost.md +3 -3
- package/components/button/demos/group.md +3 -3
- package/components/button/index.vdt +1 -1
- package/components/button/styles.ts +19 -0
- package/components/config/demos/basic.md +17 -1
- package/components/editable/styles.ts +1 -1
- package/components/message/message.ts +10 -6
- package/components/message/message.vdt +1 -1
- package/components/message/messages.ts +10 -1
- package/components/message/messages.vdt +11 -8
- package/es/components/button/index.vdt.js +1 -1
- package/es/components/button/styles.js +3 -3
- package/es/components/diagram/index.d.ts +1 -1
- package/es/components/editable/styles.js +1 -1
- package/es/components/message/message.d.ts +1 -0
- package/es/components/message/message.js +12 -10
- package/es/components/message/message.vdt.js +2 -1
- package/es/components/message/messages.d.ts +5 -1
- package/es/components/message/messages.js +5 -1
- package/es/components/message/messages.vdt.js +13 -7
- package/es/components/steps/context.d.ts +3 -3
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/react.js +3 -3
- package/es/site/data/components/button/demos/ghost/react.js +7 -3
- package/es/site/data/components/button/demos/group/react.js +5 -5
- package/es/site/data/components/config/demos/basic/index.d.ts +1 -0
- package/es/site/data/components/config/demos/basic/index.js +8 -0
- package/es/site/data/components/config/demos/basic/react.d.ts +1 -0
- package/es/site/data/components/config/demos/basic/react.js +9 -1
- package/es/site/data/components/menu/demos/collapse/react.d.ts +11 -0
- package/es/site/data/components/menu/demos/size/react.d.ts +7 -0
- package/index.ts +2 -2
- package/package.json +3 -3
- package/es/components/cascader/index.d.ts +0 -45
- package/es/components/datepicker/index.d.ts +0 -63
- package/es/components/select/select.d.ts +0 -33
- package/es/components/timepicker/panelPicker.d.ts +0 -54
- package/es/components/treeSelect/index.d.ts +0 -28
|
@@ -6,12 +6,12 @@ order: 5
|
|
|
6
6
|
添加`disabled`属性,可以禁用按钮
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Button} from 'kpc';
|
|
9
|
+
import {Button, Icon} from 'kpc';
|
|
10
10
|
|
|
11
11
|
<div>
|
|
12
12
|
<Button disabled>disabled</Button>
|
|
13
13
|
<Button disabled type="none">disabled text</Button>
|
|
14
|
-
<Button disabled icon circle><
|
|
14
|
+
<Button disabled icon circle><Icon class="k-icon-search" /></Button>
|
|
15
15
|
<Button disabled type="link">link</Button>
|
|
16
16
|
<Button disabled type="flat">flat</Button>
|
|
17
17
|
</div>
|
|
@@ -6,11 +6,11 @@ order: 6
|
|
|
6
6
|
给组件添加`ghost`属性,可以展示透明背景的按钮,常用于深色背景下
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Button} from 'kpc';
|
|
9
|
+
import {Button, Icon} from 'kpc';
|
|
10
10
|
|
|
11
11
|
<div class="wrapper">
|
|
12
|
-
<Button ghost
|
|
13
|
-
<Button type="primary" ghost>primay
|
|
12
|
+
<Button ghost><Icon class="k-icon-left" />default</Button>
|
|
13
|
+
<Button type="primary" ghost>primay<Icon class="k-icon-right" /></Button>
|
|
14
14
|
<Button type="warning" ghost>warning</Button>
|
|
15
15
|
<Button type="danger" ghost>danger</Button>
|
|
16
16
|
<Button type="success" ghost>success</Button>
|
|
@@ -7,7 +7,7 @@ order: 1
|
|
|
7
7
|
可以是按钮组纵向排列。给`ButtonGroup`添加`checkType`属性,可以使按钮组拥有单选或复选能力。
|
|
8
8
|
|
|
9
9
|
```vdt
|
|
10
|
-
import {Button, ButtonGroup} from 'kpc';
|
|
10
|
+
import {Button, ButtonGroup, Icon} from 'kpc';
|
|
11
11
|
|
|
12
12
|
<div>
|
|
13
13
|
<ButtonGroup>
|
|
@@ -27,10 +27,10 @@ import {Button, ButtonGroup} from 'kpc';
|
|
|
27
27
|
</ButtonGroup>
|
|
28
28
|
<ButtonGroup>
|
|
29
29
|
<Button type="primary">
|
|
30
|
-
<
|
|
30
|
+
<Icon class="k-icon-left" />上一页
|
|
31
31
|
</Button>
|
|
32
32
|
<Button type="primary">
|
|
33
|
-
下一页<
|
|
33
|
+
下一页<Icon class="k-icon-right" />
|
|
34
34
|
</Button>
|
|
35
35
|
</ButtonGroup>
|
|
36
36
|
<br /><br />
|
|
@@ -41,8 +41,8 @@ if (!icon && Array.isArray(children)) {
|
|
|
41
41
|
|
|
42
42
|
const classNameObj = {
|
|
43
43
|
[cls('btn')]: true,
|
|
44
|
-
[cls(type)]: type !== 'default',
|
|
45
44
|
[cls(size)]: size !== 'default',
|
|
45
|
+
[cls(type)]: true,
|
|
46
46
|
[cls(`btn-icon`)]: icon,
|
|
47
47
|
[className]: className,
|
|
48
48
|
[cls('circle')]: circle,
|
|
@@ -182,6 +182,19 @@ export const makeButtonStyles = cache(function makeButtonStyles(k: string, iconS
|
|
|
182
182
|
.${k}-icon {
|
|
183
183
|
color: inherit;
|
|
184
184
|
}
|
|
185
|
+
&.${k}-default,
|
|
186
|
+
&.${k}-none,
|
|
187
|
+
&.${k}-flat {
|
|
188
|
+
.${k}-icon {
|
|
189
|
+
color: ${theme.color.lightBlack};
|
|
190
|
+
}
|
|
191
|
+
&:hover {
|
|
192
|
+
.${k}-icon {
|
|
193
|
+
color: inherit;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
185
198
|
&:hover,
|
|
186
199
|
&:focus {
|
|
187
200
|
border-color: ${button.hoverBorderColor};
|
|
@@ -262,6 +275,9 @@ export const makeButtonStyles = cache(function makeButtonStyles(k: string, iconS
|
|
|
262
275
|
|
|
263
276
|
// disabled
|
|
264
277
|
&.${k}-disabled {
|
|
278
|
+
.${k}-icon {
|
|
279
|
+
color: inherit;
|
|
280
|
+
}
|
|
265
281
|
&, &:hover {
|
|
266
282
|
color: ${button.disabled.color};
|
|
267
283
|
background: ${button.disabled.bgColor};
|
|
@@ -347,6 +363,9 @@ export const makeButtonStyles = cache(function makeButtonStyles(k: string, iconS
|
|
|
347
363
|
background: transparent;
|
|
348
364
|
color: ${button.ghost.color};
|
|
349
365
|
border-color: ${button.ghost.borderColor};
|
|
366
|
+
.${k}-icon {
|
|
367
|
+
color: inherit;
|
|
368
|
+
}
|
|
350
369
|
&:hover,
|
|
351
370
|
&:active {
|
|
352
371
|
background: transparent;
|
|
@@ -7,13 +7,29 @@ order: 0
|
|
|
7
7
|
|
|
8
8
|
> 本例中,我们将前缀设为`kd`,可以打开调试工具查看
|
|
9
9
|
|
|
10
|
+
> 对于`Message`组件,由于它是静态方法调用,我们可以通过`Message.classNamePrefix`设置样式名前缀
|
|
11
|
+
|
|
10
12
|
```vdt
|
|
11
13
|
import {ConfigProvider, Button, Input} from 'kpc';
|
|
12
14
|
|
|
13
15
|
<ConfigProvider value={{classNamePrefix: 'kd'}}>
|
|
14
|
-
<Button>Button</Button>
|
|
16
|
+
<Button ev-click={this.showMessage}>Button</Button>
|
|
15
17
|
<div style="margin-top: 8px;">
|
|
16
18
|
<Input />
|
|
17
19
|
</div>
|
|
18
20
|
</ConfigProvider>
|
|
19
21
|
```
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {Message} from 'kpc';
|
|
25
|
+
|
|
26
|
+
Message.classNamePrefix = 'kd';
|
|
27
|
+
|
|
28
|
+
export default class extends Component {
|
|
29
|
+
static template = template;
|
|
30
|
+
|
|
31
|
+
showMessage() {
|
|
32
|
+
Message.info('Message with classNamePrefix');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -43,24 +43,28 @@ export class Message extends Component<MessageProps> {
|
|
|
43
43
|
static template = template;
|
|
44
44
|
static typeDefs = typeDefs;
|
|
45
45
|
static defaults = defaults;
|
|
46
|
+
static classNamePrefix: string;
|
|
46
47
|
|
|
47
48
|
static notice(
|
|
48
49
|
content: Children | Partial<MessageProps>,
|
|
49
50
|
duration: number = 3000,
|
|
50
51
|
type: MessageProps['type'] ='info'
|
|
51
52
|
) {
|
|
52
|
-
if (!messages) {
|
|
53
|
-
const container = document.createElement('div');
|
|
54
|
-
document.body.append(container);
|
|
55
|
-
render(h(Messages, {ref: i => messages = i}), container);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
53
|
if (isObject(content) && !(content as any).tag) {
|
|
59
54
|
content = {...content, type, key: id++} as Partial<Props<MessageProps>>;
|
|
60
55
|
} else {
|
|
61
56
|
content = {content, duration, type, key: id++} as Partial<Props<MessageProps>>;
|
|
62
57
|
}
|
|
63
58
|
|
|
59
|
+
if (!messages) {
|
|
60
|
+
const container = document.createElement('div');
|
|
61
|
+
document.body.append(container);
|
|
62
|
+
render(h(Messages, {
|
|
63
|
+
ref: (i: Messages | null) => messages = i,
|
|
64
|
+
classNamePrefix: Message.classNamePrefix,
|
|
65
|
+
} as any), container);
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
messages!.notice(h(Message, content));
|
|
65
69
|
}
|
|
66
70
|
static info(content: Children | Partial<MessageProps>, duration?: number) {
|
|
@@ -3,7 +3,7 @@ import {Icon} from '../icon';
|
|
|
3
3
|
import {getRestProps} from '../utils';
|
|
4
4
|
import {makeMessageStyles} from './styles';
|
|
5
5
|
|
|
6
|
-
const {type, content, children, closable, hideIcon} = this.get();
|
|
6
|
+
const {type, content, children, closable, hideIcon, classNamePrefix} = this.get();
|
|
7
7
|
const { k } = this.config;
|
|
8
8
|
|
|
9
9
|
const classNameObj = {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import {Component, VNodeComponentClass} from 'intact';
|
|
1
|
+
import {Component, VNodeComponentClass, TypeDefs} from 'intact';
|
|
2
2
|
import template from './messages.vdt';
|
|
3
3
|
import type {Message} from './message';
|
|
4
4
|
import { useConfigContext } from '../config';
|
|
5
5
|
|
|
6
|
+
export interface MessagesProps {
|
|
7
|
+
classNamePrefix?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const typeDefs: Required<TypeDefs<MessagesProps>> = {
|
|
11
|
+
classNamePrefix: String,
|
|
12
|
+
};
|
|
13
|
+
|
|
6
14
|
export class Messages extends Component {
|
|
7
15
|
static template = template;
|
|
16
|
+
static typeDefs = typeDefs;
|
|
8
17
|
|
|
9
18
|
private messages: VNodeComponentClass<Message>[] = [];
|
|
10
19
|
private config = useConfigContext();
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {TransitionGroup, Transition} from 'intact';
|
|
2
2
|
import {makeMessagesStyles} from './styles';
|
|
3
|
+
import { ConfigProvider } from '../config';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
const k = this.get('classNamePrefix') || this.config.k;
|
|
5
6
|
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
{$value}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</
|
|
7
|
+
<ConfigProvider value={{classNamePrefix: k}}>
|
|
8
|
+
<div class={{[`${k}-messages`]: true, [makeMessagesStyles(k)]: true}}>
|
|
9
|
+
<TransitionGroup>
|
|
10
|
+
<template v-for={this.messages} key={$value.key}>
|
|
11
|
+
{$value}
|
|
12
|
+
</template>
|
|
13
|
+
</TransitionGroup>
|
|
14
|
+
</div>
|
|
15
|
+
</ConfigProvider>
|
|
@@ -60,7 +60,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(
|
|
63
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = true, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('disabled')] = disabled || loading, _classNameObj[cls('ghost')] = ghost, _classNameObj[makeButtonStyles(k, iconSide)] = true, _classNameObj);
|
|
64
64
|
|
|
65
65
|
var loadingIcon = _$cc(Icon, {
|
|
66
66
|
'className': _$cn("ion-load-c " + k + "-icon-loading"),
|
|
@@ -242,16 +242,16 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide) {
|
|
|
242
242
|
return cx(
|
|
243
243
|
/*#__PURE__*/
|
|
244
244
|
// extract static styles to individual css method for performance
|
|
245
|
-
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";.", k, "-icon{color:inherit;}&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.", k, "-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
|
|
245
|
+
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";.", k, "-icon{color:inherit;}&.", k, "-default,&.", k, "-none,&.", k, "-flat{.", k, "-icon{color:", theme.color.lightBlack, ";}&:hover{.", k, "-icon{color:inherit;}}}&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.", k, "-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
|
|
246
246
|
var typeStyles = button[type];
|
|
247
247
|
return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}}");
|
|
248
|
-
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}&.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
248
|
+
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}&.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
249
249
|
var styles = button[size];
|
|
250
250
|
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.", k, "-btn-icon{width:", styles.height, ";}}");
|
|
251
251
|
}), "&.", k, "-btn-icon{width:", button.height, ";padding:0;.", k, "-icon{margin:0;}}&.", k, "-fluid{width:100%;padding:0;}&.", k, "-circle{border-radius:calc(", button.large.height, " / 2);}&.", k, "-loading{", _mapInstanceProperty(types).call(types, function (type) {
|
|
252
252
|
var styles = button[type];
|
|
253
253
|
return /*#__PURE__*/css("&.", k, "-", type, "{&,&:hover{background:", palette(styles.bgColor, -2), ";color:", palette(styles.color, -2), ";border-color:", palette(styles.borderColor, -2), ";}}");
|
|
254
|
-
}), ";&,&:hover{background:", palette(button.bgColor, -2), ";color:", palette(button.color, -2), ";border-color:", palette(button.borderColor, -2), ";}.", k, "-icon:not(.", k, "-icon-loading){display:none;}}&:not(button){display:inline-flex;align-items:center;justify-content:center;}&.", k, "-ghost{background:transparent;color:", button.ghost.color, ";border-color:", button.ghost.borderColor, "
|
|
254
|
+
}), ";&,&:hover{background:", palette(button.bgColor, -2), ";color:", palette(button.color, -2), ";border-color:", palette(button.borderColor, -2), ";}.", k, "-icon:not(.", k, "-icon-loading){display:none;}}&:not(button){display:inline-flex;align-items:center;justify-content:center;}&.", k, "-ghost{background:transparent;color:", button.ghost.color, ";border-color:", button.ghost.borderColor, ";.", k, "-icon{color:inherit;}&:hover,&:active{background:transparent;}&:hover{color:", button.ghost.hoverColor, ";border-color:", button.ghost.hoverBorderColor, ";}&:active{color:", theme.color.primary, ";border-color:", theme.color.primary, ";}", _mapInstanceProperty(types).call(types, function (type) {
|
|
255
255
|
var _button$type = button[type],
|
|
256
256
|
ghostColor = _button$type.ghostColor,
|
|
257
257
|
borderColor = _button$type.borderColor;
|
|
@@ -10,7 +10,7 @@ export * from './shapes/rectangle';
|
|
|
10
10
|
export * from './shapes/square';
|
|
11
11
|
export * from './shapes/text';
|
|
12
12
|
export * from './shapes/line';
|
|
13
|
-
declare const DDiamond: import("
|
|
13
|
+
declare const DDiamond: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DTriangle: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCylinder: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCloud: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>;
|
|
14
14
|
export { DDiamond, DTriangle, DCylinder, DCloud };
|
|
15
15
|
export * from './layouts/layout';
|
|
16
16
|
export * from './layouts/circle';
|
|
@@ -22,5 +22,5 @@ setDefault(function () {
|
|
|
22
22
|
});
|
|
23
23
|
export { editable };
|
|
24
24
|
export var makeStyles = cache(function makeStyles(k) {
|
|
25
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-
|
|
25
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-wrapper{border:", editable.invalid.border, "!important;}}");
|
|
26
26
|
});
|
|
@@ -10,6 +10,7 @@ export declare class Message extends Component<MessageProps> {
|
|
|
10
10
|
static template: string | import("intact").Template<any>;
|
|
11
11
|
static typeDefs: Required<TypeDefs<MessageProps>>;
|
|
12
12
|
static defaults: () => Partial<MessageProps>;
|
|
13
|
+
static classNamePrefix: string;
|
|
13
14
|
static notice(content: Children | Partial<MessageProps>, duration?: number, type?: MessageProps['type']): void;
|
|
14
15
|
static info(content: Children | Partial<MessageProps>, duration?: number): void;
|
|
15
16
|
static error(content: Children | Partial<MessageProps>, duration?: number): void;
|
|
@@ -54,16 +54,6 @@ export var Message = /*#__PURE__*/function (_Component) {
|
|
|
54
54
|
type = 'info';
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if (!messages) {
|
|
58
|
-
var container = document.createElement('div');
|
|
59
|
-
document.body.append(container);
|
|
60
|
-
render(h(Messages, {
|
|
61
|
-
ref: function ref(i) {
|
|
62
|
-
return messages = i;
|
|
63
|
-
}
|
|
64
|
-
}), container);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
57
|
if (isObject(content) && !content.tag) {
|
|
68
58
|
content = _extends({}, content, {
|
|
69
59
|
type: type,
|
|
@@ -78,6 +68,17 @@ export var Message = /*#__PURE__*/function (_Component) {
|
|
|
78
68
|
};
|
|
79
69
|
}
|
|
80
70
|
|
|
71
|
+
if (!messages) {
|
|
72
|
+
var container = document.createElement('div');
|
|
73
|
+
document.body.append(container);
|
|
74
|
+
render(h(Messages, {
|
|
75
|
+
ref: function ref(i) {
|
|
76
|
+
return messages = i;
|
|
77
|
+
},
|
|
78
|
+
classNamePrefix: Message.classNamePrefix
|
|
79
|
+
}), container);
|
|
80
|
+
}
|
|
81
|
+
|
|
81
82
|
messages.notice(h(Message, content));
|
|
82
83
|
};
|
|
83
84
|
|
|
@@ -108,5 +109,6 @@ export var Message = /*#__PURE__*/function (_Component) {
|
|
|
108
109
|
Message.template = template;
|
|
109
110
|
Message.typeDefs = typeDefs;
|
|
110
111
|
Message.defaults = defaults;
|
|
112
|
+
Message.classNamePrefix = void 0;
|
|
111
113
|
|
|
112
114
|
__decorate([bind], Message.prototype, "close", null);
|
|
@@ -16,7 +16,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
16
16
|
content = _this$get.content,
|
|
17
17
|
children = _this$get.children,
|
|
18
18
|
closable = _this$get.closable,
|
|
19
|
-
hideIcon = _this$get.hideIcon
|
|
19
|
+
hideIcon = _this$get.hideIcon,
|
|
20
|
+
classNamePrefix = _this$get.classNamePrefix;
|
|
20
21
|
|
|
21
22
|
var k = this.config.k;
|
|
22
23
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-message"] = true, _classNameObj[k + "-" + type] = type, _classNameObj[makeMessageStyles(k)] = true, _classNameObj);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { Component, VNodeComponentClass } from 'intact';
|
|
1
|
+
import { Component, VNodeComponentClass, TypeDefs } from 'intact';
|
|
2
2
|
import type { Message } from './message';
|
|
3
|
+
export interface MessagesProps {
|
|
4
|
+
classNamePrefix?: string;
|
|
5
|
+
}
|
|
3
6
|
export declare class Messages extends Component {
|
|
4
7
|
static template: string | import("intact").Template<any>;
|
|
8
|
+
static typeDefs: Required<TypeDefs<MessagesProps>>;
|
|
5
9
|
private messages;
|
|
6
10
|
private config;
|
|
7
11
|
notice(message: VNodeComponentClass<Message>): void;
|
|
@@ -5,6 +5,9 @@ import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/spl
|
|
|
5
5
|
import { Component } from 'intact';
|
|
6
6
|
import template from './messages.vdt';
|
|
7
7
|
import { useConfigContext } from '../config';
|
|
8
|
+
var typeDefs = {
|
|
9
|
+
classNamePrefix: String
|
|
10
|
+
};
|
|
8
11
|
export var Messages = /*#__PURE__*/function (_Component) {
|
|
9
12
|
_inheritsLoose(Messages, _Component);
|
|
10
13
|
|
|
@@ -48,4 +51,5 @@ export var Messages = /*#__PURE__*/function (_Component) {
|
|
|
48
51
|
|
|
49
52
|
return Messages;
|
|
50
53
|
}(Component);
|
|
51
|
-
Messages.template = template;
|
|
54
|
+
Messages.template = template;
|
|
55
|
+
Messages.typeDefs = typeDefs;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, map as _$ma, className as _$cn } from 'intact';
|
|
2
2
|
import { TransitionGroup, Transition } from 'intact';
|
|
3
3
|
import { makeMessagesStyles } from './styles';
|
|
4
|
+
import { ConfigProvider } from '../config';
|
|
4
5
|
export default function ($props, $blocks, $__proto__) {
|
|
5
6
|
var _$cn2;
|
|
6
7
|
|
|
7
8
|
$blocks || ($blocks = {});
|
|
8
9
|
$props || ($props = {});
|
|
9
10
|
var $this = this;
|
|
10
|
-
var k = this.config.k;
|
|
11
|
-
return _$
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
11
|
+
var k = this.get('classNamePrefix') || this.config.k;
|
|
12
|
+
return _$cc(ConfigProvider, {
|
|
13
|
+
'value': {
|
|
14
|
+
classNamePrefix: k
|
|
15
|
+
},
|
|
16
|
+
'children': _$ce(2, 'div', _$cc(TransitionGroup, {
|
|
17
|
+
'children': _$ma(this.messages, function ($value, $key) {
|
|
18
|
+
return $value;
|
|
19
|
+
}, $this)
|
|
20
|
+
}), 2, _$cn((_$cn2 = {}, _$cn2[k + "-messages"] = true, _$cn2[makeMessagesStyles(k)] = true, _$cn2)))
|
|
21
|
+
});
|
|
16
22
|
}
|
|
17
23
|
;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
|
-
Provider: import("
|
|
3
|
-
Consumer: import("
|
|
4
|
-
useContext: () => import("
|
|
2
|
+
Provider: import("vdt").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
|
+
Consumer: import("vdt").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
|
+
useContext: () => import("vdt").RefObject<any>;
|
|
5
5
|
};
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.4-beta.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.1.
|
|
63
|
+
export declare const version = "3.1.4-beta.0";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.4-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -62,5 +62,5 @@ export * from './components/tree';
|
|
|
62
62
|
export * from './components/treeSelect';
|
|
63
63
|
export * from './components/upload';
|
|
64
64
|
export * from './components/wave';
|
|
65
|
-
export var version = '3.1.
|
|
65
|
+
export var version = '3.1.4-beta.0';
|
|
66
66
|
/* generate end */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Button } from '@king-design/react';
|
|
3
|
+
import { Button, Icon } from '@king-design/react';
|
|
4
4
|
|
|
5
5
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
6
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -21,8 +21,8 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
21
21
|
disabled: true,
|
|
22
22
|
icon: true,
|
|
23
23
|
circle: true
|
|
24
|
-
}, /*#__PURE__*/React.createElement(
|
|
25
|
-
className: "k-icon
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
className: "k-icon-search"
|
|
26
26
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
27
27
|
disabled: true,
|
|
28
28
|
type: "link"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Button } from '@king-design/react';
|
|
3
|
+
import { Button, Icon } from '@king-design/react';
|
|
4
4
|
import './index.styl';
|
|
5
5
|
|
|
6
6
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
@@ -17,10 +17,14 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
17
17
|
className: "wrapper"
|
|
18
18
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
19
19
|
ghost: true
|
|
20
|
-
},
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
className: "k-icon-left"
|
|
22
|
+
}), "default"), /*#__PURE__*/React.createElement(Button, {
|
|
21
23
|
type: "primary",
|
|
22
24
|
ghost: true
|
|
23
|
-
}, "primay"
|
|
25
|
+
}, "primay", /*#__PURE__*/React.createElement(Icon, {
|
|
26
|
+
className: "k-icon-right"
|
|
27
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
24
28
|
type: "warning",
|
|
25
29
|
ghost: true
|
|
26
30
|
}, "warning"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Button, ButtonGroup } from '@king-design/react';
|
|
4
|
+
import { Button, ButtonGroup, Icon } from '@king-design/react';
|
|
5
5
|
import './index.styl';
|
|
6
6
|
|
|
7
7
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
@@ -45,12 +45,12 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
45
45
|
type: "flat"
|
|
46
46
|
}, "\u91CD\u542F")), /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, {
|
|
47
47
|
type: "primary"
|
|
48
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
-
className: "k-icon
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
className: "k-icon-left"
|
|
50
50
|
}), "\u4E0A\u4E00\u9875"), /*#__PURE__*/React.createElement(Button, {
|
|
51
51
|
type: "primary"
|
|
52
|
-
}, "\u4E0B\u4E00\u9875", /*#__PURE__*/React.createElement(
|
|
53
|
-
className: "k-icon
|
|
52
|
+
}, "\u4E0B\u4E00\u9875", /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
className: "k-icon-right"
|
|
54
54
|
}))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u7EB5\u5411\u6309\u94AE\u7EC4"), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
55
55
|
vertical: true
|
|
56
56
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -2,6 +2,8 @@ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
|
2
2
|
export { default as data } from './index.json';
|
|
3
3
|
import { Component } from 'intact';
|
|
4
4
|
import template from './index.vdt';
|
|
5
|
+
import { Message } from 'kpc';
|
|
6
|
+
Message.classNamePrefix = 'kd';
|
|
5
7
|
|
|
6
8
|
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
9
|
_inheritsLoose(default_1, _Component);
|
|
@@ -10,6 +12,12 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
10
12
|
return _Component.apply(this, arguments) || this;
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
var _proto = default_1.prototype;
|
|
16
|
+
|
|
17
|
+
_proto.showMessage = function showMessage() {
|
|
18
|
+
Message.info('Message with classNamePrefix');
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
return default_1;
|
|
14
22
|
}(Component);
|
|
15
23
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ConfigProvider, Button, Input } from '@king-design/react';
|
|
4
|
+
import { Message } from '@king-design/react';
|
|
5
|
+
Message.classNamePrefix = 'kd';
|
|
4
6
|
|
|
5
7
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
8
|
_inheritsLoose(Demo, _React$Component);
|
|
@@ -11,12 +13,18 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
11
13
|
|
|
12
14
|
var _proto = Demo.prototype;
|
|
13
15
|
|
|
16
|
+
_proto.showMessage = function showMessage() {
|
|
17
|
+
Message.info('Message with classNamePrefix');
|
|
18
|
+
};
|
|
19
|
+
|
|
14
20
|
_proto.render = function render() {
|
|
15
21
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
16
22
|
value: {
|
|
17
23
|
classNamePrefix: 'kd'
|
|
18
24
|
}
|
|
19
|
-
}, /*#__PURE__*/React.createElement(Button,
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
onClick: this.showMessage
|
|
27
|
+
}, "Button"), /*#__PURE__*/React.createElement("div", {
|
|
20
28
|
style: {
|
|
21
29
|
"marginTop": "8px"
|
|
22
30
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuProps } from '@king-design/react';
|
|
3
|
+
interface Props extends MenuProps {
|
|
4
|
+
}
|
|
5
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
6
|
+
state: MenuProps<import("vdt").Key>;
|
|
7
|
+
private __test;
|
|
8
|
+
setTheme(theme?: string): void;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.4-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -65,6 +65,6 @@ export * from './components/treeSelect';
|
|
|
65
65
|
export * from './components/upload';
|
|
66
66
|
export * from './components/wave';
|
|
67
67
|
|
|
68
|
-
export const version = '3.1.
|
|
68
|
+
export const version = '3.1.4-beta.0';
|
|
69
69
|
|
|
70
70
|
/* generate end */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/intact",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4-beta.0",
|
|
4
4
|
"description": "A component library written in Intact for Intact, Vue, React and Angular",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
"dependencies": {
|
|
180
180
|
"@babel/runtime-corejs3": "^7.16.0",
|
|
181
181
|
"@emotion/css": "^11.5.0",
|
|
182
|
-
"@king-design/react": "^3.1.
|
|
182
|
+
"@king-design/react": "^3.1.4-beta.0",
|
|
183
183
|
"dayjs": "^1.10.7",
|
|
184
184
|
"enquire.js": "^2.1.6",
|
|
185
|
-
"intact": "^3.0.
|
|
185
|
+
"intact": "^3.0.25",
|
|
186
186
|
"monaco-editor": "^0.26.1",
|
|
187
187
|
"mxgraphx": "^4.0.7",
|
|
188
188
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { TypeDefs } from 'intact';
|
|
2
|
-
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
3
|
-
export interface CascaderProps<V = any, Multipe extends boolean = boolean, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelectProps<V[], Multipe> {
|
|
4
|
-
data?: Data[];
|
|
5
|
-
trigger?: 'click' | 'hover';
|
|
6
|
-
changeOnSelect?: boolean;
|
|
7
|
-
format?: (labels: string[]) => string;
|
|
8
|
-
loadData?: (data: Data) => any;
|
|
9
|
-
filter?: (keywords: string, data: Data) => boolean;
|
|
10
|
-
fields?: CascaderFields<Data>;
|
|
11
|
-
}
|
|
12
|
-
export declare type CascaderFields<Data> = {
|
|
13
|
-
value?: keyof Data;
|
|
14
|
-
label?: keyof Data;
|
|
15
|
-
children?: keyof Data;
|
|
16
|
-
disabled?: keyof Data;
|
|
17
|
-
};
|
|
18
|
-
export interface BaseCascaderData {
|
|
19
|
-
loaded?: boolean;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
22
|
-
export interface CascaderData<V> extends BaseCascaderData {
|
|
23
|
-
value: V;
|
|
24
|
-
label: string;
|
|
25
|
-
children?: CascaderData<V>[];
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface CascaderEvents extends BaseSelectEvents {
|
|
29
|
-
}
|
|
30
|
-
export interface CascaderBlocks<V> extends BaseSelectBlocks<V> {
|
|
31
|
-
}
|
|
32
|
-
export declare class Cascader<V = any, Multipe extends boolean = false, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelect<CascaderProps<V, Multipe, Data>, CascaderEvents, CascaderBlocks<V>> {
|
|
33
|
-
static template: string | import("intact").Template<any>;
|
|
34
|
-
static typeDefs: Required<TypeDefs<CascaderProps<any, boolean, CascaderData<any>>>>;
|
|
35
|
-
static defaults: () => Partial<CascaderProps<any, boolean, CascaderData<any>>>;
|
|
36
|
-
private fields;
|
|
37
|
-
private value;
|
|
38
|
-
private label;
|
|
39
|
-
private load;
|
|
40
|
-
private filterable;
|
|
41
|
-
private positionObj;
|
|
42
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
43
|
-
protected getLabel(): import("intact").Children;
|
|
44
|
-
protected hasValue(): any;
|
|
45
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { TypeDefs } from 'intact';
|
|
2
|
-
import dayjs from './dayjs';
|
|
3
|
-
import { State } from '../../hooks/useState';
|
|
4
|
-
import { Shortcut } from './shortcuts';
|
|
5
|
-
import { BasePicker, BasePickerProps, BasePickerEvents, BasePickerBlocks, Value } from './basepicker';
|
|
6
|
-
export * as shortcuts from './shortcuts';
|
|
7
|
-
export interface DatepickerProps<V extends Value = Value, M extends boolean = boolean, R extends boolean = boolean> extends BasePickerProps<V extends string ? V : V | string, M, R> {
|
|
8
|
-
type?: 'date' | 'datetime' | 'year' | 'month';
|
|
9
|
-
shortcuts?: Shortcut[];
|
|
10
|
-
}
|
|
11
|
-
export interface DatepickerEvents extends BasePickerEvents {
|
|
12
|
-
}
|
|
13
|
-
export interface DatepickerBlocks<V extends Value = Value, R extends boolean = boolean> extends BasePickerBlocks<V, R> {
|
|
14
|
-
}
|
|
15
|
-
export declare class Datepicker<V extends Value = Value, M extends boolean = false, R extends boolean = false> extends BasePicker<DatepickerProps<V, M, R>, DatepickerEvents, DatepickerBlocks<V, R>> {
|
|
16
|
-
static template: string | import("intact").Template<any>;
|
|
17
|
-
static typeDefs: Required<TypeDefs<DatepickerProps<Value, boolean, boolean>>>;
|
|
18
|
-
static defaults: () => Partial<DatepickerProps<Value, boolean, boolean>>;
|
|
19
|
-
formats: {
|
|
20
|
-
getValueFormat: () => string;
|
|
21
|
-
getShowFormat: () => string;
|
|
22
|
-
createDateByValueFormat: (value: Value) => dayjs.Dayjs;
|
|
23
|
-
createDateByShowFormat: (value: string) => dayjs.Dayjs;
|
|
24
|
-
getShowString: (value: dayjs.Dayjs) => string;
|
|
25
|
-
getValueString: (value: dayjs.Dayjs) => string;
|
|
26
|
-
};
|
|
27
|
-
disabled: {
|
|
28
|
-
isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
|
|
29
|
-
isDisabledTime: (value: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => boolean;
|
|
30
|
-
isDisabledConfirm: () => boolean;
|
|
31
|
-
maxDate: State<dayjs.Dayjs | null>;
|
|
32
|
-
minDate: State<dayjs.Dayjs | null>;
|
|
33
|
-
};
|
|
34
|
-
panel: {
|
|
35
|
-
startPanel: State<import("./usePanel").PanelTypes>;
|
|
36
|
-
endPanel: State<import("./usePanel").PanelTypes>;
|
|
37
|
-
changePanel: (type: import("./usePanel").PanelTypes, flag?: import("./usePanel").PanelFlags) => void;
|
|
38
|
-
getPanel: (flag: import("./usePanel").PanelFlags) => State<import("./usePanel").PanelTypes>;
|
|
39
|
-
reset: () => void;
|
|
40
|
-
startRef: import("intact").RefObject<import("./calendar").DatepickerCalendar>;
|
|
41
|
-
endRef: import("intact").RefObject<import("./calendar").DatepickerCalendar>;
|
|
42
|
-
};
|
|
43
|
-
focusDate: {
|
|
44
|
-
focusDate: State<dayjs.Dayjs | null>;
|
|
45
|
-
reset: () => void;
|
|
46
|
-
};
|
|
47
|
-
value: {
|
|
48
|
-
format: () => string | string[];
|
|
49
|
-
onConfirm: () => void;
|
|
50
|
-
onChangeTime: (date: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
|
|
51
|
-
getTimeValue: (flag: import("./usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
52
|
-
convertToDayjs: (v: Value | [Value, Value] | Value[] | [Value, Value][] | null | undefined) => import("./basepicker").DayjsValue;
|
|
53
|
-
getDayjsValue: () => import("./basepicker").DayjsValue;
|
|
54
|
-
value: State<import("./basepicker").StateValue>;
|
|
55
|
-
setValue: (v: import("./basepicker").StateValueItem, fromInput: boolean) => void;
|
|
56
|
-
onChangeDate: (v: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
|
|
57
|
-
};
|
|
58
|
-
init(): void;
|
|
59
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
60
|
-
protected getLabel(): string | string[];
|
|
61
|
-
protected clear(e: MouseEvent): void;
|
|
62
|
-
private setByShortcut;
|
|
63
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}
|