@king-design/vue 2.0.9 → 2.0.11
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 +40 -40
- package/__tests__/components/dialog.spec.ts +28 -2
- package/components/dialog/base.d.ts +1 -0
- package/components/dialog/base.js +4 -2
- package/components/dialog/useDraggable.js +4 -1
- package/components/dialog/useEscClosable.js +1 -1
- package/components/drawer/index.js +2 -1
- package/components/portal.js +11 -7
- package/components/select/base.d.ts +1 -0
- package/components/select/base.js +1 -0
- package/components/select/useBaseLabel.d.ts +1 -0
- package/components/select/useBaseLabel.js +5 -1
- package/hooks/useDraggable.d.ts +1 -0
- package/hooks/useDraggable.js +2 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/yarn-error.log +0 -894
|
@@ -30,7 +30,8 @@ var typeDefs = {
|
|
|
30
30
|
terminate: Function,
|
|
31
31
|
escClosable: Boolean,
|
|
32
32
|
width: [String, Number],
|
|
33
|
-
mode: ['destroy', 'hide']
|
|
33
|
+
mode: ['destroy', 'hide'],
|
|
34
|
+
draggable: Boolean
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
var defaults = function defaults() {
|
|
@@ -43,7 +44,8 @@ var defaults = function defaults() {
|
|
|
43
44
|
overlay: true,
|
|
44
45
|
closable: true,
|
|
45
46
|
escClosable: true,
|
|
46
|
-
mode: 'hide'
|
|
47
|
+
mode: 'hide',
|
|
48
|
+
draggable: true
|
|
47
49
|
};
|
|
48
50
|
};
|
|
49
51
|
|
package/components/portal.js
CHANGED
|
@@ -97,13 +97,17 @@ export var Portal = /*#__PURE__*/function (_Component) {
|
|
|
97
97
|
|
|
98
98
|
if (!this.container) {
|
|
99
99
|
// find the closest dialog if exists
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
this.container = parentDom.closest('.k-dialog') || document.body;
|
|
101
|
+
/**
|
|
102
|
+
* @FIXME: We cannot get parent ref from sub component in Vue
|
|
103
|
+
*/
|
|
104
|
+
// find the closest dialog if exists
|
|
105
|
+
// let tmp;
|
|
106
|
+
// if ((tmp = this.dialog) && (tmp !== this.$senior) && (tmp = tmp.dialogRef.value)) {
|
|
107
|
+
// this.container = tmp;
|
|
108
|
+
// } else {
|
|
109
|
+
// this.container = document.body;
|
|
110
|
+
// }
|
|
107
111
|
}
|
|
108
112
|
};
|
|
109
113
|
|
|
@@ -35,6 +35,7 @@ export interface BaseSelectBlocks<V> {
|
|
|
35
35
|
suffix: null;
|
|
36
36
|
}
|
|
37
37
|
export declare abstract class BaseSelect<T extends BaseSelectProps<any> = BaseSelectProps<any>, E extends BaseSelectEvents = BaseSelectEvents, B extends BaseSelectBlocks<any> = BaseSelectBlocks<any>> extends Component<T, E, B> {
|
|
38
|
+
static $doubleVNodes: boolean;
|
|
38
39
|
static template: string | import("intact").Template<any>;
|
|
39
40
|
static typeDefs: Required<TypeDefs<BaseSelectProps<any, boolean, any>>>;
|
|
40
41
|
static defaults: () => Partial<BaseSelectProps<any, boolean, any>>;
|
|
@@ -2,6 +2,7 @@ import { Children, Component } from 'intact-vue-next';
|
|
|
2
2
|
declare type BaseLabelProps = {
|
|
3
3
|
value: any;
|
|
4
4
|
multiple: boolean;
|
|
5
|
+
filterable: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare function useBaseLabel<T, C extends Component<P>, P extends BaseLabelProps>(getChildren: () => T, findLabelFromChildren: (children: T, value: any) => Children): {
|
|
7
8
|
getLabel: () => Children;
|
|
@@ -2,7 +2,7 @@ import _Map from "@babel/runtime-corejs3/core-js/map";
|
|
|
2
2
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
3
3
|
import { useInstance } from 'intact-vue-next';
|
|
4
4
|
import { isNullOrUndefined, isStringOrNumber } from 'intact-shared';
|
|
5
|
-
import { isEmptyString } from '../utils';
|
|
5
|
+
import { isEmptyString, getTextByChildren } from '../utils';
|
|
6
6
|
export function useBaseLabel(getChildren, findLabelFromChildren) {
|
|
7
7
|
var instance = useInstance();
|
|
8
8
|
var labelMap = new _Map();
|
|
@@ -36,6 +36,10 @@ export function useBaseLabel(getChildren, findLabelFromChildren) {
|
|
|
36
36
|
if (isNullOrUndefined(label)) {
|
|
37
37
|
label = labelMap.get(value);
|
|
38
38
|
} else {
|
|
39
|
+
if (instance.get('filterable')) {
|
|
40
|
+
label = getTextByChildren(label);
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
labelMap.set(value, label);
|
|
40
44
|
}
|
|
41
45
|
|
package/hooks/useDraggable.d.ts
CHANGED
package/hooks/useDraggable.js
CHANGED
|
@@ -5,7 +5,7 @@ export function useDraggable(options) {
|
|
|
5
5
|
|
|
6
6
|
function start(e) {
|
|
7
7
|
// ignore if it isn't left key
|
|
8
|
-
if (e.which !== 1) return;
|
|
8
|
+
if (e.which !== 1 || options.disable != null && options.disable()) return;
|
|
9
9
|
dragging.set(true);
|
|
10
10
|
|
|
11
11
|
if (options.onStart) {
|
|
@@ -17,6 +17,7 @@ export function useDraggable(options) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function move(e) {
|
|
20
|
+
if (options.disable != null && options.disable()) return;
|
|
20
21
|
e.preventDefault();
|
|
21
22
|
|
|
22
23
|
if (dragging.value) {
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.11
|
|
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.11";
|
|
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.11
|
|
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.11';
|
|
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.11",
|
|
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.12",
|
|
42
42
|
"monaco-editor": "^0.26.1",
|
|
43
43
|
"mxgraphx": "^4.0.7",
|
|
44
44
|
"resize-observer-polyfill": "^1.5.1",
|