@king-design/vue 2.0.3 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/Vue Next Demos.md +34 -2
- package/__tests__/components/dialog.spec.ts +36 -0
- package/components/cascader/index.d.ts +34 -0
- package/components/datepicker/index.d.ts +63 -0
- package/components/diagram/index.d.ts +1 -1
- package/components/dialog/index.js +6 -5
- package/components/dialog/staticMethods.d.ts +1 -0
- package/components/dialog/staticMethods.js +3 -2
- package/components/select/select.d.ts +33 -0
- package/components/steps/context.d.ts +2 -2
- package/components/table/cell.js +5 -0
- package/components/table/index.spec.js +76 -52
- package/components/table/useChecked.js +1 -1
- package/components/timepicker/panelPicker.d.ts +54 -0
- package/components/treeSelect/index.d.ts +27 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
#### `Form custom`
|
|
516
516
|
|
|
517
517
|
```
|
|
518
|
-
"<form class=\"k-form k-horizontal css-11cgyra\" novalidate=\"true\"><div class=\"k-form-item css-1frgjei\"><label class=\"k-form-label\">描述</label><div class=\"k-form-content\"><div class=\"k-form-item css-1frgjei\" model=\"descriptions[0]\"><div class=\"k-form-content\"><div class=\"k-input css-1cug0ah\"><div class=\"k-input-wrapper\"><input class=\"k-input-inner\" type=\"text\"></div></div><
|
|
518
|
+
"<form class=\"k-form k-horizontal css-11cgyra\" novalidate=\"true\"><div class=\"k-form-item css-1frgjei\"><label class=\"k-form-label\">描述</label><div class=\"k-form-content\"><div class=\"k-form-item css-1frgjei\" model=\"descriptions[0]\"><div class=\"k-form-content\"><div class=\"k-input css-1cug0ah\"><div class=\"k-input-wrapper\"><input class=\"k-input-inner\" type=\"text\"></div></div></div><div class=\"k-form-append\"><button class=\"k-btn css-12uxt25\" tabindex=\"0\" type=\"button\">删除</button></div></div><div class=\"k-form-item css-1frgjei\" model=\"descriptions[1]\"><div class=\"k-form-content\"><div class=\"k-input css-1cug0ah\"><div class=\"k-input-wrapper\"><input class=\"k-input-inner\" type=\"text\"></div></div></div><div class=\"k-form-append\"><button class=\"k-btn css-12uxt25\" tabindex=\"0\" type=\"button\">删除</button></div></div><button class=\"k-btn css-12uxt25\" tabindex=\"0\" type=\"button\">添加</button></div></div></form>"
|
|
519
519
|
```
|
|
520
520
|
|
|
521
521
|
#### `Form label`
|
|
@@ -1033,6 +1033,38 @@
|
|
|
1033
1033
|
"<div><div class=\"k-select k-large css-1mhb480\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow ion-ios-arrow-down css-x0ey6t\"></i></span></span></div><div class=\"k-select css-1mhb480\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow ion-ios-arrow-down css-x0ey6t\"></i></span></span></div><div class=\"k-select k-small css-1mhb480\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow ion-ios-arrow-down css-x0ey6t\"></i></span></span></div><div class=\"k-select k-mini css-1mhb480\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow ion-ios-arrow-down css-x0ey6t\"></i></span></span></div></div>"
|
|
1034
1034
|
```
|
|
1035
1035
|
|
|
1036
|
+
## `skeleton`
|
|
1037
|
+
|
|
1038
|
+
#### `Skeleton animate`
|
|
1039
|
+
|
|
1040
|
+
```
|
|
1041
|
+
"<div><div class=\"k-skeleton k-animated css-19gzphz\"><div class=\"k-skeleton-avator-box\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-avator\"></div></div><div class=\"k-skeleton-items\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div></div></div></div></div>"
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
#### `Skeleton avator`
|
|
1045
|
+
|
|
1046
|
+
```
|
|
1047
|
+
"<div><div class=\"k-skeleton css-19gzphz\"><div class=\"k-skeleton-avator-box\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-avator\"></div></div><div class=\"k-skeleton-items\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div></div></div></div></div>"
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
#### `Skeleton basic`
|
|
1051
|
+
|
|
1052
|
+
```
|
|
1053
|
+
"<div><div class=\"k-skeleton css-19gzphz\"><div class=\"k-skeleton-items\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div></div></div></div>"
|
|
1054
|
+
```
|
|
1055
|
+
|
|
1056
|
+
#### `Skeleton custom`
|
|
1057
|
+
|
|
1058
|
+
```
|
|
1059
|
+
"<div><div class=\"k-skeleton k-animated css-19gzphz\"><div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-image\"><svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M64 896V128h896v768H64z m64-128l192-192 116.352 116.352L640 448l256 307.2V192H128v576z m224-480a96 96 0 1 1-0.064 192.064A96 96 0 0 1 352 288z\"></path></svg></div></div><div style=\"display: flex; justify-content: space-between; width: 200px; margin-top: 20px;\"><div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-button\" style=\"height: 16px;\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-button\" style=\"height: 16px; margin-top: 8px;\"></div></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-button\"></div></div></div></div></div></div>"
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
#### `Skeleton rows`
|
|
1063
|
+
|
|
1064
|
+
```
|
|
1065
|
+
"<div><div class=\"k-skeleton css-19gzphz\"><div class=\"k-skeleton-items\"><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div><div class=\"k-skeleton-item css-lk4fv2\"><div class=\"k-skeleton-item-box skeleton-item-text\"></div></div></div></div></div>"
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1036
1068
|
## `slider`
|
|
1037
1069
|
|
|
1038
1070
|
#### `Slider basic`
|
|
@@ -1694,7 +1726,7 @@
|
|
|
1694
1726
|
#### `Tree filterable`
|
|
1695
1727
|
|
|
1696
1728
|
```
|
|
1697
|
-
"<div><div class=\"k-input css-1cug0ah\"><div class=\"k-input-wrapper\"><input class=\"k-input-inner\" placeholder=\"Please enter keywords to filter node.\" type=\"text\"></div></div><div class=\"k-tree k-line k-selectable css-192otbj\"><div class=\"k-tree-node
|
|
1729
|
+
"<div><div class=\"k-input css-1cug0ah\"><div class=\"k-input-wrapper\"><input class=\"k-input-inner\" placeholder=\"Please enter keywords to filter node.\" type=\"text\"></div></div><div class=\"k-tree k-line k-selectable css-192otbj\"><div class=\"k-tree-node\"><div class=\"k-tree-label\"><i class=\"k-icon k-hoverable k-tree-icon ion-android-arrow-dropdown css-x0ey6t\"></i><div class=\"k-tree-text c-ellipsis\">First floor-1</div></div></div><div class=\"k-tree-node k-expanded\"><div class=\"k-tree-label\"><i class=\"k-icon k-hoverable k-tree-icon ion-android-arrow-dropdown css-x0ey6t\"></i><div class=\"k-tree-text c-ellipsis\">First floor-2</div></div><div class=\"k-tree\"><div class=\"k-tree-node k-expanded\"><div class=\"k-tree-label\"><i class=\"k-icon k-hoverable k-tree-icon ion-android-arrow-dropdown css-x0ey6t\"></i><div class=\"k-tree-text c-ellipsis\">Second floor-2.1</div></div><div class=\"k-tree\"><div class=\"k-tree-node\"><div class=\"k-tree-label k-tree-leaf\"><div class=\"k-tree-text c-ellipsis\">Third floor-2.1.1</div></div></div><div class=\"k-tree-node\"><div class=\"k-tree-label k-tree-leaf\"><div class=\"k-tree-text c-ellipsis\">Third floor-2.1.2</div></div></div></div></div><div class=\"k-tree-node k-disabled\"><div class=\"k-tree-label\"><i class=\"k-icon k-hoverable k-tree-icon ion-android-arrow-dropdown css-x0ey6t\"></i><div class=\"k-tree-text c-ellipsis\">Second floor-2.2</div></div></div></div></div></div></div>"
|
|
1698
1730
|
```
|
|
1699
1731
|
|
|
1700
1732
|
#### `Tree loading`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {createApp, render} from 'vue';
|
|
2
|
+
import {mount, unmount, dispatchEvent, getElement, wait} from '@/test/utils';
|
|
3
|
+
import {Dialog} from '../../';
|
|
4
|
+
|
|
5
|
+
describe('Dialog', () => {
|
|
6
|
+
it('call static method', async () => {
|
|
7
|
+
const container = document.createElement('div');
|
|
8
|
+
document.body.appendChild(container);
|
|
9
|
+
const vue = createApp({
|
|
10
|
+
template: `
|
|
11
|
+
<div @click="test">click</div>
|
|
12
|
+
`,
|
|
13
|
+
methods: {
|
|
14
|
+
test() {
|
|
15
|
+
Dialog.success({
|
|
16
|
+
content: 'test',
|
|
17
|
+
ref: i => this.dialog = i,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
close() {
|
|
21
|
+
this.dialog.close();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}).mount(container);
|
|
25
|
+
|
|
26
|
+
(vue.$el as HTMLElement).click();
|
|
27
|
+
await wait();
|
|
28
|
+
expect(getElement('.k-dialog')).to.be.exist;
|
|
29
|
+
|
|
30
|
+
(vue as any).close();
|
|
31
|
+
await wait(500);
|
|
32
|
+
|
|
33
|
+
render(null, container);
|
|
34
|
+
document.body.removeChild(container);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TypeDefs } from 'intact-vue-next';
|
|
2
|
+
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
3
|
+
export interface CascaderProps<V = any, Multipe extends boolean = boolean> extends BaseSelectProps<V[], Multipe> {
|
|
4
|
+
data?: CascaderData<V>[];
|
|
5
|
+
trigger?: 'click' | 'hover';
|
|
6
|
+
changeOnSelect?: boolean;
|
|
7
|
+
format?: (labels: string[]) => string;
|
|
8
|
+
loadData?: (data: CascaderData<V>) => any;
|
|
9
|
+
filter?: (keywords: string, data: CascaderData<V>) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare type CascaderData<V> = {
|
|
12
|
+
value: V;
|
|
13
|
+
label: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loaded?: boolean;
|
|
16
|
+
children?: CascaderData<V>[];
|
|
17
|
+
};
|
|
18
|
+
export interface CascaderEvents extends BaseSelectEvents {
|
|
19
|
+
}
|
|
20
|
+
export interface CascaderBlocks<V> extends BaseSelectBlocks<V> {
|
|
21
|
+
}
|
|
22
|
+
export declare class Cascader<V = any, Multipe extends boolean = false> extends BaseSelect<CascaderProps<V, Multipe>, CascaderEvents, CascaderBlocks<V>> {
|
|
23
|
+
static template: string | import("intact").Template<any>;
|
|
24
|
+
static typeDefs: Required<TypeDefs<CascaderProps<any, boolean>>>;
|
|
25
|
+
static defaults: () => Partial<CascaderProps<any, boolean>>;
|
|
26
|
+
private value;
|
|
27
|
+
private label;
|
|
28
|
+
private load;
|
|
29
|
+
private filterable;
|
|
30
|
+
private positionObj;
|
|
31
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
32
|
+
protected getLabel(): import("intact").Children;
|
|
33
|
+
protected hasValue(): any;
|
|
34
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TypeDefs } from 'intact-vue-next';
|
|
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
|
+
}
|
|
@@ -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("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DTriangle: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCylinder: import("misstime").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCloud: import("misstime").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';
|
|
@@ -15,7 +15,7 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if ($vNode === void 0) {
|
|
18
|
-
$vNode =
|
|
18
|
+
$vNode = createVNode(BaseDialog);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if ($SVG === void 0) {
|
|
@@ -38,13 +38,14 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
38
38
|
var _proto = BaseDialog.prototype;
|
|
39
39
|
|
|
40
40
|
_proto.init = function init() {
|
|
41
|
-
_BaseDialog2.prototype.init.call(this);
|
|
41
|
+
_BaseDialog2.prototype.init.call(this); // @ts-ignore
|
|
42
42
|
|
|
43
|
-
usePosition(this.dialogRef);
|
|
44
43
|
|
|
45
|
-
if (this.$vNode) {
|
|
44
|
+
if (this.$vNode.tag !== BaseDialog) {
|
|
46
45
|
this.useAsComponent = true;
|
|
47
46
|
}
|
|
47
|
+
|
|
48
|
+
usePosition(this.dialogRef);
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
_proto.show = function show() {
|
|
@@ -68,7 +69,7 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
68
69
|
|
|
69
70
|
_this2.$init(null);
|
|
70
71
|
|
|
71
|
-
var vNode = _this2.$vNode
|
|
72
|
+
var vNode = _this2.$vNode;
|
|
72
73
|
vNode.children = _this2;
|
|
73
74
|
|
|
74
75
|
_this2.$render(null, vNode, document.body, null, mountedQueue);
|
|
@@ -5,6 +5,7 @@ export interface AlertDialogProps extends DialogProps {
|
|
|
5
5
|
type?: 'success' | 'warning' | 'error' | 'confirm';
|
|
6
6
|
hideIcon?: boolean;
|
|
7
7
|
hideFooter?: boolean;
|
|
8
|
+
ref?: (i: Dialog) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare type StaticMethod = (options?: AlertDialogProps) => Promise<void>;
|
|
10
11
|
export declare function addStaticMethods(Component: typeof Dialog): void;
|
|
@@ -29,9 +29,10 @@ export function addStaticMethods(Component) {
|
|
|
29
29
|
options = {};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
var dialog = new AlertDialog(options);
|
|
33
|
+
dialog.show();
|
|
34
|
+
if (options.ref) options.ref(dialog);
|
|
32
35
|
return new _Promise(function (resolve, reject) {
|
|
33
|
-
var dialog = new AlertDialog(options, null, false, [], null);
|
|
34
|
-
dialog.show();
|
|
35
36
|
dialog.on('ok', function () {
|
|
36
37
|
resolve();
|
|
37
38
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Children, TypeDefs } from 'intact-vue-next';
|
|
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,4 +1,4 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
|
-
Provider: import("
|
|
3
|
-
Consumer: import("
|
|
2
|
+
Provider: import("misstime").ComponentConstructor<import('intact-vue-next').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
|
+
Consumer: import("misstime").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
4
|
};
|
package/components/table/cell.js
CHANGED
|
@@ -988,56 +988,80 @@ describe('Table', function () {
|
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
}, _callee21);
|
|
991
|
-
})));
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
991
|
+
})));
|
|
992
|
+
it('should update children in TableCell', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
993
|
+
var update, Test, Demo, _mount24, instance, element;
|
|
994
|
+
|
|
995
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context25) {
|
|
996
|
+
while (1) {
|
|
997
|
+
switch (_context25.prev = _context25.next) {
|
|
998
|
+
case 0:
|
|
999
|
+
update = sinon.spy();
|
|
1000
|
+
|
|
1001
|
+
Test = /*#__PURE__*/function (_Component3) {
|
|
1002
|
+
_inheritsLoose(Test, _Component3);
|
|
1003
|
+
|
|
1004
|
+
function Test() {
|
|
1005
|
+
return _Component3.apply(this, arguments) || this;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
var _proto = Test.prototype;
|
|
1009
|
+
|
|
1010
|
+
_proto.beforeUpdate = function beforeUpdate() {
|
|
1011
|
+
update();
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
return Test;
|
|
1015
|
+
}(Component);
|
|
1016
|
+
|
|
1017
|
+
Test.template = "<div>test</div>";
|
|
1018
|
+
|
|
1019
|
+
Demo = /*#__PURE__*/function (_Component4) {
|
|
1020
|
+
_inheritsLoose(Demo, _Component4);
|
|
1021
|
+
|
|
1022
|
+
function Demo() {
|
|
1023
|
+
var _context24;
|
|
1024
|
+
|
|
1025
|
+
var _this3;
|
|
1026
|
+
|
|
1027
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1028
|
+
args[_key3] = arguments[_key3];
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
_this3 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context24 = [this]).call(_context24, args)) || this;
|
|
1032
|
+
_this3.Table = Table;
|
|
1033
|
+
_this3.TableColumn = TableColumn;
|
|
1034
|
+
_this3.Test = Test;
|
|
1035
|
+
return _this3;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
Demo.defaults = function defaults() {
|
|
1039
|
+
return {
|
|
1040
|
+
data: [{
|
|
1041
|
+
a: 1
|
|
1042
|
+
}, {
|
|
1043
|
+
a: 2
|
|
1044
|
+
}]
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
return Demo;
|
|
1049
|
+
}(Component);
|
|
1050
|
+
|
|
1051
|
+
Demo.template = "\n const {Table, TableColumn, Test} = this;\n <Table data={this.get('data')} ref=\"table\">\n <TableColumn key=\"a\">\n <b:template>\n <Test />\n </b:template>\n </TableColumn>\n </Table>\n ";
|
|
1052
|
+
_mount24 = mount(Demo), instance = _mount24[0], element = _mount24[1];
|
|
1053
|
+
element.querySelector('tbody tr').click();
|
|
1054
|
+
_context25.next = 9;
|
|
1055
|
+
return wait();
|
|
1056
|
+
|
|
1057
|
+
case 9:
|
|
1058
|
+
expect(update.callCount).to.eql(1);
|
|
1059
|
+
|
|
1060
|
+
case 10:
|
|
1061
|
+
case "end":
|
|
1062
|
+
return _context25.stop();
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}, _callee22);
|
|
1066
|
+
})));
|
|
1043
1067
|
});
|
|
@@ -211,7 +211,7 @@ export function useChecked(getEnableKeys, getAllKeys, isDisabledKey, getGrid, lo
|
|
|
211
211
|
|
|
212
212
|
instance.on('$change:data', updateAllCheckedStatus);
|
|
213
213
|
instance.on('clickRow', function (data, index, key) {
|
|
214
|
-
if (instance.get('rowCheckable')) {
|
|
214
|
+
if (instance.get('rowCheckable') && instance.get('checkType') !== 'none') {
|
|
215
215
|
toggleChecked(key, index);
|
|
216
216
|
}
|
|
217
217
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TypeDefs } from 'intact-vue-next';
|
|
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,27 @@
|
|
|
1
|
+
import { TypeDefs, Children, Key } from 'intact-vue-next';
|
|
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
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
|
|
25
|
+
protected getLabel(): Children;
|
|
26
|
+
private filter;
|
|
27
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -57,7 +57,7 @@ export * from './components/tree';
|
|
|
57
57
|
export * from './components/treeSelect';
|
|
58
58
|
export * from './components/upload';
|
|
59
59
|
export * from './components/wave';
|
|
60
|
-
export declare const version = "2.0.
|
|
60
|
+
export declare const version = "2.0.6";
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
export {normalize} from 'intact-vue-next';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -59,7 +59,7 @@ export * from './components/tree';
|
|
|
59
59
|
export * from './components/treeSelect';
|
|
60
60
|
export * from './components/upload';
|
|
61
61
|
export * from './components/wave';
|
|
62
|
-
export var version = '2.0.
|
|
62
|
+
export var version = '2.0.6';
|
|
63
63
|
/* generate end */
|
|
64
64
|
|
|
65
65
|
export {normalize} from 'intact-vue-next';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/vue",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "King-Design UI components for Vue3.0.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dayjs": "^1.10.7",
|
|
39
39
|
"downloadjs": "^1.4.7",
|
|
40
40
|
"enquire.js": "^2.1.6",
|
|
41
|
-
"intact-vue-next": "^3.0.
|
|
41
|
+
"intact-vue-next": "^3.0.6",
|
|
42
42
|
"monaco-editor": "^0.26.1",
|
|
43
43
|
"mxgraphx": "^4.0.7",
|
|
44
44
|
"resize-observer-polyfill": "^1.5.1",
|