@king-design/vue 3.1.0-beta.2 → 3.1.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/__tests__/__snapshots__/Vue Next Demos.md +217 -209
- package/__tests__/components/dialog.spec.ts +51 -12
- package/components/affix/index.d.ts +1 -1
- package/components/badge/index.d.ts +1 -1
- package/components/breadcrumb/index.d.ts +1 -1
- package/components/breadcrumb/item.d.ts +1 -1
- package/components/button/group.d.ts +1 -1
- package/components/button/index.d.ts +1 -1
- package/components/card/column.d.ts +1 -1
- package/components/card/index.d.ts +1 -1
- package/components/carousel/index.d.ts +1 -1
- package/components/carousel/index.vdt.js +1 -1
- package/components/carousel/item.d.ts +1 -1
- package/components/carousel/item.vdt.js +1 -1
- package/components/carousel/useSlide.d.ts +1 -1
- package/components/cascader/index.d.ts +3 -3
- package/components/cascader/index.vdt.js +1 -0
- package/components/checkbox/index.d.ts +1 -1
- package/components/code/index.d.ts +1 -1
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.vdt.js +1 -1
- package/components/collapse/item.d.ts +1 -1
- package/components/collapse/item.vdt.js +1 -1
- package/components/colorpicker/drag.d.ts +1 -1
- package/components/colorpicker/index.d.ts +1 -1
- package/components/colorpicker/panel.d.ts +1 -1
- package/components/colorpicker/panel.vdt.js +1 -1
- package/components/config/index.d.ts +9 -2
- package/components/config/index.js +4 -3
- package/components/copy/index.d.ts +2 -1
- package/components/copy/index.js +2 -1
- package/components/copy/index.spec.js +64 -1
- package/components/copy/index.vdt.js +1 -1
- package/components/copy/useCopy.d.ts +1 -1
- package/components/copy/useCopy.js +3 -1
- package/components/datepicker/calendar.d.ts +1 -1
- package/components/datepicker/calendar.vdt.js +1 -1
- package/components/datepicker/index.d.ts +4 -4
- package/components/datepicker/index.vdt.js +1 -1
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/usePanel.d.ts +1 -1
- package/components/diagram/diagram.d.ts +1 -1
- package/components/diagram/layouts/layout.d.ts +1 -1
- package/components/diagram/shapes/line.d.ts +1 -1
- package/components/diagram/shapes/shape.d.ts +1 -1
- package/components/dialog/base.d.ts +2 -2
- package/components/dialog/base.js +1 -1
- package/components/dialog/base.vdt.js +4 -4
- package/components/dialog/index.spec.js +87 -5
- package/components/dialog/styles.js +1 -1
- package/components/drawer/index.d.ts +1 -1
- package/components/drawer/index.spec.js +6 -4
- package/components/dropdown/item.d.ts +1 -1
- package/components/dropdown/menu.d.ts +1 -1
- package/components/dropdown/menu.vdt.js +1 -1
- package/components/editable/index.d.ts +1 -1
- package/components/form/form.d.ts +1 -1
- package/components/form/item.d.ts +1 -1
- package/components/form/item.vdt.js +1 -1
- package/components/form/useError.d.ts +4 -4
- package/components/grid/col.d.ts +1 -1
- package/components/grid/row.d.ts +1 -1
- package/components/grid/useGutter.d.ts +3 -3
- package/components/icon/index.d.ts +1 -1
- package/components/input/index.d.ts +1 -1
- package/components/input/search.d.ts +1 -1
- package/components/input/styles.js +1 -1
- package/components/layout/aside.d.ts +1 -1
- package/components/layout/aside.vdt.js +1 -1
- package/components/layout/body.d.ts +1 -1
- package/components/layout/footer.d.ts +1 -1
- package/components/layout/header.d.ts +1 -1
- package/components/layout/layout.d.ts +1 -1
- package/components/menu/item.d.ts +1 -1
- package/components/menu/item.vdt.js +23 -3
- package/components/menu/menu.d.ts +2 -1
- package/components/menu/menu.js +2 -1
- package/components/menu/menu.vdt.js +1 -1
- package/components/menu/styles.d.ts +1 -0
- package/components/menu/styles.js +10 -2
- package/components/menu/useDropdown.d.ts +1 -1
- package/components/menu/useDropdown.js +3 -6
- package/components/message/message.d.ts +1 -1
- package/components/message/messages.d.ts +1 -1
- package/components/message/messages.vdt.js +1 -1
- package/components/pagination/index.d.ts +1 -1
- package/components/popover/content.d.ts +1 -1
- package/components/portal.d.ts +1 -1
- package/components/portal.js +7 -1
- package/components/progress/index.d.ts +1 -1
- package/components/radio/index.d.ts +1 -1
- package/components/rate/index.d.ts +1 -1
- package/components/rate/index.vdt.js +1 -1
- package/components/scrollSelect/index.d.ts +1 -1
- package/components/select/base.d.ts +1 -1
- package/components/select/base.vdt.js +1 -1
- package/components/select/group.d.ts +1 -1
- package/components/select/menu.d.ts +1 -1
- package/components/select/option.d.ts +1 -1
- package/components/select/option.vdt.js +1 -1
- package/components/select/select.d.ts +3 -3
- package/components/select/useCard.d.ts +1 -1
- package/components/select/useLabel.d.ts +1 -1
- package/components/select/useSearchable.d.ts +3 -3
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/skeleton.d.ts +1 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.vdt.js +1 -1
- package/components/slider/useDraggable.d.ts +2 -2
- package/components/slider/useTooltip.d.ts +1 -1
- package/components/spin/index.d.ts +1 -1
- package/components/spin/index.vdt.js +1 -1
- package/components/spinner/index.d.ts +1 -1
- package/components/split/index.d.ts +1 -1
- package/components/split/memo.d.ts +1 -1
- package/components/split/useDraggable.d.ts +2 -2
- package/components/steps/context.d.ts +1 -1
- package/components/steps/index.d.ts +1 -1
- package/components/steps/step.d.ts +1 -1
- package/components/steps/step.vdt.js +1 -1
- package/components/switch/index.d.ts +1 -1
- package/components/table/cell.d.ts +1 -1
- package/components/table/column.d.ts +2 -2
- package/components/table/column.vdt.js +1 -1
- package/components/table/row.d.ts +1 -1
- package/components/table/row.vdt.js +3 -3
- package/components/table/styles.js +3 -2
- package/components/table/table.d.ts +2 -2
- package/components/table/table.vdt.js +2 -2
- package/components/table/useColumns.d.ts +5 -5
- package/components/table/useFixedColumns.d.ts +2 -2
- package/components/table/useGroup.d.ts +4 -4
- package/components/table/useResizable.d.ts +2 -2
- package/components/table/useSortable.d.ts +3 -3
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/useScroll.d.ts +1 -1
- package/components/tag/base.d.ts +1 -1
- package/components/tag/index.vdt.js +1 -1
- package/components/tag/tags.d.ts +1 -1
- package/components/tag/tags.vdt.js +1 -1
- package/components/tag/useChildren.d.ts +1 -1
- package/components/tag/useDraggable.d.ts +1 -1
- package/components/tag/useNowrap.d.ts +3 -3
- package/components/timeline/item.d.ts +1 -1
- package/components/timeline/timeline.d.ts +1 -1
- package/components/timepicker/index.d.ts +2 -2
- package/components/timepicker/panelPicker.d.ts +4 -4
- package/components/timepicker/selectPicker.d.ts +1 -1
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.vdt.js +1 -1
- package/components/tree/index.d.ts +6 -4
- package/components/tree/index.js +5 -0
- package/components/tree/index.spec.js +60 -39
- package/components/tree/index.vdt.js +1 -1
- package/components/tree/styles.js +1 -1
- package/components/tree/useDraggable.js +12 -12
- package/components/tree/useExpanded.d.ts +1 -0
- package/components/tree/useExpanded.js +23 -7
- package/components/tree/useNodes.d.ts +1 -0
- package/components/treeSelect/index.d.ts +2 -1
- package/components/treeSelect/index.js +4 -0
- package/components/treeSelect/useValue.d.ts +1 -1
- package/components/upload/index.d.ts +7 -6
- package/components/upload/index.js +1 -0
- package/components/upload/index.vdt.js +1 -1
- package/components/upload/useFiles.js +21 -8
- package/components/utils.d.ts +1 -1
- package/components/virtual.d.ts +1 -1
- package/components/wave/index.d.ts +1 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import {createApp, render, defineComponent} from 'vue';
|
|
2
|
-
import {mount, unmount, dispatchEvent, getElement, wait} from '@/test/utils';
|
|
2
|
+
import {mount, unmount, dispatchEvent, getElement, wait, getElements} from '@/test/utils';
|
|
3
3
|
import {Dialog, Select} from '../../';
|
|
4
4
|
|
|
5
5
|
describe('Dialog', () => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let container: HTMLDivElement;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
container = document.createElement('div');
|
|
8
9
|
document.body.appendChild(container);
|
|
10
|
+
});
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
render(null, container);
|
|
13
|
+
document.body.removeChild(container);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('call static method', async () => {
|
|
9
17
|
const vue = createApp({
|
|
10
18
|
template: `
|
|
11
19
|
<div @click="test">click</div>
|
|
@@ -29,15 +37,9 @@ describe('Dialog', () => {
|
|
|
29
37
|
|
|
30
38
|
(vue as any).close();
|
|
31
39
|
await wait(500);
|
|
32
|
-
|
|
33
|
-
render(null, container);
|
|
34
|
-
document.body.removeChild(container);
|
|
35
40
|
});
|
|
36
41
|
|
|
37
42
|
it('should mount select into dialog element rather than body', async () => {
|
|
38
|
-
const container = document.createElement('div');
|
|
39
|
-
document.body.appendChild(container);
|
|
40
|
-
|
|
41
43
|
const Foo = defineComponent({
|
|
42
44
|
template: `<Select />`,
|
|
43
45
|
components: { Select },
|
|
@@ -54,9 +56,46 @@ describe('Dialog', () => {
|
|
|
54
56
|
}).mount(container);
|
|
55
57
|
|
|
56
58
|
await wait();
|
|
57
|
-
expect(document.querySelector('.k-select-menu')
|
|
59
|
+
expect(document.querySelector('.k-select-menu')!.closest('.k-dialog')).to.be.exist;
|
|
60
|
+
});
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
it('show nested dialog', async () => {
|
|
63
|
+
const Foo = defineComponent({
|
|
64
|
+
template: `<Dialog :value="value">test</Dialog>`,
|
|
65
|
+
components: { Dialog },
|
|
66
|
+
props: {
|
|
67
|
+
value: Boolean,
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const Bar = defineComponent({
|
|
72
|
+
template: `
|
|
73
|
+
<Dialog v-model="value">
|
|
74
|
+
<div @click="show = true">click</div>
|
|
75
|
+
<Foo :value="show" />
|
|
76
|
+
</Dialog>
|
|
77
|
+
`,
|
|
78
|
+
components: { Dialog, Foo },
|
|
79
|
+
data() {
|
|
80
|
+
return { value: false, show: false };
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const vue = createApp({
|
|
85
|
+
template: `<Bar ref="bar" />`,
|
|
86
|
+
components: { Bar },
|
|
87
|
+
})
|
|
88
|
+
vue.mount(container);
|
|
89
|
+
|
|
90
|
+
await wait();
|
|
91
|
+
|
|
92
|
+
(vue._instance!.refs.bar as any).value = true;
|
|
93
|
+
await wait();
|
|
94
|
+
|
|
95
|
+
(vue._instance!.refs.bar as any).show = true;
|
|
96
|
+
await wait();
|
|
97
|
+
|
|
98
|
+
const [dialog1, dialog2] = getElements('.k-dialog');
|
|
99
|
+
expect(dialog2.querySelector('.k-dialog-body')!.textContent).to.eql('test');
|
|
61
100
|
});
|
|
62
101
|
});
|
|
@@ -22,7 +22,7 @@ export declare type ShouldFixParam = {
|
|
|
22
22
|
viewportHeight?: number;
|
|
23
23
|
};
|
|
24
24
|
export declare class Affix extends Component<AffixProps, AffixEvents> {
|
|
25
|
-
static template: string | import(
|
|
25
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
26
26
|
static typeDefs: Required<TypeDefs<AffixProps>>;
|
|
27
27
|
private elementRef;
|
|
28
28
|
private style;
|
|
@@ -5,7 +5,7 @@ export interface BadgeProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare class Badge extends Component<BadgeProps> {
|
|
8
|
-
static template: string | import(
|
|
8
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
9
9
|
static typeDefs: Required<TypeDefs<BadgeProps>>;
|
|
10
10
|
private config;
|
|
11
11
|
}
|
|
@@ -9,7 +9,7 @@ export interface BreadcrumbBlocks {
|
|
|
9
9
|
separator: null;
|
|
10
10
|
}
|
|
11
11
|
export declare class Breadcrumb extends Component<BreadcrumbProps, BreadcrumbEvents, BreadcrumbBlocks> {
|
|
12
|
-
static template: string | import(
|
|
12
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
13
13
|
static typeDefs: Required<TypeDefs<BreadcrumbProps>>;
|
|
14
14
|
static defaults: () => Partial<BreadcrumbProps>;
|
|
15
15
|
private config;
|
|
@@ -3,7 +3,7 @@ export interface BreadcrumbItemProps {
|
|
|
3
3
|
to?: string | object;
|
|
4
4
|
}
|
|
5
5
|
export declare class BreadcrumbItem extends Component<BreadcrumbItemProps> {
|
|
6
|
-
static template: string | import(
|
|
6
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
7
7
|
static typeDefs: Required<TypeDefs<BreadcrumbItemProps>>;
|
|
8
8
|
private router;
|
|
9
9
|
private config;
|
|
@@ -7,7 +7,7 @@ export interface ButtonGroupProps {
|
|
|
7
7
|
seperate?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare class ButtonGroup extends Component<ButtonGroupProps> {
|
|
10
|
-
static template: string | import(
|
|
10
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
11
11
|
static typeDefs: Required<TypeDefs<ButtonGroupProps>>;
|
|
12
12
|
static defaults: () => Partial<ButtonGroupProps>;
|
|
13
13
|
private config;
|
|
@@ -33,7 +33,7 @@ export interface ButtonEvents {
|
|
|
33
33
|
mouseup: [MouseEvent];
|
|
34
34
|
}
|
|
35
35
|
export declare class Button extends Component<ButtonProps, ButtonEvents> {
|
|
36
|
-
static template: string | import(
|
|
36
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
37
37
|
static typeDefs: Required<TypeDefs<Omit<ButtonProps, keyof ButtonHTMLAttributes>>>;
|
|
38
38
|
static defaults: () => Partial<ButtonProps>;
|
|
39
39
|
private buttonGroup;
|
|
@@ -4,7 +4,7 @@ export interface CardColumnProps {
|
|
|
4
4
|
center?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare class CardColumn extends Component<CardColumnProps> {
|
|
7
|
-
static template: string | import(
|
|
7
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
8
8
|
static typeDefs: Required<TypeDefs<CardColumnProps>>;
|
|
9
9
|
private config;
|
|
10
10
|
}
|
|
@@ -12,7 +12,7 @@ export interface CardBlocks {
|
|
|
12
12
|
extra: null;
|
|
13
13
|
}
|
|
14
14
|
export declare class Card extends Component<CardProps, CardEvents, CardBlocks> {
|
|
15
|
-
static template: string | import(
|
|
15
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
16
16
|
static typeDefs: Required<TypeDefs<CardProps>>;
|
|
17
17
|
static defaults: () => Partial<CardProps>;
|
|
18
18
|
private config;
|
|
@@ -8,7 +8,7 @@ export interface CarouselProps {
|
|
|
8
8
|
clonedAmount?: number;
|
|
9
9
|
}
|
|
10
10
|
export declare class Carousel extends Component<CarouselProps> {
|
|
11
|
-
static template: string | import(
|
|
11
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
12
12
|
static typeDefs: Required<TypeDefs<CarouselProps>>;
|
|
13
13
|
static defaults: () => Partial<CarouselProps>;
|
|
14
14
|
private items;
|
|
@@ -5,7 +5,7 @@ import { CarouselItem } from './item';
|
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import { Icon } from '../icon';
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
|
-
import { linkEvent } from 'intact';
|
|
8
|
+
import { linkEvent } from 'intact-vue-next';
|
|
9
9
|
export default function ($props, $blocks, $__proto__) {
|
|
10
10
|
var _classNameObj;
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@ export interface CarouselItemProps {
|
|
|
4
4
|
cloned?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare class CarouselItem extends Component<CarouselItemProps> {
|
|
7
|
-
static template: string | import(
|
|
7
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
8
8
|
static typeDefs: Required<TypeDefs<CarouselItemProps>>;
|
|
9
9
|
private config;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { createUnknownComponentVNode as _$cc, createVNode as _$cv, className as _$cn } from 'intact-vue-next';
|
|
3
|
-
import { Transition } from 'intact';
|
|
3
|
+
import { Transition } from 'intact-vue-next';
|
|
4
4
|
import { getRestProps } from '../utils';
|
|
5
5
|
import { makeItemStyles } from './styles';
|
|
6
6
|
export default function ($props, $blocks, $__proto__) {
|
|
@@ -3,7 +3,7 @@ import type { CarouselItem } from './item';
|
|
|
3
3
|
export declare function useSlide(getItems: () => VNodeComponentClass<CarouselItem>[], getItemsWithCloned: () => VNodeComponentClass<CarouselItem>[]): {
|
|
4
4
|
translate: import("../../hooks/useState").State<number>;
|
|
5
5
|
shouldTransition: import("../../hooks/useState").State<boolean>;
|
|
6
|
-
elementRef: import(
|
|
6
|
+
elementRef: import('intact-vue-next').RefObject<HTMLElement>;
|
|
7
7
|
translateToItem: (item: VNodeComponentClass<CarouselItem>, oldIndex: number | null, newIndex: number | null, keepDirection: boolean) => Promise<void>;
|
|
8
8
|
isSlide: () => boolean;
|
|
9
9
|
};
|
|
@@ -30,7 +30,7 @@ export interface CascaderEvents extends BaseSelectEvents {
|
|
|
30
30
|
export interface CascaderBlocks<V> extends BaseSelectBlocks<V> {
|
|
31
31
|
}
|
|
32
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(
|
|
33
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
34
34
|
static typeDefs: Required<TypeDefs<CascaderProps<any, boolean, CascaderData<any>>>>;
|
|
35
35
|
static defaults: () => Partial<CascaderProps<any, boolean, CascaderData<any>>>;
|
|
36
36
|
private fields;
|
|
@@ -39,7 +39,7 @@ export declare class Cascader<V = any, Multipe extends boolean = false, Data ext
|
|
|
39
39
|
private load;
|
|
40
40
|
private filterable;
|
|
41
41
|
private positionObj;
|
|
42
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import(
|
|
43
|
-
protected getLabel(): import(
|
|
42
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
|
|
43
|
+
protected getLabel(): import('intact-vue-next').Children;
|
|
44
44
|
protected hasValue(): any;
|
|
45
45
|
}
|
|
@@ -21,6 +21,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
21
21
|
fields = _this$get.fields;
|
|
22
22
|
|
|
23
23
|
var k = this.config.k;
|
|
24
|
+
var baseMenuStyles = makeMenuStyles(k);
|
|
24
25
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-cascader-menu"] = true, _classNameObj[makeMenuStyles(k)] = true, _classNameObj);
|
|
25
26
|
var getField = this.fields;
|
|
26
27
|
|
|
@@ -12,7 +12,7 @@ export interface CheckboxEvents<V = boolean> {
|
|
|
12
12
|
change: [V, MouseEvent];
|
|
13
13
|
}
|
|
14
14
|
export declare class Checkbox<V = boolean> extends Component<CheckboxProps<V>, CheckboxEvents<V>> {
|
|
15
|
-
static template: string | import(
|
|
15
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
16
16
|
static typeDefs: Required<TypeDefs<Omit<CheckboxProps<boolean>, keyof CommonInputHTMLAttributes>>>;
|
|
17
17
|
static defaults: () => Partial<CheckboxProps<boolean>>;
|
|
18
18
|
static events: Events<CheckboxEvents<boolean>>;
|
|
@@ -14,7 +14,7 @@ export interface CodeEvents {
|
|
|
14
14
|
ready: [editor.IStandaloneCodeEditor, typeof editor, typeof monaco];
|
|
15
15
|
}
|
|
16
16
|
export declare class Code extends Component<CodeProps, CodeEvents> {
|
|
17
|
-
static template: string | import(
|
|
17
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
18
18
|
static typeDefs: Required<TypeDefs<CodeProps>>;
|
|
19
19
|
static defaults: () => Partial<CodeProps>;
|
|
20
20
|
static events: Events<CodeEvents>;
|
|
@@ -11,7 +11,7 @@ export interface CollapseEvents {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const COLLAPSE = "Collapse";
|
|
13
13
|
export declare class Collapse extends Component<CollapseProps, CollapseEvents> {
|
|
14
|
-
static template: string | import(
|
|
14
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
15
15
|
static typeDefs: Required<TypeDefs<CollapseProps>>;
|
|
16
16
|
static defaults: () => Partial<CollapseProps>;
|
|
17
17
|
private config;
|
|
@@ -4,7 +4,7 @@ import { CollapseItem } from './item';
|
|
|
4
4
|
import { mapChildren, getRestProps } from '../utils';
|
|
5
5
|
import { makeStyles } from './styles';
|
|
6
6
|
import { isNullOrUndefined } from 'intact-shared';
|
|
7
|
-
import { directClone } from 'intact';
|
|
7
|
+
import { directClone } from 'intact-vue-next';
|
|
8
8
|
export default function ($props, $blocks, $__proto__) {
|
|
9
9
|
var _classNameObj;
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ export interface CollapseItemBlocks {
|
|
|
12
12
|
title: null;
|
|
13
13
|
}
|
|
14
14
|
export declare class CollapseItem extends Component<CollapseItemProps, CollapseItemEvents, CollapseItemBlocks> {
|
|
15
|
-
static template: string | import(
|
|
15
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
16
16
|
static typeDefs: Required<TypeDefs<CollapseItemProps>>;
|
|
17
17
|
private collapse;
|
|
18
18
|
private config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, createUnknownComponentVNode as _$cc } from 'intact-vue-next';
|
|
3
|
-
import { Transition } from 'intact';
|
|
3
|
+
import { Transition } from 'intact-vue-next';
|
|
4
4
|
import { expandAnimationCallbacks, getRestProps } from '../utils';
|
|
5
5
|
import { makeItemStyles } from './styles';
|
|
6
6
|
import { Icon } from '../icon';
|
|
@@ -9,7 +9,7 @@ interface ColorpickerDragEvents {
|
|
|
9
9
|
click: [];
|
|
10
10
|
}
|
|
11
11
|
export declare class ColorpickerDrag extends Component<ColorpickerDragProps, ColorpickerDragEvents> {
|
|
12
|
-
static template: string | import(
|
|
12
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
13
13
|
private drag;
|
|
14
14
|
private config;
|
|
15
15
|
}
|
|
@@ -14,7 +14,7 @@ export interface ColorpickerProps {
|
|
|
14
14
|
export interface ColorpickerEvents {
|
|
15
15
|
}
|
|
16
16
|
export declare class Colorpicker extends Component<ColorpickerProps, ColorpickerEvents> {
|
|
17
|
-
static template: string | import(
|
|
17
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
18
18
|
static typeDefs: Required<TypeDefs<ColorpickerProps>>;
|
|
19
19
|
static defaults: () => Partial<ColorpickerProps>;
|
|
20
20
|
private config;
|
|
@@ -4,7 +4,7 @@ export interface ColorpickerPanelProps {
|
|
|
4
4
|
presets?: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare class ColorpickerPanel extends Component<ColorpickerPanelProps> {
|
|
7
|
-
static template: string | import(
|
|
7
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
8
8
|
private value;
|
|
9
9
|
private pointer;
|
|
10
10
|
private input;
|
|
@@ -4,7 +4,7 @@ import { Row, Col } from '../grid';
|
|
|
4
4
|
import { Slider } from '../slider';
|
|
5
5
|
import { Input } from '../input';
|
|
6
6
|
import { makePanelStyles, makeAlphaBgColor } from './styles';
|
|
7
|
-
import { linkEvent } from 'intact';
|
|
7
|
+
import { linkEvent } from 'intact-vue-next';
|
|
8
8
|
import { Mode } from './useInput';
|
|
9
9
|
import { ColorpickerDrag as Drag } from './drag';
|
|
10
10
|
export default function ($props, $blocks, $__proto__) {
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { ProviderProps } from '../context';
|
|
2
|
+
import { Component } from 'intact-vue-next';
|
|
2
3
|
export interface ConfigProps {
|
|
3
4
|
classNamePrefix?: string;
|
|
4
5
|
}
|
|
5
|
-
declare const
|
|
6
|
+
declare const ConfigConsumer: import('intact-vue-next').ComponentConstructor<Component<import("../context").ConsumerProps<ConfigProps>, {}, {}, {}>>;
|
|
6
7
|
declare function useConfigContext(): {
|
|
7
8
|
cls: (name: string) => string;
|
|
8
9
|
readonly k: string;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* for vue/react type checking
|
|
13
|
+
*/
|
|
14
|
+
export declare class _ConfigProvider extends Component<ProviderProps<ConfigProps>> {
|
|
15
|
+
}
|
|
16
|
+
export declare const ConfigProvider: typeof _ConfigProvider;
|
|
17
|
+
export { ConfigConsumer, useConfigContext, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext } from '../context';
|
|
2
|
-
import { EMPTY_OBJ } from 'intact-vue-next';
|
|
2
|
+
import { EMPTY_OBJ, Component } from 'intact-vue-next';
|
|
3
3
|
|
|
4
4
|
var _createContext = createContext(EMPTY_OBJ),
|
|
5
|
-
|
|
5
|
+
Provider = _createContext.Provider,
|
|
6
6
|
ConfigConsumer = _createContext.Consumer,
|
|
7
7
|
useContext = _createContext.useContext;
|
|
8
8
|
|
|
@@ -20,4 +20,5 @@ function useConfigContext() {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
23
|
+
export var ConfigProvider = Provider;
|
|
24
|
+
export { ConfigConsumer, useConfigContext };
|
|
@@ -7,9 +7,10 @@ export interface CopyProps {
|
|
|
7
7
|
export interface CopyEvents {
|
|
8
8
|
success: [string];
|
|
9
9
|
error: [];
|
|
10
|
+
click: [MouseEvent];
|
|
10
11
|
}
|
|
11
12
|
export declare class Copy extends Component<CopyProps, CopyEvents> {
|
|
12
|
-
static template: string | import(
|
|
13
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
13
14
|
static typeDefs: Required<TypeDefs<CopyProps>>;
|
|
14
15
|
static defaults: () => Partial<CopyProps>;
|
|
15
16
|
static events: Events<CopyEvents>;
|
package/components/copy/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
4
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
5
|
import BasicDemo from '~/components/copy/demos/basic';
|
|
4
|
-
import { mount, unmount } from '../../test/utils';
|
|
6
|
+
import { mount, unmount, wait } from '../../test/utils';
|
|
7
|
+
import { Tooltip } from '../tooltip';
|
|
8
|
+
import { Component } from 'intact-vue-next';
|
|
9
|
+
import { Copy } from '.';
|
|
5
10
|
describe('Copy', function () {
|
|
6
11
|
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
7
12
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -49,4 +54,62 @@ describe('Copy', function () {
|
|
|
49
54
|
}
|
|
50
55
|
}, _callee2, null, [[2, 9]]);
|
|
51
56
|
})));
|
|
57
|
+
it('wrap copy with tooltip', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
58
|
+
var Demo, _mount2, instance, element, text;
|
|
59
|
+
|
|
60
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
61
|
+
while (1) {
|
|
62
|
+
switch (_context4.prev = _context4.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
65
|
+
_inheritsLoose(Demo, _Component);
|
|
66
|
+
|
|
67
|
+
function Demo() {
|
|
68
|
+
var _context3;
|
|
69
|
+
|
|
70
|
+
var _this;
|
|
71
|
+
|
|
72
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
+
args[_key] = arguments[_key];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context3 = [this]).call(_context3, args)) || this;
|
|
77
|
+
_this.Tooltip = Tooltip;
|
|
78
|
+
_this.Copy = Copy;
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return Demo;
|
|
83
|
+
}(Component);
|
|
84
|
+
|
|
85
|
+
Demo.template = "\n const { Tooltip, Copy } = this;\n <Tooltip content=\"test\">\n <Copy text=\"test\" />\n </Tooltip>\n ";
|
|
86
|
+
_mount2 = mount(Demo), instance = _mount2[0], element = _mount2[1];
|
|
87
|
+
element.click();
|
|
88
|
+
_context4.next = 6;
|
|
89
|
+
return wait();
|
|
90
|
+
|
|
91
|
+
case 6:
|
|
92
|
+
_context4.prev = 6;
|
|
93
|
+
_context4.next = 9;
|
|
94
|
+
return navigator.clipboard.readText();
|
|
95
|
+
|
|
96
|
+
case 9:
|
|
97
|
+
text = _context4.sent;
|
|
98
|
+
expect(text).to.eql('test');
|
|
99
|
+
_context4.next = 16;
|
|
100
|
+
break;
|
|
101
|
+
|
|
102
|
+
case 13:
|
|
103
|
+
_context4.prev = 13;
|
|
104
|
+
_context4.t0 = _context4["catch"](6);
|
|
105
|
+
// Read permisson denied
|
|
106
|
+
console.log(_context4.t0);
|
|
107
|
+
|
|
108
|
+
case 16:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context4.stop();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, _callee3, null, [[6, 13]]);
|
|
114
|
+
})));
|
|
52
115
|
});
|
|
@@ -3,7 +3,7 @@ import { createUnknownComponentVNode as _$cc, className as _$cn } from 'intact-v
|
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
4
|
import { getRestProps } from '../utils';
|
|
5
5
|
import { Virtual } from '../virtual';
|
|
6
|
-
import { Transition } from 'intact';
|
|
6
|
+
import { Transition } from 'intact-vue-next';
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
8
|
import { _$ } from '../../i18n';
|
|
9
9
|
export default function ($props, $blocks, $__proto__) {
|
|
@@ -8,7 +8,7 @@ export function useCopy() {
|
|
|
8
8
|
var success = useState(false);
|
|
9
9
|
var timer;
|
|
10
10
|
return {
|
|
11
|
-
startCopy: function startCopy() {
|
|
11
|
+
startCopy: function startCopy(e) {
|
|
12
12
|
var _instance$get = instance.get(),
|
|
13
13
|
text = _instance$get.text,
|
|
14
14
|
showMessage = _instance$get.showMessage;
|
|
@@ -30,6 +30,8 @@ export function useCopy() {
|
|
|
30
30
|
success.set(false);
|
|
31
31
|
instance.trigger('error');
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
instance.trigger('click', e);
|
|
33
35
|
},
|
|
34
36
|
success: success
|
|
35
37
|
};
|
|
@@ -12,7 +12,7 @@ export interface DatepickerCalendarEvents {
|
|
|
12
12
|
change: [Dayjs, PanelFlags];
|
|
13
13
|
}
|
|
14
14
|
export declare class DatepickerCalendar extends Component<DatepickerCalendarProps, DatepickerCalendarEvents> {
|
|
15
|
-
static template: string | import(
|
|
15
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
16
16
|
static defaults: () => Partial<DatepickerCalendarProps>;
|
|
17
17
|
type: import("../../hooks/useState").State<Required<"date" | "month" | "year" | undefined>>;
|
|
18
18
|
datepicker: Datepicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { map as _$ma, createElementVNode as _$ce, className as _$cn, createUnknownComponentVNode as _$cc } from 'intact-vue-next';
|
|
2
|
-
import { Transition } from 'intact';
|
|
2
|
+
import { Transition } from 'intact-vue-next';
|
|
3
3
|
import { Button } from '../button';
|
|
4
4
|
import { Icon } from '../icon';
|
|
5
5
|
import { _$ } from '../../i18n';
|
|
@@ -13,7 +13,7 @@ export interface DatepickerEvents extends BasePickerEvents {
|
|
|
13
13
|
export interface DatepickerBlocks<V extends Value = Value, R extends boolean = boolean> extends BasePickerBlocks<V, R> {
|
|
14
14
|
}
|
|
15
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(
|
|
16
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
17
17
|
static typeDefs: Required<TypeDefs<DatepickerProps<Value, boolean, boolean>>>;
|
|
18
18
|
static defaults: () => Partial<DatepickerProps<Value, boolean, boolean>>;
|
|
19
19
|
formats: {
|
|
@@ -37,8 +37,8 @@ export declare class Datepicker<V extends Value = Value, M extends boolean = fal
|
|
|
37
37
|
changePanel: (type: import("./usePanel").PanelTypes, flag?: import("./usePanel").PanelFlags) => void;
|
|
38
38
|
getPanel: (flag: import("./usePanel").PanelFlags) => State<import("./usePanel").PanelTypes>;
|
|
39
39
|
reset: () => void;
|
|
40
|
-
startRef: import(
|
|
41
|
-
endRef: import(
|
|
40
|
+
startRef: import('intact-vue-next').RefObject<import("./calendar").DatepickerCalendar>;
|
|
41
|
+
endRef: import('intact-vue-next').RefObject<import("./calendar").DatepickerCalendar>;
|
|
42
42
|
};
|
|
43
43
|
focusDate: {
|
|
44
44
|
focusDate: State<dayjs.Dayjs | null>;
|
|
@@ -56,7 +56,7 @@ export declare class Datepicker<V extends Value = Value, M extends boolean = fal
|
|
|
56
56
|
onChangeDate: (v: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
|
|
57
57
|
};
|
|
58
58
|
init(): void;
|
|
59
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import(
|
|
59
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import('intact-vue-next').Children[];
|
|
60
60
|
protected getLabel(): string | string[];
|
|
61
61
|
protected clear(e: MouseEvent): void;
|
|
62
62
|
private setByShortcut;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
2
|
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, createTextVNode as _$ct } from 'intact-vue-next';
|
|
3
|
-
import { linkEvent } from 'intact';
|
|
3
|
+
import { linkEvent } from 'intact-vue-next';
|
|
4
4
|
import { DropdownMenu } from '../dropdown';
|
|
5
5
|
import { DatepickerCalendar } from './calendar';
|
|
6
6
|
import { DatepickerTime } from './time';
|
|
@@ -13,7 +13,7 @@ declare type Value = {
|
|
|
13
13
|
s: number;
|
|
14
14
|
};
|
|
15
15
|
export declare class DatepickerTime extends Component<DatepickerTimeProps> {
|
|
16
|
-
static template: string | import(
|
|
16
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
17
17
|
value: import("../../hooks/useState").State<Value>;
|
|
18
18
|
disabled: {
|
|
19
19
|
disableSeconds: import("../../hooks/useState").State<boolean>;
|
|
@@ -14,5 +14,5 @@ export declare function usePanel(type?: PanelTypes): {
|
|
|
14
14
|
getPanel: (flag: PanelFlags) => import("../../hooks/useState").State<PanelTypes>;
|
|
15
15
|
reset: () => void;
|
|
16
16
|
startRef: import('intact-vue-next').RefObject<DatepickerCalendar>;
|
|
17
|
-
endRef: import(
|
|
17
|
+
endRef: import('intact-vue-next').RefObject<DatepickerCalendar>;
|
|
18
18
|
};
|
|
@@ -10,7 +10,7 @@ export interface DiagramEvents {
|
|
|
10
10
|
selectionChanged: [any[]];
|
|
11
11
|
}
|
|
12
12
|
export declare class Diagram extends Component<DiagramProps, DiagramEvents> {
|
|
13
|
-
static template: string | import(
|
|
13
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
14
14
|
static events: Events<DiagramEvents>;
|
|
15
15
|
graph: any;
|
|
16
16
|
cell: any;
|
|
@@ -8,7 +8,7 @@ export interface DLayoutProps {
|
|
|
8
8
|
top?: number | string;
|
|
9
9
|
}
|
|
10
10
|
export declare abstract class DLayout<P extends DLayoutProps = DLayoutProps> extends Component<P> {
|
|
11
|
-
static template: (this: DLayout) => import(
|
|
11
|
+
static template: (this: DLayout) => import('intact-vue-next').VNode<string>;
|
|
12
12
|
static typeDefs: Required<TypeDefs<DLayoutProps>>;
|
|
13
13
|
static defaults: () => Partial<DLayoutProps>;
|
|
14
14
|
private diagram;
|