@king-design/intact 2.0.13-beta.0 → 2.0.14
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/cascader/index.md +1 -0
- package/components/cascader/useValue.ts +1 -1
- package/components/code/index.md +2 -2
- package/components/code/index.ts +2 -2
- package/components/code/useEditor.ts +1 -1
- package/components/datepicker/index.md +1 -0
- package/components/form/styles.ts +5 -2
- package/components/select/base.ts +5 -7
- package/components/select/base.vdt +5 -7
- package/components/select/demos/basic.md +1 -1
- package/components/select/index.md +1 -0
- package/components/select/useEqualWidth.ts +1 -1
- package/components/select/useFocusout.ts +1 -1
- package/components/select/useInput.ts +1 -1
- package/components/table/demos/animation.md +7 -0
- package/components/table/index.md +1 -0
- package/components/table/row.ts +1 -0
- package/components/table/row.vdt +5 -3
- package/components/table/table.ts +3 -0
- package/components/table/table.vdt +97 -89
- package/components/tooltip/index.ts +1 -1
- package/components/treeSelect/index.md +1 -0
- package/components/wave/index.ts +1 -1
- package/components/wave/styles.ts +2 -1
- package/es/components/cascader/useValue.js +1 -1
- package/es/components/code/index.d.ts +2 -2
- package/es/components/code/useEditor.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/select/base.d.ts +1 -1
- package/es/components/select/base.js +4 -4
- package/es/components/select/base.vdt.js +6 -6
- package/es/components/select/useEqualWidth.js +1 -1
- package/es/components/select/useFocusout.js +1 -1
- package/es/components/select/useInput.js +1 -1
- package/es/components/table/row.d.ts +1 -0
- package/es/components/table/row.vdt.js +5 -6
- package/es/components/table/table.d.ts +1 -0
- package/es/components/table/table.js +4 -2
- package/es/components/table/table.vdt.js +111 -104
- package/es/components/tooltip/index.d.ts +1 -1
- package/es/components/wave/styles.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/packages/kpc-react/__tests__/components/drawer.spec.js +23 -8
- package/es/site/data/components/select/demos/basic/react.js +2 -1
- package/es/site/data/components/table/demos/animation/react.js +16 -0
- package/es/styles/global.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/styles/global.ts +1 -1
- package/es/site/data/components/menu/demos/collapse/react.d.ts +0 -11
- package/es/site/data/components/menu/demos/size/react.d.ts +0 -7
|
@@ -29,6 +29,7 @@ sidebar: doc
|
|
|
29
29
|
| format | 自定义结果显示,组件会将当前选择的所有数据项以数组的格式作为参数传入 | `Function` | `(values: string[]) => values.map(value => value.label).join(' / ')` |
|
|
30
30
|
| loadData | 如果`data`中的`children`属性值为空数组`[]`,则可以使用该属性定义动态加载逻辑,组件会将当前选中的数据项作为参数传入 | `(data: CascaderData<V>) => any` | `undefined` |
|
|
31
31
|
| filter | 如果可搜索,你可以传入`filter`改变搜索逻辑,组件会将搜索关键词和数据项作为参数传入 | `(keywords: string, data: CascaderData<V>) => boolean` | `(keywords: string, data: CascaderData<V>) => data.label.includes(keywords)` |
|
|
32
|
+
| show | 是否展示菜单项 | `boolean` | `false` |
|
|
32
33
|
|
|
33
34
|
```ts
|
|
34
35
|
export type CascaderData<V> = {
|
package/components/code/index.md
CHANGED
|
@@ -17,7 +17,7 @@ sidebar: doc
|
|
|
17
17
|
| readOnly | 是否只读 | `boolean` | `false` |
|
|
18
18
|
| width | 指定宽度,需要带单位 | `string` | `100%` |
|
|
19
19
|
| height | 指定高度,需要带单位 | `string` | `100%` |
|
|
20
|
-
| options | 其它可选的配置,会传给`monaco.editor.create()`方法,可选值参考[options](https://microsoft.github.io/monaco-editor/
|
|
20
|
+
| options | 其它可选的配置,会传给`monaco.editor.create()`方法,可选值参考[options](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html) | [`editor.IStandaloneEditorConstructionOptions`](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneEditorConstructionOptions.html) | `{}` |
|
|
21
21
|
|
|
22
22
|
> 例如:通过`options`可以隐藏右侧代码的缩影(minimap): `options = {minimap: {enabled: false}}`
|
|
23
23
|
|
|
@@ -25,4 +25,4 @@ sidebar: doc
|
|
|
25
25
|
|
|
26
26
|
| 事件名 | 说明 | 参数 |
|
|
27
27
|
| --- | --- | --- |
|
|
28
|
-
| ready | 组件加载并实例化完成触发 | (editor: [editor.IStandaloneCodeEditor](https://microsoft.github.io/monaco-editor/
|
|
28
|
+
| ready | 组件加载并实例化完成触发 | (editor: [editor.IStandaloneCodeEditor](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneCodeEditor.html), Editor: typeof [editor](https://microsoft.github.io/monaco-editor/docs.html#modules/editor.html), Monaco: typeof [monaco](https://microsoft.github.io/monaco-editor/docs.html)) => void |
|
package/components/code/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Component, TypeDefs, createRef} from 'intact';
|
|
2
2
|
import template from './index.vdt';
|
|
3
|
-
import type {editor} from 'monaco-editor';
|
|
3
|
+
import type {editor, default as monaco} from 'monaco-editor';
|
|
4
4
|
import {useEditor} from './useEditor';
|
|
5
5
|
import type {Events} from '../types';
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ export interface CodeProps {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface CodeEvents {
|
|
18
|
-
ready: [editor.IStandaloneCodeEditor, typeof editor]
|
|
18
|
+
ready: [editor.IStandaloneCodeEditor, typeof editor, typeof monaco]
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const typeDefs: Required<TypeDefs<CodeProps>> = {
|
|
@@ -30,6 +30,7 @@ sidebar: doc
|
|
|
30
30
|
| disabledDate | 该属性值是一个函数,用于定义那些日期被禁止选择,函数参数为日期字符串,返回`true`则表示禁用该日期 | `(v: Dayjs) => boolean` | `undefined` |
|
|
31
31
|
| type | 组件类型:`"date"` 只选择日期;`"datetime"` 选择日期和时间;`"year"` 选择年份;`"month"` 选择月份 | `"date"` | `"datetime"` | `"year"` | `"month"` | `"date"` |
|
|
32
32
|
| shortcuts | 指定快捷方式 | `Shortcut[]` | `undefined` |
|
|
33
|
+
| show | 是否展示菜单项 | `boolean` | `false` |
|
|
33
34
|
|
|
34
35
|
```ts
|
|
35
36
|
import {Dayjs} from 'dayjs';
|
|
@@ -35,8 +35,7 @@ export interface BaseSelectProps<V, Multipe extends boolean = boolean, Attach =
|
|
|
35
35
|
placeholder?: Children
|
|
36
36
|
container?: Container
|
|
37
37
|
width?: string | number
|
|
38
|
-
|
|
39
|
-
_show?: boolean
|
|
38
|
+
show?: boolean
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
export interface BaseSelectEvents {
|
|
@@ -68,8 +67,7 @@ const typeDefs: Required<TypeDefs<BaseSelectProps<any>>> = {
|
|
|
68
67
|
placeholder: [String, Number],
|
|
69
68
|
container: [Function, String],
|
|
70
69
|
width: [String, Number],
|
|
71
|
-
|
|
72
|
-
_show: Boolean,
|
|
70
|
+
show: Boolean,
|
|
73
71
|
};
|
|
74
72
|
|
|
75
73
|
const defaults = (): Partial<BaseSelectProps<any>> => ({
|
|
@@ -102,7 +100,7 @@ export abstract class BaseSelect<
|
|
|
102
100
|
|
|
103
101
|
init() {
|
|
104
102
|
provide(SELECT, this);
|
|
105
|
-
useShowHideEvents('
|
|
103
|
+
useShowHideEvents('show');
|
|
106
104
|
// this.input = useInput();
|
|
107
105
|
|
|
108
106
|
this.watch('value', this.position, {presented: true});
|
|
@@ -121,12 +119,12 @@ export abstract class BaseSelect<
|
|
|
121
119
|
|
|
122
120
|
@bind
|
|
123
121
|
show() {
|
|
124
|
-
this.set('
|
|
122
|
+
this.set('show', true);
|
|
125
123
|
}
|
|
126
124
|
|
|
127
125
|
@bind
|
|
128
126
|
hide() {
|
|
129
|
-
this.set('
|
|
127
|
+
this.set('show', false);
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
public resetKeywords(keywords: State<string>) {
|
|
@@ -14,9 +14,7 @@ const {
|
|
|
14
14
|
size, hideIcon, fluid,
|
|
15
15
|
clearable, filterable,
|
|
16
16
|
className, container,
|
|
17
|
-
inline, style, width,
|
|
18
|
-
|
|
19
|
-
_show,
|
|
17
|
+
inline, style, width, show,
|
|
20
18
|
} = this.get();
|
|
21
19
|
|
|
22
20
|
const classNameObj = {
|
|
@@ -44,7 +42,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
44
42
|
ref={this.dropdownRef}
|
|
45
43
|
disabled={disabled}
|
|
46
44
|
container={container}
|
|
47
|
-
v-model="
|
|
45
|
+
v-model="show"
|
|
48
46
|
>
|
|
49
47
|
<div {...getRestProps(this)}
|
|
50
48
|
class={classNameObj}
|
|
@@ -62,7 +60,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
62
60
|
{/* TODO: Need mode on Transition */}
|
|
63
61
|
<TransitionGroup name="k-fade" appear={false}>
|
|
64
62
|
<Input v-if={!multiple && filterable}
|
|
65
|
-
value={
|
|
63
|
+
value={show ? keywords : label}
|
|
66
64
|
ev-$change:value={onInput}
|
|
67
65
|
disabled={disabled}
|
|
68
66
|
placeholder={label || placeholder}
|
|
@@ -71,7 +69,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
71
69
|
fluid
|
|
72
70
|
inline
|
|
73
71
|
key="input"
|
|
74
|
-
readonly={!
|
|
72
|
+
readonly={!show}
|
|
75
73
|
waveDisabled={true}
|
|
76
74
|
/>
|
|
77
75
|
<div class="k-select-placeholder c-ellipsis"
|
|
@@ -128,7 +126,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
128
126
|
inline
|
|
129
127
|
size={size}
|
|
130
128
|
key="filter"
|
|
131
|
-
readonly={!
|
|
129
|
+
readonly={!show}
|
|
132
130
|
waveDisabled={true}
|
|
133
131
|
/>
|
|
134
132
|
</div>
|
|
@@ -11,7 +11,7 @@ import {Select, Option} from 'kpc';
|
|
|
11
11
|
|
|
12
12
|
<div>
|
|
13
13
|
<div style="margin-bottom: 16px;">
|
|
14
|
-
<Select v-model="day">
|
|
14
|
+
<Select v-model="day" show={true}>
|
|
15
15
|
<Option value="Monday">星期一</Option>
|
|
16
16
|
<Option value="Tuesday">星期二</Option>
|
|
17
17
|
<Option value="Wednesday">星期三</Option>
|
|
@@ -31,6 +31,7 @@ sidebar: doc
|
|
|
31
31
|
| labelMap | 建立值`value`到展示标签`label`的映射,可以在`value`不在`Option`集合中时,依然能够正确展示相应的`label` | `Map<any, string>` | `new Map()` |
|
|
32
32
|
| card | 是否展示`card`模式 | `boolean` | `false` |
|
|
33
33
|
| autoDisableArrow | 是否在没有更多可选项时,给箭头一个`disabled`状态来提示用户 | `boolean` | `false` |
|
|
34
|
+
| show | 是否展示菜单项 | `boolean` | `false` |
|
|
34
35
|
|
|
35
36
|
```ts
|
|
36
37
|
export type Container = string | ((parentDom: Element, anchor: Node | null) => Element)
|
|
@@ -4,7 +4,7 @@ import type {BaseSelect} from './base';
|
|
|
4
4
|
export function useEqualWidth() {
|
|
5
5
|
const instance = useInstance() as BaseSelect;
|
|
6
6
|
|
|
7
|
-
instance.watch('
|
|
7
|
+
instance.watch('show', setWidth, {presented: true});
|
|
8
8
|
|
|
9
9
|
function setWidth(v: boolean | undefined) {
|
|
10
10
|
if (!v) return;
|
|
@@ -5,6 +5,8 @@ order: 20
|
|
|
5
5
|
|
|
6
6
|
一个简单的`Table`,点击按钮,即可查看新增表格的动效。
|
|
7
7
|
|
|
8
|
+
通过`animation`可以禁用动效,取值为`false`时,禁用行和列动画;或者通过数组分别指定禁用行和列动画,如:`[false, true]`,只禁用列动画
|
|
9
|
+
|
|
8
10
|
```vdt
|
|
9
11
|
import {Table, TableColumn, Button} from 'kpc';
|
|
10
12
|
|
|
@@ -21,6 +23,11 @@ import {Table, TableColumn, Button} from 'kpc';
|
|
|
21
23
|
<TableColumn v-if={this.get('isShow')} key="b" title="Title 2"/>
|
|
22
24
|
<TableColumn key="c" title="Title 3" />
|
|
23
25
|
</Table>
|
|
26
|
+
<Table data={this.get('data')} resizable rowKey={row => row.a} animation={false}>
|
|
27
|
+
<TableColumn key="a" title="Title 1" />
|
|
28
|
+
<TableColumn v-if={this.get('isShow')} key="b" title="Title 2"/>
|
|
29
|
+
<TableColumn key="c" title="Title 3" />
|
|
30
|
+
</Table>
|
|
24
31
|
</div>
|
|
25
32
|
```
|
|
26
33
|
|
|
@@ -42,6 +42,7 @@ sidebar: doc
|
|
|
42
42
|
| minColWidth | 指定所有列拖动时的最小宽度 | `number` | `40` |
|
|
43
43
|
| widthStoreKey | 如果要保存表格拖动后的列宽信息,可以通过该属性设置保存到`localStorage`中的`key` | `string` | `undefined` |
|
|
44
44
|
| draggable | 表格行是否可拖动 | `boolean` | `false` |
|
|
45
|
+
| animation | 是否开启动效,默认开启。可以通过`true` `false`全部设置,或者通过数组单独设置行和列的动效 | `boolean` | `[boolean, boolean]` | `true` |
|
|
45
46
|
|
|
46
47
|
```ts
|
|
47
48
|
import {Props} from 'intact';
|
package/components/table/row.ts
CHANGED
package/components/table/row.vdt
CHANGED
|
@@ -3,7 +3,7 @@ import {getClassAndStyleForFixed} from './useFixedColumns';
|
|
|
3
3
|
import {Checkbox} from '../checkbox';
|
|
4
4
|
import {Radio} from '../radio';
|
|
5
5
|
import {TableCell} from './cell';
|
|
6
|
-
import {createElementVNode, className as cx} from 'intact';
|
|
6
|
+
import {createElementVNode, className as cx, createFragment} from 'intact';
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
cols, data, checkType, hasFixedLeft,
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
grid, index: rowIndex, indeterminate,
|
|
12
12
|
allDisabled, selected, /* hidden, */spreaded,
|
|
13
13
|
hasChildren, indent, key, offsetMap,
|
|
14
|
-
draggable, draggingKey,
|
|
14
|
+
draggable, draggingKey, animation,
|
|
15
15
|
} = this.get();
|
|
16
16
|
const classNameObj = {
|
|
17
17
|
'k-disabled': disabled,
|
|
@@ -89,7 +89,9 @@ cols.forEach((props, columnIndex) => {
|
|
|
89
89
|
);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
const rows =
|
|
92
|
+
const rows = animation ?
|
|
93
|
+
<TransitionGroup name="k-fade-expand" move={false}>{vNodes}</TransitionGroup> :
|
|
94
|
+
createFragment(vNodes, 8);
|
|
93
95
|
/* const rows = vNodes; */
|
|
94
96
|
|
|
95
97
|
// for performance, no normalize
|
|
@@ -59,6 +59,7 @@ export interface TableProps<
|
|
|
59
59
|
minColWidth?: number
|
|
60
60
|
widthStoreKey?: string
|
|
61
61
|
draggable?: boolean
|
|
62
|
+
animation?: boolean | [boolean, boolean]
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export interface TableEvents<T = any, K extends TableRowKey = number> {
|
|
@@ -116,6 +117,7 @@ const typeDefs: Required<TypeDefs<TableProps<unknown>>> = {
|
|
|
116
117
|
minColWidth: Number,
|
|
117
118
|
widthStoreKey: String,
|
|
118
119
|
draggable: Boolean,
|
|
120
|
+
animation: [Boolean, Array],
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
const defaults = (): Partial<TableProps> => ({
|
|
@@ -126,6 +128,7 @@ const defaults = (): Partial<TableProps> => ({
|
|
|
126
128
|
childrenKey: 'children',
|
|
127
129
|
indent: 32,
|
|
128
130
|
minColWidth: 40,
|
|
131
|
+
animation: true,
|
|
129
132
|
});
|
|
130
133
|
|
|
131
134
|
const events: Events<TableEvents> = {
|
|
@@ -23,8 +23,9 @@ const {
|
|
|
23
23
|
rowClassName, group, sort, loading,
|
|
24
24
|
merge, childrenKey, indent, tooltipPosition,
|
|
25
25
|
tooltipContainer, showIndeterminate, resizable,
|
|
26
|
-
draggable,
|
|
26
|
+
draggable, animation: _animation,
|
|
27
27
|
} = this.get();
|
|
28
|
+
const animation = !Array.isArray(_animation) ? [_animation, _animation] : _animation;
|
|
28
29
|
const {columns, cols, maxRows, maxCols} = this.columns.getData();
|
|
29
30
|
const {scrollPosition, hasFixed, getHasFixedLeft, getOffsetMap} = this.fixedColumns;
|
|
30
31
|
const {scrollRef} = this.scroll;
|
|
@@ -71,23 +72,29 @@ const thead = (
|
|
|
71
72
|
<FixedColumnsContext.Provider value={offsetMap}>
|
|
72
73
|
<thead>
|
|
73
74
|
<tr v-for={columns}>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
{(() => {
|
|
76
|
+
const ths = <template>
|
|
77
|
+
<th v-if={$key === 0 && checkType !== 'none'}
|
|
78
|
+
{...getClassAndStyleForFixed({
|
|
79
|
+
fixed: hasFixedLeft ? 'left' : false,
|
|
80
|
+
}, 0)}
|
|
81
|
+
rowspan={maxRows}
|
|
82
|
+
key="$checktype"
|
|
83
|
+
>
|
|
84
|
+
<Checkbox v-if={checkType === 'checkbox'}
|
|
85
|
+
value={allCheckedStatus === AllCheckedStatus.All}
|
|
86
|
+
indeterminate={showIndeterminate && allCheckedStatus == AllCheckedStatus.Indeterminate}
|
|
87
|
+
ev-$change:value={toggleCheckedAll}
|
|
88
|
+
disabled={!hasData}
|
|
89
|
+
/>
|
|
90
|
+
</th>
|
|
91
|
+
{$value}
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
return animation[1] ?
|
|
95
|
+
<TransitionGroup name="k-fade-expand" move={false}>{ths}</TransitionGroup> :
|
|
96
|
+
ths;
|
|
97
|
+
})()}
|
|
91
98
|
</tr>
|
|
92
99
|
</thead>
|
|
93
100
|
</FixedColumnsContext.Provider>
|
|
@@ -114,84 +121,85 @@ const tbody = (
|
|
|
114
121
|
<b:empty>{_$('/(ㄒoㄒ)/~~ 没有找到亲要的数据哦~')}</b:empty>
|
|
115
122
|
</td>
|
|
116
123
|
</tr> :
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (hidden) return hidden;
|
|
124
|
+
(() => {
|
|
125
|
+
const rows = [];
|
|
126
|
+
loopData((value, index, level, hidden) => {
|
|
127
|
+
// don't render if row is hidden
|
|
128
|
+
if (hidden) return hidden;
|
|
123
129
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
const status = allStatus[index];
|
|
131
|
+
const key = allKeys[index];
|
|
132
|
+
const spreaded = isSpreaded(key);
|
|
133
|
+
const hasChildren = !!childrenKey && Array.isArray(value[childrenKey]);
|
|
134
|
+
const indentSize = indent ? indent * level : 0;
|
|
129
135
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
let row = <TableRow
|
|
137
|
+
key={key}
|
|
138
|
+
cols={cols}
|
|
139
|
+
data={value}
|
|
140
|
+
checkType={checkType}
|
|
141
|
+
hasFixedLeft={hasFixedLeft}
|
|
142
|
+
onClick={this.clickRow}
|
|
143
|
+
checked={status.checked}
|
|
144
|
+
indeterminate={status.indeterminate}
|
|
145
|
+
index={index}
|
|
146
|
+
disabled={status.disabled}
|
|
147
|
+
allDisabled={status.allDisabled}
|
|
148
|
+
className={rowClassName && rowClassName(value, index, key)}
|
|
149
|
+
merge={merge}
|
|
150
|
+
grid={getGrid()}
|
|
151
|
+
onChangeChecked={onChangeChecked}
|
|
152
|
+
selected={isSelected(key)}
|
|
153
|
+
spreaded={spreaded}
|
|
154
|
+
hasChildren={hasChildren}
|
|
155
|
+
indent={indentSize}
|
|
156
|
+
onToggleSpreadRow={toggleSpreadRow}
|
|
157
|
+
onBeforeUnmount={this.resetRowStatus.onRowBeforeUnmount}
|
|
158
|
+
offsetMap={offsetMap}
|
|
159
|
+
animation={animation[1]}
|
|
153
160
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
draggable={draggable}
|
|
162
|
+
draggingKey={draggingKey.value}
|
|
163
|
+
onRowDragStart={onRowDragStart}
|
|
164
|
+
onRowDragEnd={onRowDragEnd}
|
|
165
|
+
onRowDragOver={onRowDragOver}
|
|
166
|
+
/>
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
if ($blocks.tooltip) {
|
|
169
|
+
const content = <b:tooltip params={[value, index]} />;
|
|
170
|
+
row = (
|
|
171
|
+
<Tooltip key={key} position={tooltipPosition} container={tooltipContainer}>
|
|
172
|
+
<template>{row}</template>
|
|
173
|
+
<b:content>{content}</b:content>
|
|
174
|
+
</Tooltip>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
170
177
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
rows.push(row);
|
|
179
|
+
if ($blocks.expand) {
|
|
180
|
+
const expanded = isExpanded(key);
|
|
181
|
+
rows.push(
|
|
182
|
+
<tr class={{"k-expand": true, 'k-expanded': expanded}}
|
|
183
|
+
key={`${key}.$expand`}
|
|
184
|
+
>
|
|
185
|
+
<td colspan={colCount}>
|
|
186
|
+
<Transition {...expandAnimationCallbacks}>
|
|
187
|
+
<div v-if={expanded} class="k-table-expand">
|
|
188
|
+
<b:expand params={[value, index]} />
|
|
189
|
+
</div>
|
|
190
|
+
</Transition>
|
|
191
|
+
</td>
|
|
192
|
+
</tr>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
188
195
|
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
return hidden || !spreaded;
|
|
197
|
+
});
|
|
191
198
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
return animation[0] ?
|
|
200
|
+
<TransitionGroup name="k-fade-in-left" move={!draggingKey.value}>{rows}</TransitionGroup> :
|
|
201
|
+
rows;
|
|
202
|
+
})()
|
|
195
203
|
}
|
|
196
204
|
</tbody>
|
|
197
205
|
);
|
|
@@ -20,7 +20,7 @@ export interface TooltipBlocks extends BaseTooltipBlocks, TooltipContentBlocks {
|
|
|
20
20
|
content: null
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
declare class _Tooltip extends BaseTooltip<TooltipProps, TooltipEvents, TooltipBlocks> { }
|
|
23
|
+
export declare class _Tooltip extends BaseTooltip<TooltipProps, TooltipEvents, TooltipBlocks> { }
|
|
24
24
|
|
|
25
25
|
function Wrapper(props: Props<TooltipProps, BaseTooltip>) {
|
|
26
26
|
let {children, content, $blocks, ...rest} = props;
|
|
@@ -32,6 +32,7 @@ sidebar: doc
|
|
|
32
32
|
| defaultExpandAll | 是否默认展开所有节点 | `boolean` | `true` |
|
|
33
33
|
| checkbox | 是否展示复选框 | `boolean` | `false` |
|
|
34
34
|
| filter | 当支持筛选时,可以自定义筛选规则 | `(keywords: string, data: TreeDataItem<K>) => boolean` | `undefined` |
|
|
35
|
+
| show | 是否展示菜单项 | `boolean` | `false` |
|
|
35
36
|
|
|
36
37
|
```ts
|
|
37
38
|
import {Key, Children} from 'intact';
|
package/components/wave/index.ts
CHANGED
|
@@ -77,7 +77,7 @@ export class Wave extends Component<WaveProps> {
|
|
|
77
77
|
this.resetAnimation();
|
|
78
78
|
|
|
79
79
|
instance!.addEventListener('animationend', this.resetAnimation);
|
|
80
|
-
this.timer = window.setTimeout(() => {
|
|
80
|
+
this.timer = window.setTimeout(() => {
|
|
81
81
|
instance!.classList.add(this.className);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -39,6 +39,7 @@ export function makeStyles(color: string, inset: string) {
|
|
|
39
39
|
animation: ${waveEffect} .2s ease-in;
|
|
40
40
|
animation-fill-mode: forwards;
|
|
41
41
|
border: 2px solid ${color};
|
|
42
|
+
pointer-events: none;
|
|
42
43
|
}
|
|
43
44
|
&.k-circle,
|
|
44
45
|
&.k-radio-wrapper {
|
|
@@ -47,4 +48,4 @@ export function makeStyles(color: string, inset: string) {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
`;
|
|
50
|
-
}
|
|
51
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact';
|
|
2
|
-
import type { editor } from 'monaco-editor';
|
|
2
|
+
import type { editor, default as monaco } from 'monaco-editor';
|
|
3
3
|
import type { Events } from '../types';
|
|
4
4
|
export interface CodeProps {
|
|
5
5
|
value?: string;
|
|
@@ -11,7 +11,7 @@ export interface CodeProps {
|
|
|
11
11
|
options?: editor.IStandaloneEditorConstructionOptions;
|
|
12
12
|
}
|
|
13
13
|
export interface CodeEvents {
|
|
14
|
-
ready: [editor.IStandaloneCodeEditor, typeof editor];
|
|
14
|
+
ready: [editor.IStandaloneCodeEditor, typeof editor, typeof monaco];
|
|
15
15
|
}
|
|
16
16
|
export declare class Code extends Component<CodeProps, CodeEvents> {
|
|
17
17
|
static template: string | import("intact").Template<any>;
|
|
@@ -50,7 +50,7 @@ setDefault(function () {
|
|
|
50
50
|
}).form;
|
|
51
51
|
});
|
|
52
52
|
export function makeItemStyles() {
|
|
53
|
-
return /*#__PURE__*/css("display:table;position:relative;table-layout:fixed;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid{width:100%;}.k-form-label{display:table-cell;width:", form.item.labelWidth, ";text-align:", form.item.labelTextAlign, ";padding-right:", form.item.labelGap, ";line-height:", form.item.labelLineHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{display:table-cell;vertical-align:middle;position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-inner{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-inner{border:none;}}.k-form-item{display:block;width:auto;}.k-form-append{display:table-cell;padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
53
|
+
return /*#__PURE__*/css("display:table;position:relative;table-layout:fixed;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid{width:100%;}.k-form-label{display:table-cell;width:", form.item.labelWidth, ";text-align:", form.item.labelTextAlign, ";padding-right:", form.item.labelGap, ";line-height:", form.item.labelLineHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{display:table-cell;vertical-align:middle;position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-inner{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-inner{border:none;}}.k-form-item{&,.k-form-content{display:block;width:auto;}}.k-form-append{display:table-cell;padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
54
54
|
}
|
|
55
55
|
export function makeFormStyles() {
|
|
56
56
|
var _context;
|