yc-design-vue 1.0.1 → 1.0.3
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/es/Affix/type.d.ts +3 -2
- package/es/Alert/type.d.ts +6 -5
- package/es/Anchor/type.d.ts +4 -3
- package/es/AutoComplete/index.d.ts +65 -2
- package/es/AutoComplete/index.vue.d.ts +130 -4
- package/es/AutoComplete/type.d.ts +5 -4
- package/es/Avatar/AvatarGroup.vue.js +1 -1
- package/es/Avatar/AvatarGroup.vue2.js +2 -2
- package/es/Avatar/type.d.ts +4 -4
- package/es/BackTop/type.d.ts +2 -1
- package/es/Badge/index.vue.js +1 -1
- package/es/Badge/index.vue2.js +2 -2
- package/es/Badge/type.d.ts +3 -3
- package/es/Breadcrumb/type.d.ts +9 -8
- package/es/Button/Button.vue.js +1 -1
- package/es/Button/Button.vue2.js +2 -2
- package/es/Button/type.d.ts +4 -3
- package/es/Calendar/type.d.ts +5 -4
- package/es/Card/type.d.ts +10 -10
- package/es/Carousel/type.d.ts +3 -2
- package/es/Cascader/type.d.ts +10 -10
- package/es/Checkbox/hooks/useContext.d.ts +2 -5
- package/es/Checkbox/type.d.ts +9 -8
- package/es/Collapse/type.d.ts +9 -8
- package/es/Comment/type.d.ts +7 -6
- package/es/ConfigProvider/index.vue.js +2 -2
- package/es/ConfigProvider/type.d.ts +5 -4
- package/es/Descriptions/type.d.ts +9 -9
- package/es/Divider/type.d.ts +2 -1
- package/es/Drawer/Drawer.vue.js +1 -1
- package/es/Drawer/Drawer.vue2.js +6 -7
- package/es/Drawer/type.d.ts +5 -5
- package/es/Dropdown/Dsubmenu.vue.d.ts +130 -4
- package/es/Dropdown/Dsubmenu.vue.js +1 -1
- package/es/Dropdown/Dsubmenu.vue2.js +2 -2
- package/es/Dropdown/index.d.ts +65 -2
- package/es/Dropdown/type.d.ts +15 -14
- package/es/Empty/type.d.ts +2 -1
- package/es/Grid/type.d.ts +6 -5
- package/es/Icon/type.d.ts +2 -1
- package/es/Image/type.d.ts +11 -10
- package/es/Input/hooks/useCursor.d.ts +2 -1
- package/es/Input/hooks/useCursor.js +2 -2
- package/es/Input/type.d.ts +6 -5
- package/es/InputNumber/type.d.ts +8 -8
- package/es/InputTag/type.d.ts +5 -4
- package/es/Layout/Layout.vue.js +1 -1
- package/es/Layout/Layout.vue2.js +2 -2
- package/es/Layout/type.d.ts +8 -7
- package/es/Link/type.d.ts +3 -2
- package/es/List/List.vue.js +1 -1
- package/es/List/List.vue2.js +1 -1
- package/es/List/type.d.ts +15 -14
- package/es/Mention/index.d.ts +65 -2
- package/es/Mention/index.vue.d.ts +130 -4
- package/es/Mention/type.d.ts +3 -2
- package/es/Menu/type.d.ts +11 -10
- package/es/Message/type.d.ts +1 -1
- package/es/Modal/Modal.vue.js +1 -1
- package/es/Modal/Modal.vue2.js +4 -6
- package/es/Modal/hooks/useModalClose.d.ts +2 -1
- package/es/Modal/hooks/useModalClose.js +1 -6
- package/es/Modal/type.d.ts +5 -5
- package/es/Notification/type.d.ts +1 -1
- package/es/OverflowList/index.vue.js +1 -1
- package/es/OverflowList/index.vue2.js +4 -4
- package/es/OverflowList/type.d.ts +3 -2
- package/es/PageHeader/type.d.ts +7 -6
- package/es/Pagination/type.d.ts +8 -8
- package/es/Popconfirm/index.d.ts +65 -2
- package/es/Popconfirm/index.vue.d.ts +130 -4
- package/es/Popconfirm/type.d.ts +4 -4
- package/es/Popover/type.d.ts +4 -4
- package/es/Radio/hooks/useContext.d.ts +3 -6
- package/es/Radio/type.d.ts +9 -8
- package/es/Rate/type.d.ts +3 -2
- package/es/ResizeBox/type.d.ts +6 -5
- package/es/Result/type.d.ts +6 -5
- package/es/Scrollbar/Scrollbar.vue.js +1 -1
- package/es/Scrollbar/type.d.ts +2 -2
- package/es/Select/Select.vue.d.ts +130 -4
- package/es/Select/SelectView.vue.js +1 -1
- package/es/Select/SelectView.vue2.js +1 -1
- package/es/Select/index.d.ts +65 -2
- package/es/Select/type.d.ts +19 -18
- package/es/Skeleton/type.d.ts +3 -2
- package/es/Space/index.vue.js +1 -1
- package/es/Space/index.vue2.js +2 -2
- package/es/Space/type.d.ts +3 -2
- package/es/Spin/index.vue.js +1 -1
- package/es/Spin/index.vue2.js +1 -1
- package/es/Spin/type.d.ts +4 -3
- package/es/Split/type.d.ts +5 -4
- package/es/Statistic/type.d.ts +7 -7
- package/es/Steps/type.d.ts +8 -7
- package/es/Switch/index.vue.js +1 -1
- package/es/Switch/index.vue2.js +3 -3
- package/es/Switch/type.d.ts +5 -4
- package/es/Tabs/Tabs.vue.js +1 -1
- package/es/Tabs/Tabs.vue2.js +2 -2
- package/es/Tabs/type.d.ts +5 -4
- package/es/Tag/type.d.ts +4 -3
- package/es/TimePicker/type.d.ts +4 -3
- package/es/Timeline/type.d.ts +6 -5
- package/es/Tooltip/type.d.ts +3 -3
- package/es/Transfer/type.d.ts +13 -12
- package/es/Trigger/hooks/useContext.js +1 -1
- package/es/Trigger/hooks/useTriggerPosition.d.ts +2 -2
- package/es/Trigger/hooks/useTriggerPosition.js +12 -22
- package/es/Trigger/hooks/useTriggerVisible.js +1 -2
- package/es/Trigger/index.d.ts +63 -2
- package/es/Trigger/index.vue.d.ts +130 -3
- package/es/Trigger/index.vue.js +1 -1
- package/es/Trigger/index.vue2.js +2 -2
- package/es/Trigger/type.d.ts +3 -3
- package/es/Typography/type.d.ts +8 -7
- package/es/Watermark/type.d.ts +2 -1
- package/es/_shared/type/index.d.ts +1 -6
- package/es/_shared/utils/dom.d.ts +5 -5
- package/es/_shared/utils/dom.js +8 -9
- package/es/_shared/utils/fn.d.ts +3 -3
- package/es/_shared/utils/fn.js +6 -6
- package/es/_shared/utils/global-config.d.ts +4 -2
- package/es/_shared/utils/vue-utils.d.ts +1 -2
- package/es/_shared/utils/vue-utils.js +2 -7
- package/es/index.d.ts +66 -3
- package/es/style.css +1 -1
- package/lib/Affix/type.d.ts +3 -2
- package/lib/Alert/type.d.ts +6 -5
- package/lib/Anchor/type.d.ts +4 -3
- package/lib/AutoComplete/index.d.ts +65 -2
- package/lib/AutoComplete/index.vue.d.ts +130 -4
- package/lib/AutoComplete/type.d.ts +5 -4
- package/lib/Avatar/AvatarGroup.vue.js +1 -1
- package/lib/Avatar/AvatarGroup.vue2.js +1 -1
- package/lib/Avatar/type.d.ts +4 -4
- package/lib/BackTop/type.d.ts +2 -1
- package/lib/Badge/index.vue.js +1 -1
- package/lib/Badge/index.vue2.js +1 -1
- package/lib/Badge/type.d.ts +3 -3
- package/lib/Breadcrumb/type.d.ts +9 -8
- package/lib/Button/Button.vue.js +1 -1
- package/lib/Button/Button.vue2.js +1 -1
- package/lib/Button/type.d.ts +4 -3
- package/lib/Calendar/type.d.ts +5 -4
- package/lib/Card/type.d.ts +10 -10
- package/lib/Carousel/type.d.ts +3 -2
- package/lib/Cascader/type.d.ts +10 -10
- package/lib/Checkbox/hooks/useContext.d.ts +2 -5
- package/lib/Checkbox/type.d.ts +9 -8
- package/lib/Collapse/type.d.ts +9 -8
- package/lib/Comment/type.d.ts +7 -6
- package/lib/ConfigProvider/index.vue.js +1 -1
- package/lib/ConfigProvider/type.d.ts +5 -4
- package/lib/Descriptions/type.d.ts +9 -9
- package/lib/Divider/type.d.ts +2 -1
- package/lib/Drawer/Drawer.vue.js +1 -1
- package/lib/Drawer/Drawer.vue2.js +1 -1
- package/lib/Drawer/type.d.ts +5 -5
- package/lib/Dropdown/Dsubmenu.vue.d.ts +130 -4
- package/lib/Dropdown/Dsubmenu.vue.js +1 -1
- package/lib/Dropdown/Dsubmenu.vue2.js +1 -1
- package/lib/Dropdown/index.d.ts +65 -2
- package/lib/Dropdown/type.d.ts +15 -14
- package/lib/Empty/type.d.ts +2 -1
- package/lib/Grid/type.d.ts +6 -5
- package/lib/Icon/type.d.ts +2 -1
- package/lib/Image/type.d.ts +11 -10
- package/lib/Input/hooks/useCursor.d.ts +2 -1
- package/lib/Input/hooks/useCursor.js +1 -1
- package/lib/Input/type.d.ts +6 -5
- package/lib/InputNumber/type.d.ts +8 -8
- package/lib/InputTag/type.d.ts +5 -4
- package/lib/Layout/Layout.vue.js +1 -1
- package/lib/Layout/Layout.vue2.js +1 -1
- package/lib/Layout/type.d.ts +8 -7
- package/lib/Link/type.d.ts +3 -2
- package/lib/List/List.vue.js +1 -1
- package/lib/List/List.vue2.js +1 -1
- package/lib/List/type.d.ts +15 -14
- package/lib/Mention/index.d.ts +65 -2
- package/lib/Mention/index.vue.d.ts +130 -4
- package/lib/Mention/type.d.ts +3 -2
- package/lib/Menu/type.d.ts +11 -10
- package/lib/Message/type.d.ts +1 -1
- package/lib/Modal/Modal.vue.js +1 -1
- package/lib/Modal/Modal.vue2.js +1 -1
- package/lib/Modal/hooks/useModalClose.d.ts +2 -1
- package/lib/Modal/hooks/useModalClose.js +1 -1
- package/lib/Modal/type.d.ts +5 -5
- package/lib/Notification/type.d.ts +1 -1
- package/lib/OverflowList/index.vue.js +1 -1
- package/lib/OverflowList/index.vue2.js +1 -1
- package/lib/OverflowList/type.d.ts +3 -2
- package/lib/PageHeader/type.d.ts +7 -6
- package/lib/Pagination/type.d.ts +8 -8
- package/lib/Popconfirm/index.d.ts +65 -2
- package/lib/Popconfirm/index.vue.d.ts +130 -4
- package/lib/Popconfirm/type.d.ts +4 -4
- package/lib/Popover/type.d.ts +4 -4
- package/lib/Radio/hooks/useContext.d.ts +3 -6
- package/lib/Radio/type.d.ts +9 -8
- package/lib/Rate/type.d.ts +3 -2
- package/lib/ResizeBox/type.d.ts +6 -5
- package/lib/Result/type.d.ts +6 -5
- package/lib/Scrollbar/Scrollbar.vue.js +1 -1
- package/lib/Scrollbar/type.d.ts +2 -2
- package/lib/Select/Select.vue.d.ts +130 -4
- package/lib/Select/SelectView.vue.js +1 -1
- package/lib/Select/SelectView.vue2.js +1 -1
- package/lib/Select/index.d.ts +65 -2
- package/lib/Select/type.d.ts +19 -18
- package/lib/Skeleton/type.d.ts +3 -2
- package/lib/Space/index.vue.js +1 -1
- package/lib/Space/index.vue2.js +1 -1
- package/lib/Space/type.d.ts +3 -2
- package/lib/Spin/index.vue.js +1 -1
- package/lib/Spin/index.vue2.js +1 -1
- package/lib/Spin/type.d.ts +4 -3
- package/lib/Split/type.d.ts +5 -4
- package/lib/Statistic/type.d.ts +7 -7
- package/lib/Steps/type.d.ts +8 -7
- package/lib/Switch/index.vue.js +1 -1
- package/lib/Switch/index.vue2.js +1 -1
- package/lib/Switch/type.d.ts +5 -4
- package/lib/Tabs/Tabs.vue.js +1 -1
- package/lib/Tabs/Tabs.vue2.js +1 -1
- package/lib/Tabs/type.d.ts +5 -4
- package/lib/Tag/type.d.ts +4 -3
- package/lib/TimePicker/type.d.ts +4 -3
- package/lib/Timeline/type.d.ts +6 -5
- package/lib/Tooltip/type.d.ts +3 -3
- package/lib/Transfer/type.d.ts +13 -12
- package/lib/Trigger/hooks/useContext.js +1 -1
- package/lib/Trigger/hooks/useTriggerPosition.d.ts +2 -2
- package/lib/Trigger/hooks/useTriggerPosition.js +1 -1
- package/lib/Trigger/hooks/useTriggerVisible.js +1 -1
- package/lib/Trigger/index.d.ts +63 -2
- package/lib/Trigger/index.vue.d.ts +130 -3
- package/lib/Trigger/index.vue.js +1 -1
- package/lib/Trigger/index.vue2.js +1 -1
- package/lib/Trigger/type.d.ts +3 -3
- package/lib/Typography/type.d.ts +8 -7
- package/lib/Watermark/type.d.ts +2 -1
- package/lib/_shared/type/index.d.ts +1 -6
- package/lib/_shared/utils/dom.d.ts +5 -5
- package/lib/_shared/utils/dom.js +1 -1
- package/lib/_shared/utils/fn.d.ts +3 -3
- package/lib/_shared/utils/fn.js +1 -1
- package/lib/_shared/utils/global-config.d.ts +4 -2
- package/lib/_shared/utils/vue-utils.d.ts +1 -2
- package/lib/_shared/utils/vue-utils.js +1 -1
- package/lib/index.d.ts +66 -3
- package/lib/style.css +1 -1
- package/package.json +2 -2
package/lib/Tabs/type.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Direction, Size } from '../_shared/type';
|
2
|
+
import { VNode } from 'vue';
|
2
3
|
export interface TabsProps {
|
3
4
|
activeKey?: TabKey;
|
4
5
|
defaultActiveKey?: TabKey;
|
@@ -24,8 +25,8 @@ export interface TabsEmits {
|
|
24
25
|
(e: 'delete', value: TabKey): void;
|
25
26
|
}
|
26
27
|
export interface TabsSlots {
|
27
|
-
extra()
|
28
|
-
default()
|
28
|
+
extra?: () => VNode[];
|
29
|
+
default?: () => VNode[];
|
29
30
|
}
|
30
31
|
export interface TabPaneProps {
|
31
32
|
title?: string;
|
@@ -35,8 +36,8 @@ export interface TabPaneProps {
|
|
35
36
|
destoryOnHide?: boolean;
|
36
37
|
}
|
37
38
|
export interface TabPaneSlots {
|
38
|
-
default()
|
39
|
-
title()
|
39
|
+
default?: () => VNode[];
|
40
|
+
title?: () => VNode[];
|
40
41
|
}
|
41
42
|
export type TabKey = string | number;
|
42
43
|
export type TabType = 'line' | 'card' | 'card-gutter' | 'text' | 'rounded' | 'capsule';
|
package/lib/Tag/type.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { VNode } from 'vue';
|
1
2
|
export interface TagProps {
|
2
3
|
color?: string;
|
3
4
|
size?: TagSize;
|
@@ -18,8 +19,8 @@ export interface TagEmits {
|
|
18
19
|
(e: 'check', value: boolean, ev: MouseEvent): void;
|
19
20
|
}
|
20
21
|
export interface TagSlots {
|
21
|
-
default()
|
22
|
-
icon()
|
23
|
-
|
22
|
+
default?: () => VNode[];
|
23
|
+
icon?: () => VNode[];
|
24
|
+
'close-icon'?: () => VNode[];
|
24
25
|
}
|
25
26
|
export type TagSize = 'small' | 'medium' | 'large';
|
package/lib/TimePicker/type.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { PopupContainer, Size } from '../_shared/type';
|
2
2
|
import { TriggerProps } from '../Trigger';
|
3
|
+
import { VNode } from 'vue';
|
3
4
|
export interface TimePickerProps {
|
4
5
|
type?: TimePickerType;
|
5
6
|
modelValue?: TimePickerValue;
|
@@ -37,9 +38,9 @@ export interface TimePickerEmits {
|
|
37
38
|
(e: 'popup-visible-change', value: boolean): void;
|
38
39
|
}
|
39
40
|
export interface TimePickerSlots {
|
40
|
-
prefix()
|
41
|
-
|
42
|
-
extra()
|
41
|
+
prefix?: () => VNode[];
|
42
|
+
'suffix-icon'?: () => VNode[];
|
43
|
+
extra?: () => VNode[];
|
43
44
|
}
|
44
45
|
export type TimeUnit = 'hour' | 'minute' | 'second';
|
45
46
|
export type TimePickerValue = string | number | Date | (string | number | Date)[];
|
package/lib/Timeline/type.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Direction } from '../_shared/type';
|
2
|
+
import { VNode } from 'vue';
|
2
3
|
export interface TimelineProps {
|
3
4
|
reverse?: boolean;
|
4
5
|
direction?: Direction;
|
@@ -7,8 +8,8 @@ export interface TimelineProps {
|
|
7
8
|
labelPosition?: TimelineLabelPosition;
|
8
9
|
}
|
9
10
|
export interface TimelineSlots {
|
10
|
-
dot()
|
11
|
-
default()
|
11
|
+
dot?: () => VNode[];
|
12
|
+
default?: () => VNode[];
|
12
13
|
}
|
13
14
|
export interface TimelineItemProps {
|
14
15
|
dotColor?: string;
|
@@ -20,9 +21,9 @@ export interface TimelineItemProps {
|
|
20
21
|
isGhost?: boolean;
|
21
22
|
}
|
22
23
|
export interface TimelineItemSlots {
|
23
|
-
dot()
|
24
|
-
label()
|
25
|
-
default()
|
24
|
+
dot?: () => VNode[];
|
25
|
+
label?: () => VNode[];
|
26
|
+
default?: () => VNode[];
|
26
27
|
}
|
27
28
|
export type TimelineMode = 'left' | 'right' | 'top' | 'bottom' | 'alternate';
|
28
29
|
export type TimelineLabelPosition = 'relative' | 'same';
|
package/lib/Tooltip/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties } from 'vue';
|
1
|
+
import { CSSProperties, VNode } from 'vue';
|
2
2
|
import { ClassName, PopupContainer } from '../_shared/type';
|
3
3
|
import { TriggerPostion, TriggerProps } from '../Trigger/type';
|
4
4
|
export interface TooltipProps {
|
@@ -20,8 +20,8 @@ export interface TooltipEmits {
|
|
20
20
|
(e: 'popup-visible-change', value: boolean): void;
|
21
21
|
}
|
22
22
|
export interface TooltipSlots {
|
23
|
-
default()
|
24
|
-
content()
|
23
|
+
default?: () => VNode[];
|
24
|
+
content?: () => VNode[];
|
25
25
|
}
|
26
26
|
export interface TooltipExpose {
|
27
27
|
hide(): void;
|
package/lib/Transfer/type.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { InputProps } from '../Input';
|
2
|
+
import { VNode } from 'vue';
|
2
3
|
export interface TransferProps {
|
3
4
|
data?: TransferItem[];
|
4
5
|
modelValue?: string[];
|
@@ -22,24 +23,24 @@ export interface TransferEmits {
|
|
22
23
|
(e: 'search', value: string, type: 'target' | 'source'): void;
|
23
24
|
}
|
24
25
|
export interface TransferSlots {
|
25
|
-
source(scope: DefaultSlots)
|
26
|
-
target(scope: DefaultSlots)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
item(scope: {
|
26
|
+
source?: (scope: DefaultSlots) => VNode[];
|
27
|
+
target?: (scope: DefaultSlots) => VNode[];
|
28
|
+
'source-title'?: (scope: TitleSlots) => VNode[];
|
29
|
+
'target-title'?: (scope: TitleSlots) => VNode[];
|
30
|
+
'to-source-icon'?: () => VNode[];
|
31
|
+
'to-target-icon'?: () => VNode[];
|
32
|
+
item?: (scope: {
|
32
33
|
value: string;
|
33
34
|
label: string;
|
34
|
-
})
|
35
|
+
}) => VNode[];
|
35
36
|
}
|
36
37
|
export interface TransferPanelSlots {
|
37
|
-
default(scope: DefaultSlots)
|
38
|
-
|
39
|
-
item(scope: {
|
38
|
+
default: (scope: DefaultSlots) => VNode[];
|
39
|
+
title: (scope: TitleSlots) => VNode[];
|
40
|
+
item: (scope: {
|
40
41
|
value: string;
|
41
42
|
label: string;
|
42
|
-
})
|
43
|
+
}) => VNode[];
|
43
44
|
}
|
44
45
|
export interface TransferItem {
|
45
46
|
label?: string;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),t=require("../../node_modules/nanoid/index.browser.js");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../../_shared/utils/dom.js");const
|
1
|
+
"use strict";const e=require("vue"),t=require("../../node_modules/nanoid/index.browser.js"),r=require("../../node_modules/@vueuse/core/index.js");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../../_shared/utils/dom.js");const u=require("../../_shared/utils/fn.js");require("../../_shared/utils/time.js"),require("../../Empty/index.js");/* empty css */const o="trigger-context";module.exports=i=>{const{trigger:s,popupRef:a,computedVisible:n,mouseEnterDelay:d}=i,{depth:l,curDepth:p,groupIds:c,timeout:m,hoverTimeout:v}=e.inject(o,{depth:-1,curDepth:e.ref(0),groupIds:e.ref([]),timeout:e.ref(),hoverTimeout:e.ref()}),h=l+1,g=t.nanoid(32);c.value[h]=g,e.provide(o,{depth:h,curDepth:p,groupIds:c,hoverTimeout:v,timeout:m});const f=e=>{const t=e.getAttribute("data-group-id"),r=e.getAttribute("data-group-depth"),u=!!t&&c.value.includes(g);return u||"BODY"==e.tagName?{isGroup:u,groupId:t,depth:u?Number.parseInt(r):-1}:f(e.parentElement)};return e.watch(()=>p.value,e=>{h<=e||"hover"!=s||(n.value=!1)}),e.watch(()=>n.value,async e=>{if(!e)return;await u.sleep(0);const t=r.unrefElement(a);null==t||t.setAttribute("data-group-id",g),null==t||t.setAttribute("data-group-depth",`${h}`)},{immediate:!0}),{timeout:m,mouseEnterHandler:()=>{v.value&&clearTimeout(v.value),v.value=setTimeout(()=>{p.value=h},d.value)},clickOutsideHandler:e=>{if(c.value.length<=1)return!1;const{isGroup:t,depth:r}=f(e.target??e);return n.value=t?h<=r:n.value,t},mosueLeaveHandler:e=>{if(c.value.length<=1)return!1;const{isGroup:t}=f(e.relatedTarget);return t?n.value=!1:p.value=-1,!0}}};
|
@@ -19,8 +19,8 @@ declare const _default: (params: {
|
|
19
19
|
popupHeight: import('vue').ShallowRef<number, number>;
|
20
20
|
triggerWidth: import('vue').ShallowRef<number, number>;
|
21
21
|
triggerHeight: import('vue').ShallowRef<number, number>;
|
22
|
-
arrowWidth:
|
23
|
-
arrowHeight:
|
22
|
+
arrowWidth: import('vue').ShallowRef<number, number>;
|
23
|
+
arrowHeight: import('vue').ShallowRef<number, number>;
|
24
24
|
popupStyle: import('vue').ComputedRef<{
|
25
25
|
top: string;
|
26
26
|
left: string;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const t=require("vue"),e=require("../../node_modules/@vueuse/core/index.js");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../../_shared/utils/dom.js");const o=require("../../_shared/utils/fn.js");require("../../_shared/utils/time.js");const i=require("../../_shared/utils/
|
1
|
+
"use strict";const t=require("vue"),e=require("../../node_modules/@vueuse/core/index.js");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../../_shared/utils/dom.js");const o=require("../../_shared/utils/fn.js");require("../../_shared/utils/time.js");const i=require("../../_shared/utils/global-config.js");module.exports=l=>{const{props:u,computedVisible:r,popupRef:a,triggerRef:p,arrowRef:s,mouseX:n,mouseY:h}=l,{trigger:v,alignPoint:g,popupTranslate:d,popupOffset:f,autoFitPosition:c,autoFitPopupMinWidth:b,autoFitPopupWidth:m,autoSetPosition:W,showArrow:w,position:x,arrowStyle:H,contentStyle:T}=t.toRefs(u),{updateAtScroll:P,zIndex:S}=i.getGlobalConfig(u),y=t.ref(x.value),{width:q,height:j}=e.useElementSize(a,void 0,{box:"border-box"}),{width:z,height:_}=e.useElementSize(s,void 0,{box:"border-box"}),{left:E,top:R,bottom:I,right:L,width:M,height:F}=e.useElementBounding(p,{windowScroll:P.value,updateTiming:"next-frame"}),A=t.computed(()=>{const[t,e]=k(),i=g.value&&["click","contextMenu"].includes(v.value);if(W.value||i)return{top:o.valueToPx(h.value+e),left:o.valueToPx(n.value-(c.value?0:q.value/2)+t),zIndex:S.value};const[l,u]=G({position:y.value,triggerWidth:M.value,triggerHeight:F.value,popupHeight:j.value,popupWidth:q.value,top:R.value,left:E.value,right:L.value,bottom:I.value});if(!c.value)return{top:o.valueToPx(u+e),left:o.valueToPx(l+t),zIndex:S.value};const[r,a]=O({offsetLeft:l,offsetTop:u,position:y.value,top:R.value,left:E.value,right:L.value,bottom:I.value,popupHeight:j.value,popupWidth:q.value});y.value=X({offsetLeft:r,offsetTop:a,top:R.value,left:E.value,right:L.value,bottom:I.value,triggerWidth:M.value,triggerHeight:F.value,popupHeight:j.value,popupWidth:q.value});const[p,s]=k();return{left:o.valueToPx(r+p),top:o.valueToPx(a+s),zIndex:S.value}}),B=t.computed(()=>({width:m.value?o.valueToPx(M.value):"",minWidth:b.value?o.valueToPx(M.value):"",...T.value})),C=t.computed(()=>({...H.value,...V({position:y.value,popupWidth:q.value,popupHeight:j.value,arrowWidth:z.value,arrowHeight:_.value,triggerHeight:F.value,triggerWidth:M.value})})),k=()=>{const[t,e]=d.value;let o=t,i=e;return y.value.startsWith("t")?i=-f.value:y.value.startsWith("b")?i=f.value:y.value.startsWith("l")?o=-f.value:y.value.startsWith("r")&&(o=f.value),[o,i]},G=t=>{let e=0,o=0;const{position:i,triggerWidth:l,triggerHeight:u,popupWidth:r,popupHeight:a,left:p,top:s,right:n,bottom:h}=t;return["top","tl","tr","bottom","bl","br"].includes(i)?(e=i.startsWith("t")?s-a:h,o=["top","bottom"].includes(i)?p+(l-r)/2:["tl","bl"].includes(i)?p:n-r):(o=i.startsWith("l")?p-r:n,e=["left","right"].includes(i)?s+(u-a)/2:["lt","rt"].includes(i)?s:h-a),[o,e]},O=t=>{const{position:e,offsetLeft:o,offsetTop:i,bottom:l,left:u,right:r,top:a,popupHeight:p,popupWidth:s}=t;let n=o,h=i;return["top","tl","tr","bottom","bl","br"].includes(e)?(i<0&&["top","tl","tr"].includes(e)?h=l:i+p>window.innerHeight&&["bottom","bl","br"].includes(e)&&(h=a-p),o<0?n=u:o+s>window.innerWidth&&(n=r-s)):(o<0&&["left","lt","lb"].includes(e)?n=r:o+s>window.innerWidth&&["right","rt","rb"].includes(e)&&(n=u-s),i<0?h=a:h+p>window.innerHeight&&(h=a-p)),[n,h]},V=t=>{const{position:e,triggerWidth:i,triggerHeight:l,popupWidth:u,popupHeight:r,arrowHeight:a,arrowWidth:p}=t;let s;if(["top","tl","tr","bottom","bl","br"].includes(e)){let t="",l="";["top","bottom"].includes(e)?t=o.valueToPx((u-p)/2):["tl","bl"].includes(e)?t=o.valueToPx((i-p)/2):l=o.valueToPx((i-p)/2),s={top:e.startsWith("b")?"0":"",right:l,bottom:e.startsWith("t")?"0":"",left:t}}else{let t="",i="";["left","right"].includes(e)?t=o.valueToPx((r-a)/2):["lt","rt"].includes(e)?t=o.valueToPx((l-a)/2):i=o.valueToPx((l-a)/2),s={top:t,right:e.startsWith("l")?"0":"",bottom:i,left:e.startsWith("r")?"0":""}}return s},X=t=>{const{offsetLeft:e,offsetTop:o,top:i,left:l,bottom:u,right:r,triggerWidth:a,triggerHeight:p,popupHeight:s,popupWidth:n}=t,h=1e-5,v=[[i-s,l+(a-n)/2,"top"],[i-s,l,"tl"],[i-s,r-n,"tr"],[u,l+(a-n)/2,"bottom"],[u,l,"bl"],[u,r-n,"br"],[i+(p-s)/2,l-n,"left"],[i,l-n,"lt"],[u-s,l-n,"lb"],[i+(p-s)/2,r,"right"],[i,r,"rt"],[u-s,r,"rb"]].find(([t,i])=>Math.abs(i-e)<h&&Math.abs(t-o)<h);return(null==v?void 0:v[2])??y.value};return t.watch(()=>r.value,async t=>{if(!t)return;await o.sleep(0),y.value=x.value;const i=e.unrefElement(p),l=e.unrefElement(a);if(i){const{left:t,right:e,top:o,bottom:l,width:u,height:r}=i.getBoundingClientRect();E.value=t,L.value=e,R.value=o,I.value=l,M.value=u,F.value=r}if(l){const{offsetWidth:t,offsetHeight:e}=l;q.value=t,j.value=e}if(s.value){const{offsetWidth:t,offsetHeight:e}=s.value;z.value=t,_.value=e}}),{position:y,left:E,top:R,bottom:I,right:L,popupWidth:q,popupHeight:j,triggerWidth:M,triggerHeight:F,arrowWidth:z,arrowHeight:_,popupStyle:A,contentStyle:B,arrowStyle:C}};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue"),l=require("../../node_modules/@vueuse/core/index.js"),u=require("./useContext.js");require("../../node_modules/tinycolor2/esm/tinycolor.js");const a=require("../../_shared/utils/dom.js");require("../../_shared/utils/time.js");const o=require("../../_shared/utils/
|
1
|
+
"use strict";const e=require("vue"),l=require("../../node_modules/@vueuse/core/index.js"),u=require("./useContext.js");require("../../node_modules/tinycolor2/esm/tinycolor.js");const a=require("../../_shared/utils/dom.js");require("../../_shared/utils/time.js");const o=require("../../_shared/utils/global-config.js"),s=require("../../_shared/utils/control.js");module.exports=r=>{const{props:t,emits:i,popupRef:v,triggerRef:n}=r,{trigger:c,popupVisible:d,defaultPopupVisible:p,clickToClose:m,blurToClose:g,clickOutsideToClose:T,mouseEnterDelay:f,mouseLeaveDelay:h,focusDelay:b,disabled:k,scrollToCloseDistance:C,autoSetPosition:q,alignPoint:y}=e.toRefs(t),{scrollToClose:M}=o.getGlobalConfig(t),{onTriggerMouseclick:j,onTriggerMouseenter:x,onTriggerMouseleave:E,onTriggerBlur:_,onTriggerFocus:D,onClickOutSide:L}=t,V=s(d,p.value,e=>{i("update:popupVisible",e),i("popup-visible-change",e)}),{timeout:O,mosueLeaveHandler:P,mouseEnterHandler:R,clickOutsideHandler:w}=u({trigger:c.value,mouseEnterDelay:f,computedVisible:V,popupRef:v}),F=e.ref(0),H=e.ref(0);let S=0,B=0;const X=e.computed(()=>n.value?a.findFirstScrollableParent(l.unrefElement(n.value)):null);return e.watch(()=>V.value,async()=>{if(await e.nextTick(),!X.value)return;const{scrollTop:l,scrollLeft:u}=X.value;S=u,B=l}),T.value&&["click","contextMenu"].includes(c.value)&&l.onClickOutside(v,e=>{if(k.value)return;const l=w(e);V.value&&!l&&(V.value=!1,null==L||L())},{ignore:[n]}),(async()=>{await e.nextTick(),M.value&&X.value&&l.useEventListener(X,"scroll",()=>{if(!V.value)return;const{scrollTop:e,scrollLeft:l}=X.value;(Math.abs(e-B)>=C.value||Math.abs(l-S)>=C.value)&&(V.value=!1,B=e)})})(),{mouseX:F,mouseY:H,computedVisible:V,handleClickEvent:(e,l)=>{if(c.value==l&&!k.value){if(O.value&&clearTimeout(O.value),!q.value&&y.value){const{pageX:l,pageY:u}=e;F.value=l,H.value=u}V.value=!m.value||!V.value,null==j||j()}},handleMouseenter:()=>{"hover"!=c.value||k.value||(R(),O.value&&clearTimeout(O.value),V.value||(O.value=setTimeout(()=>{V.value=!0,null==x||x()},f.value)))},handleMouseleave:e=>{"hover"!=c.value||k.value||(O.value&&clearTimeout(O.value),V.value&&(O.value=setTimeout(()=>{null==E||E();P(e)||(V.value=!1)},h.value)))},handleFocus:()=>{"focus"!=c.value||k.value||(O.value&&clearTimeout(O.value),V.value||(O.value=setTimeout(()=>{V.value=!0,null==D||D()},b.value)))},handleBlur:()=>{"focus"==c.value&&g.value&&!k.value&&(O.value&&clearTimeout(O.value),V.value&&(V.value=!1,null==_||_()))}}};
|
package/lib/Trigger/index.d.ts
CHANGED
@@ -51,7 +51,68 @@ declare const Trigger: {
|
|
51
51
|
preventFocus: boolean;
|
52
52
|
scrollToClose: boolean;
|
53
53
|
needTransformOrigin: boolean;
|
54
|
-
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string,
|
54
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
55
|
+
triggerRef: unknown;
|
56
|
+
popupRef: ({
|
57
|
+
$: import('vue').ComponentInternalInstance;
|
58
|
+
$data: {};
|
59
|
+
$props: {
|
60
|
+
readonly preventFocus?: boolean | undefined;
|
61
|
+
readonly tag?: string | undefined;
|
62
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
63
|
+
$attrs: {
|
64
|
+
[x: string]: unknown;
|
65
|
+
};
|
66
|
+
$refs: {
|
67
|
+
[x: string]: unknown;
|
68
|
+
};
|
69
|
+
$slots: Readonly<{
|
70
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
71
|
+
}>;
|
72
|
+
$root: import('vue').ComponentPublicInstance | null;
|
73
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
74
|
+
$host: Element | null;
|
75
|
+
$emit: (event: string, ...args: any[]) => void;
|
76
|
+
$el: any;
|
77
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
78
|
+
preventFocus?: boolean;
|
79
|
+
tag?: string;
|
80
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
81
|
+
preventFocus: boolean;
|
82
|
+
tag: string;
|
83
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
84
|
+
beforeCreate?: (() => void) | (() => void)[];
|
85
|
+
created?: (() => void) | (() => void)[];
|
86
|
+
beforeMount?: (() => void) | (() => void)[];
|
87
|
+
mounted?: (() => void) | (() => void)[];
|
88
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
89
|
+
updated?: (() => void) | (() => void)[];
|
90
|
+
activated?: (() => void) | (() => void)[];
|
91
|
+
deactivated?: (() => void) | (() => void)[];
|
92
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
93
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
94
|
+
destroyed?: (() => void) | (() => void)[];
|
95
|
+
unmounted?: (() => void) | (() => void)[];
|
96
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
97
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
98
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
99
|
+
};
|
100
|
+
$forceUpdate: () => void;
|
101
|
+
$nextTick: typeof import('vue').nextTick;
|
102
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
103
|
+
} & Readonly<{
|
104
|
+
preventFocus: boolean;
|
105
|
+
tag: string;
|
106
|
+
}> & Omit<Readonly<{
|
107
|
+
preventFocus?: boolean;
|
108
|
+
tag?: string;
|
109
|
+
}> & Readonly<{}>, "preventFocus" | "tag"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
110
|
+
$slots: {
|
111
|
+
default?(_: {}): any;
|
112
|
+
};
|
113
|
+
}) | null;
|
114
|
+
arrowRef: HTMLDivElement;
|
115
|
+
}, any, import('vue').ComponentProvideOptions, {
|
55
116
|
P: {};
|
56
117
|
B: {};
|
57
118
|
D: {};
|
@@ -154,7 +215,7 @@ declare const Trigger: {
|
|
154
215
|
scrollToClose: boolean;
|
155
216
|
needTransformOrigin: boolean;
|
156
217
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
157
|
-
$slots:
|
218
|
+
$slots: Readonly<import('./type').TriggerSlots> & import('./type').TriggerSlots;
|
158
219
|
}) & {
|
159
220
|
install: (app: App) => void;
|
160
221
|
};
|
@@ -1,5 +1,71 @@
|
|
1
|
-
import { TriggerProps } from './type';
|
2
|
-
declare function __VLS_template():
|
1
|
+
import { TriggerProps, TriggerSlots } from './type';
|
2
|
+
declare function __VLS_template(): {
|
3
|
+
attrs: Partial<{}>;
|
4
|
+
slots: Readonly<TriggerSlots> & TriggerSlots;
|
5
|
+
refs: {
|
6
|
+
triggerRef: unknown;
|
7
|
+
popupRef: ({
|
8
|
+
$: import('vue').ComponentInternalInstance;
|
9
|
+
$data: {};
|
10
|
+
$props: {
|
11
|
+
readonly preventFocus?: boolean | undefined;
|
12
|
+
readonly tag?: string | undefined;
|
13
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
14
|
+
$attrs: {
|
15
|
+
[x: string]: unknown;
|
16
|
+
};
|
17
|
+
$refs: {
|
18
|
+
[x: string]: unknown;
|
19
|
+
};
|
20
|
+
$slots: Readonly<{
|
21
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
22
|
+
}>;
|
23
|
+
$root: import('vue').ComponentPublicInstance | null;
|
24
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
25
|
+
$host: Element | null;
|
26
|
+
$emit: (event: string, ...args: any[]) => void;
|
27
|
+
$el: any;
|
28
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
29
|
+
preventFocus?: boolean;
|
30
|
+
tag?: string;
|
31
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
32
|
+
preventFocus: boolean;
|
33
|
+
tag: string;
|
34
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
35
|
+
beforeCreate?: (() => void) | (() => void)[];
|
36
|
+
created?: (() => void) | (() => void)[];
|
37
|
+
beforeMount?: (() => void) | (() => void)[];
|
38
|
+
mounted?: (() => void) | (() => void)[];
|
39
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
40
|
+
updated?: (() => void) | (() => void)[];
|
41
|
+
activated?: (() => void) | (() => void)[];
|
42
|
+
deactivated?: (() => void) | (() => void)[];
|
43
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
44
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
45
|
+
destroyed?: (() => void) | (() => void)[];
|
46
|
+
unmounted?: (() => void) | (() => void)[];
|
47
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
48
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
49
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
50
|
+
};
|
51
|
+
$forceUpdate: () => void;
|
52
|
+
$nextTick: typeof import('vue').nextTick;
|
53
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
54
|
+
} & Readonly<{
|
55
|
+
preventFocus: boolean;
|
56
|
+
tag: string;
|
57
|
+
}> & Omit<Readonly<{
|
58
|
+
preventFocus?: boolean;
|
59
|
+
tag?: string;
|
60
|
+
}> & Readonly<{}>, "preventFocus" | "tag"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
61
|
+
$slots: {
|
62
|
+
default?(_: {}): any;
|
63
|
+
};
|
64
|
+
}) | null;
|
65
|
+
arrowRef: HTMLDivElement;
|
66
|
+
};
|
67
|
+
rootEl: any;
|
68
|
+
};
|
3
69
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
4
70
|
declare const __VLS_component: import('vue').DefineComponent<TriggerProps, {
|
5
71
|
hide(): void;
|
@@ -49,7 +115,68 @@ declare const __VLS_component: import('vue').DefineComponent<TriggerProps, {
|
|
49
115
|
preventFocus: boolean;
|
50
116
|
scrollToClose: boolean;
|
51
117
|
needTransformOrigin: boolean;
|
52
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false,
|
118
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
119
|
+
triggerRef: unknown;
|
120
|
+
popupRef: ({
|
121
|
+
$: import('vue').ComponentInternalInstance;
|
122
|
+
$data: {};
|
123
|
+
$props: {
|
124
|
+
readonly preventFocus?: boolean | undefined;
|
125
|
+
readonly tag?: string | undefined;
|
126
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
127
|
+
$attrs: {
|
128
|
+
[x: string]: unknown;
|
129
|
+
};
|
130
|
+
$refs: {
|
131
|
+
[x: string]: unknown;
|
132
|
+
};
|
133
|
+
$slots: Readonly<{
|
134
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
135
|
+
}>;
|
136
|
+
$root: import('vue').ComponentPublicInstance | null;
|
137
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
138
|
+
$host: Element | null;
|
139
|
+
$emit: (event: string, ...args: any[]) => void;
|
140
|
+
$el: any;
|
141
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
142
|
+
preventFocus?: boolean;
|
143
|
+
tag?: string;
|
144
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
145
|
+
preventFocus: boolean;
|
146
|
+
tag: string;
|
147
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
148
|
+
beforeCreate?: (() => void) | (() => void)[];
|
149
|
+
created?: (() => void) | (() => void)[];
|
150
|
+
beforeMount?: (() => void) | (() => void)[];
|
151
|
+
mounted?: (() => void) | (() => void)[];
|
152
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
153
|
+
updated?: (() => void) | (() => void)[];
|
154
|
+
activated?: (() => void) | (() => void)[];
|
155
|
+
deactivated?: (() => void) | (() => void)[];
|
156
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
157
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
158
|
+
destroyed?: (() => void) | (() => void)[];
|
159
|
+
unmounted?: (() => void) | (() => void)[];
|
160
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
161
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
162
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
163
|
+
};
|
164
|
+
$forceUpdate: () => void;
|
165
|
+
$nextTick: typeof import('vue').nextTick;
|
166
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
167
|
+
} & Readonly<{
|
168
|
+
preventFocus: boolean;
|
169
|
+
tag: string;
|
170
|
+
}> & Omit<Readonly<{
|
171
|
+
preventFocus?: boolean;
|
172
|
+
tag?: string;
|
173
|
+
}> & Readonly<{}>, "preventFocus" | "tag"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
174
|
+
$slots: {
|
175
|
+
default?(_: {}): any;
|
176
|
+
};
|
177
|
+
}) | null;
|
178
|
+
arrowRef: HTMLDivElement;
|
179
|
+
}, any>;
|
53
180
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
54
181
|
export default _default;
|
55
182
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/lib/Trigger/index.vue.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=;/* empty css */;/* empty css */const r=require("../_virtual/_plugin-vue_export-helper.js")(e,[["__scopeId","data-v-
|
1
|
+
"use strict";const e=;/* empty css */;/* empty css */const r=require("../_virtual/_plugin-vue_export-helper.js")(e,[["__scopeId","data-v-37d87bda"]]);module.exports=r;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/vue-utils.js"),t=require("../_shared/utils/global-config.js"),n=require("./hooks/useTriggerVisible.js"),r=require("./hooks/useTriggerPosition.js");,/* empty css */;/* empty css */const l=require("../_shared/components/PreventFocus.vue.js");;/* empty css */const a=e.defineComponent({name:"Trigger",inheritAttrs:!1,__name:"index",props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},trigger:{default:"hover"},position:{default:"bottom"},disabled:{type:Boolean,default:!1},popupOffset:{default:0},popupTranslate:{default:()=>[0,0]},showArrow:{type:Boolean,default:!1},popuphoverStay:{type:Boolean},blurToClose:{type:Boolean,default:!0},clickToClose:{type:Boolean,default:!0},clickOutsideToClose:{type:Boolean,default:!0},unmountOnClose:{type:Boolean,default:!0},contentClass:{default:""},contentStyle:{default:()=>({})},arrowClass:{default:""},arrowStyle:{default:()=>({})},animationName:{default:"fade"},duration:{default:400},mouseEnterDelay:{default:100},mouseLeaveDelay:{default:100},focusDelay:{default:0},autoFitPopupWidth:{type:Boolean,default:!1},autoFitPopupMinWidth:{type:Boolean,default:!1},popupContainer:{default:void 0},renderToBody:{type:Boolean,default:!0},autoFitPosition:{type:Boolean,default:!0},updateAtScroll:{type:Boolean,default:void 0},preventFocus:{type:Boolean,default:!1},alignPoint:{type:Boolean,default:!1},scrollToClose:{type:Boolean,default:void 0},scrollToCloseDistance:{default:1},needTransformOrigin:{type:Boolean,default:!1},autoSetPosition:{type:Boolean,default:!1},onTriggerMouseenter:{},onTriggerMouseleave:{},onTriggerMouseclick:{},onTriggerFocus:{},onTriggerBlur:{},onClickOutSide:{}},emits:["update:popupVisible","popup-visible-change","show","hide"],setup(a,{expose:u,emit:s}){const i=
|
1
|
+
"use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js"),require("../_shared/utils/time.js");const o=require("../_shared/utils/vue-utils.js"),t=require("../_shared/utils/global-config.js"),n=require("./hooks/useTriggerVisible.js"),r=require("./hooks/useTriggerPosition.js");,/* empty css */;/* empty css */const l=require("../_shared/components/PreventFocus.vue.js");;/* empty css */const a=e.defineComponent({name:"Trigger",inheritAttrs:!1,__name:"index",props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},trigger:{default:"hover"},position:{default:"bottom"},disabled:{type:Boolean,default:!1},popupOffset:{default:0},popupTranslate:{default:()=>[0,0]},showArrow:{type:Boolean,default:!1},popuphoverStay:{type:Boolean},blurToClose:{type:Boolean,default:!0},clickToClose:{type:Boolean,default:!0},clickOutsideToClose:{type:Boolean,default:!0},unmountOnClose:{type:Boolean,default:!0},contentClass:{default:""},contentStyle:{default:()=>({})},arrowClass:{default:""},arrowStyle:{default:()=>({})},animationName:{default:"fade"},duration:{default:400},mouseEnterDelay:{default:100},mouseLeaveDelay:{default:100},focusDelay:{default:0},autoFitPopupWidth:{type:Boolean,default:!1},autoFitPopupMinWidth:{type:Boolean,default:!1},popupContainer:{default:void 0},renderToBody:{type:Boolean,default:!0},autoFitPosition:{type:Boolean,default:!0},updateAtScroll:{type:Boolean,default:void 0},preventFocus:{type:Boolean,default:!1},alignPoint:{type:Boolean,default:!1},scrollToClose:{type:Boolean,default:void 0},scrollToCloseDistance:{default:1},needTransformOrigin:{type:Boolean,default:!1},autoSetPosition:{type:Boolean,default:!1},onTriggerMouseenter:{},onTriggerMouseleave:{},onTriggerMouseclick:{},onTriggerFocus:{},onTriggerBlur:{},onClickOutSide:{}},emits:["update:popupVisible","popup-visible-change","show","hide"],setup(a,{expose:u,emit:s}){const i=e.useSlots(),d=a,p=s,{popupContainer:f}=t.getGlobalConfig(d),c=e.ref(),m=e.ref(),y=e.ref(),g=e.computed(()=>{var e;return o.findFirstLegitChild((null==(e=i.default)?void 0:e.call(i))||[])}),{computedVisible:v,mouseX:B,mouseY:h,handleClickEvent:C,handleMouseenter:k,handleMouseleave:T,handleFocus:w,handleBlur:_}=n({props:d,emits:p,popupRef:c,triggerRef:m}),{position:b,popupStyle:M,contentStyle:S,arrowStyle:q}=r({props:d,computedVisible:v,popupRef:c,triggerRef:m,arrowRef:y,mouseX:B,mouseY:h});return u({hide(){v.value=!1},show(){v.value=!0},updatePosition(e,o){B.value=e,h.value=o}}),(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value),{ref_key:"triggerRef",ref:m,onClick:t[0]||(t[0]=o=>e.unref(C)(o,"click")),onContextmenu:t[1]||(t[1]=e.withModifiers(o=>e.unref(C)(o,"contextMenu"),["prevent"])),onMouseenter:e.unref(k),onMouseleave:e.unref(T),onFocus:e.unref(w),onBlur:e.unref(_)},null,40,["onMouseenter","onMouseleave","onFocus","onBlur"])),(e.openBlock(),e.createBlock(e.Teleport,{to:e.unref(f),disabled:!o.renderToBody},[e.createVNode(e.Transition,{name:o.animationName,duration:o.duration,onAfterLeave:t[2]||(t[2]=e=>o.$emit("hide")),onAfterEnter:t[3]||(t[3]=e=>o.$emit("show"))},{default:e.withCtx(()=>[!o.unmountOnClose||e.unref(v)&&!o.disabled?e.withDirectives((e.openBlock(),e.createBlock(e.unref(l),{key:0,"prevent-focus":o.preventFocus,class:e.normalizeClass(["yc-trigger",`yc-trigger-position-${e.unref(b)}`,{"yc-trigger-transform-origin":o.needTransformOrigin},o.$attrs.class]),style:e.normalizeStyle({...e.unref(M),...o.$attrs.style||{}}),ref_key:"popupRef",ref:c,onMouseenter:e.unref(k),onMouseleave:e.unref(T)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["yc-trigger-content",o.contentClass]),style:e.normalizeStyle(e.unref(S))},[e.renderSlot(o.$slots,"content",{},void 0,!0)],6),o.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yc-trigger-arrow",o.arrowClass]),style:e.normalizeStyle(e.unref(q)),ref_key:"arrowRef",ref:y},null,6)):e.createCommentVNode("",!0)]),_:3},8,["prevent-focus","class","style","onMouseenter","onMouseleave"])),[[e.vShow,e.unref(v)&&!o.disabled]]):e.createCommentVNode("",!0)]),_:3},8,["name","duration"])],8,["to","disabled"]))],64))}});module.exports=a;
|
package/lib/Trigger/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties } from 'vue';
|
1
|
+
import { CSSProperties, VNode } from 'vue';
|
2
2
|
import { ClassName, PopupContainer } from '../_shared/type';
|
3
3
|
export interface TriggerProps {
|
4
4
|
popupVisible?: boolean;
|
@@ -49,8 +49,8 @@ export interface TriggerEmits {
|
|
49
49
|
(e: 'hide'): void;
|
50
50
|
}
|
51
51
|
export interface TriggerSlots {
|
52
|
-
default()
|
53
|
-
content()
|
52
|
+
default?: () => VNode[];
|
53
|
+
content?: () => VNode[];
|
54
54
|
}
|
55
55
|
export interface TriggerExpose {
|
56
56
|
hide(): void;
|
package/lib/Typography/type.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { TooltipProps } from '../Tooltip';
|
2
|
+
import { VNode } from 'vue';
|
2
3
|
export interface TypographyBaseProps {
|
3
4
|
tag?: string;
|
4
5
|
type?: TypographyType;
|
@@ -30,16 +31,16 @@ export interface TypographyBaseEmits {
|
|
30
31
|
(e: 'expand', expanded: boolean): void;
|
31
32
|
}
|
32
33
|
export interface TypographyBaseSlots {
|
33
|
-
default()
|
34
|
-
|
34
|
+
default?: () => VNode[];
|
35
|
+
'expand-node': (scope: {
|
35
36
|
expanded: boolean;
|
36
|
-
})
|
37
|
-
|
37
|
+
}) => VNode[];
|
38
|
+
'copy-icon': (scope: {
|
38
39
|
copied: boolean;
|
39
|
-
})
|
40
|
-
|
40
|
+
}) => VNode[];
|
41
|
+
'copy-tooltip': (scope: {
|
41
42
|
copied: boolean;
|
42
|
-
})
|
43
|
+
}) => VNode[];
|
43
44
|
}
|
44
45
|
export interface TypographyParagraphProps {
|
45
46
|
blockquote?: boolean;
|
package/lib/Watermark/type.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { VNode } from 'vue';
|
1
2
|
export interface WatermarkProps {
|
2
3
|
content?: string | string[];
|
3
4
|
image?: string;
|
@@ -23,5 +24,5 @@ export interface WatermarkFont {
|
|
23
24
|
fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
24
25
|
}
|
25
26
|
export interface WatermarkSlots {
|
26
|
-
default()
|
27
|
+
default?: () => VNode[];
|
27
28
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { RenderFunction
|
1
|
+
import { RenderFunction } from 'vue';
|
2
2
|
export type Size = 'mini' | 'small' | 'medium' | 'large';
|
3
3
|
export type Direction = 'vertical' | 'horizontal';
|
4
4
|
export type Theme = 'light' | 'dark';
|
@@ -11,8 +11,3 @@ export type ObjectData = Record<string, any>;
|
|
11
11
|
export type RequiredDeep<T> = {
|
12
12
|
[P in keyof T]-?: T[P] extends object ? RequiredDeep<T[P]> : T[P];
|
13
13
|
};
|
14
|
-
export type VueInstance = ComponentPublicInstance;
|
15
|
-
export type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
|
16
|
-
export type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<T>;
|
17
|
-
export type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
|
18
|
-
export type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends VueInstance ? Exclude<MaybeElement, VueInstance> : T | undefined;
|
@@ -1,13 +1,13 @@
|
|
1
|
+
import { Ref } from 'vue';
|
1
2
|
import { EllipsisConfig } from '../../Typography/type';
|
2
3
|
import { BreakpointName, ResponsiveValue } from '../../Grid';
|
3
|
-
import { Ref } from 'vue';
|
4
4
|
export declare const isServerRendering: boolean;
|
5
5
|
export declare const querySelector: (selectors: string, container?: Document | HTMLElement) => HTMLElement | undefined;
|
6
6
|
export declare const getElement: (target: string | HTMLElement | undefined, container?: Document | HTMLElement) => HTMLElement | undefined;
|
7
|
-
export declare
|
8
|
-
export declare
|
7
|
+
export declare const getDomText: (dom: Ref<HTMLElement | undefined>) => string;
|
8
|
+
export declare const getBreakpointValue: (breakpoint: BreakpointName, value: string | number | ResponsiveValue, defaultValue?: number | string) => number | string | undefined;
|
9
9
|
export declare const mediaQueryHandler: (onBreakpoint: (breakpoint: BreakpointName, order: Record<string, number>, index: number) => void, queries?: Record<string, string>) => void;
|
10
|
-
export declare
|
10
|
+
export declare const findFirstScrollableParent: (element?: HTMLElement) => HTMLElement | undefined;
|
11
11
|
/**
|
12
12
|
* 计算文本是否需要省略并返回处理后的文本
|
13
13
|
* @param originElement 原始DOM元素,用于获取样式
|
@@ -16,7 +16,7 @@ export declare function findFirstScrollableParent(element?: HTMLElement): HTMLEl
|
|
16
16
|
* @param fullText 完整文本
|
17
17
|
* @returns 返回处理后的文本和是否省略的标志
|
18
18
|
*/
|
19
|
-
export declare
|
19
|
+
export declare const calculateEllipsis: (originElement: HTMLElement, ellipsisConfig: EllipsisConfig | undefined, operations: (HTMLElement | HTMLElement[] | null) | undefined, fullText: string) => {
|
20
20
|
tooltip?: {
|
21
21
|
type?: "tooltip" | "popover" | undefined;
|
22
22
|
props?: Record<string, any> | undefined;
|
package/lib/_shared/utils/dom.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../node_modules/@vueuse/core/index.js"),r=require("./is.js"),n=(()=>{try{return!("undefined"!=typeof window&&void 0!==document)}catch(e){return!0}})(),i=(e,t)=>{if(!n)return(t??document).querySelector(e)??void 0};exports.findFirstScrollableParent=e=>{if(!e||e===document.body)return;let t=e.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t),r=e.overflowY||e.overflow,n=["auto","scroll"].includes(r),i=t.scrollHeight>t.clientHeight;if(n&&i)return t;t=t.parentElement}},exports.getBreakpointValue=(e,t,n)=>{if(!r.isObject(t))return t;const i=["xs","sm","md","lg","xl","xxl"],o=i.indexOf(e);for(let s=o;s>=0;s--){const e=i[s];if(!r.isUndefined(t[e]))return t[e]}for(let s=o+1;s<i.length;s++){const e=i[s];if(!r.isUndefined(t[e]))return t[e]}return n},exports.getDomText=e=>{var r;return(null==(r=t.unrefElement(e))?void 0:r.innerText)||""},exports.getElement=(e,t)=>{if(r.isString(e)){const r="#"===e[0]?`[id='${e.slice(1)}']`:e;return i(r,t)}return e},exports.isServerRendering=n,exports.mediaQueryHandler=(r,n={xs:"(min-width: 0)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"})=>{const i=[],o={},s=[];Object.keys(n).forEach((e,r)=>{i.push(e),o[e]=r,s.push(t.useMediaQuery(n[e]))}),e.watch(s,e=>{const t=e.lastIndexOf(!0);r(i[t],o,t)},{immediate:!0})},exports.querySelector=i;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
2
|
-
export declare
|
2
|
+
export declare const throttleByRaf: (cb: (...args: any[]) => void) => {
|
3
3
|
(...args: any[]): void;
|
4
4
|
cancel(): void;
|
5
5
|
};
|
6
|
-
export declare
|
7
|
-
export declare
|
6
|
+
export declare const debounce: (func: (...args: any) => void, delay: number, immediate?: boolean) => (this: any, ...args: any) => void;
|
7
|
+
export declare const throttle: (fn: (...args: any) => void, delay: number) => (this: any, ...args: any) => void;
|
8
8
|
export declare const valueToPx: (value: string | number | undefined) => string;
|