x-next 0.0.0-alpha.5 → 0.0.0-alpha.51
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/README.md +26 -1
- package/dist/_container/client-only.d.ts +4 -0
- package/dist/_container/parent-scroll-observer.d.ts +6 -0
- package/dist/_container/render-function.d.ts +14 -0
- package/dist/_container/resize-observer-2.d.ts +12 -0
- package/dist/_container/resize-observer.d.ts +6 -0
- package/dist/_container/utils.d.ts +12 -0
- package/dist/_hooks/_types.d.ts +4 -0
- package/dist/_hooks/use-children-components.d.ts +5 -0
- package/dist/_hooks/use-first-element.d.ts +5 -0
- package/dist/_hooks/use-index.d.ts +9 -0
- package/dist/_hooks/use-merge-state.d.ts +4 -0
- package/dist/_hooks/use-pick-slots.d.ts +2 -0
- package/dist/_hooks/use-popup-container.d.ts +6 -0
- package/dist/_hooks/use-popup-overflow-hidden.d.ts +6 -0
- package/dist/_hooks/use-resize-observer.d.ts +8 -0
- package/dist/_hooks/use-size.d.ts +7 -0
- package/dist/_hooks/use-state.d.ts +2 -0
- package/dist/_hooks/use-teleport-container.d.ts +10 -0
- package/dist/_props/constant.d.ts +4 -0
- package/dist/_props/types.d.ts +1 -0
- package/dist/_utils/click.d.ts +13 -0
- package/dist/_utils/config.d.ts +1 -1
- package/dist/_utils/constant.d.ts +17 -0
- package/dist/_utils/dom.d.ts +6 -0
- package/dist/_utils/is.d.ts +3 -0
- package/dist/_utils/omit.d.ts +2 -0
- package/dist/_utils/raf.d.ts +3 -0
- package/dist/_utils/throttle-by-raf.d.ts +4 -0
- package/dist/_utils/types.d.ts +1 -0
- package/dist/_utils/vue-eco.d.ts +14 -1
- package/dist/components/_components/icon-hover.vue.d.ts +38 -0
- package/dist/components/button/Button.d.ts +97 -0
- package/dist/components/button/index.d.ts +181 -0
- package/dist/{componets → components}/button/props.d.ts +4 -4
- package/dist/{componets/dialog/index.vue.d.ts → components/dialog/Dialog.d.ts} +13 -46
- package/dist/components/dialog/index.d.ts +334 -0
- package/dist/{componets → components}/dialog/props.d.ts +5 -5
- package/dist/components/drawer/index.d.ts +1474 -0
- package/dist/components/drawer/src/Drawer.vue.d.ts +744 -0
- package/dist/components/drawer/src/props.d.ts +75 -0
- package/dist/components/drawer/src/types.d.ts +1 -0
- package/dist/components/form/constants.d.ts +4 -0
- package/dist/components/form/form-item.d.ts +31 -0
- package/dist/components/form/form.d.ts +39 -0
- package/dist/components/form/hooks.d.ts +4 -0
- package/dist/components/form/types.d.ts +31 -0
- package/dist/components/image/ImagePreviewAction.d.ts +1354 -0
- package/dist/components/image/context.d.ts +6 -0
- package/dist/components/image/hooks/use-image-drag.d.ts +11 -0
- package/dist/components/image/hooks/use-image-load-status.d.ts +10 -0
- package/dist/components/image/image-footer.vue.d.ts +23 -0
- package/dist/components/image/interface.d.ts +45 -0
- package/dist/components/image/preview-arrow.vue.d.ts +122 -0
- package/dist/components/image/preview-toolbar.vue.d.ts +1388 -0
- package/dist/components/image/utils/get-fix-translate.d.ts +1 -0
- package/dist/components/image/utils/get-scale.d.ts +6 -0
- package/dist/components/image/utils/index.d.ts +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/input/Input.d.ts +220 -0
- package/dist/components/input/index.d.ts +394 -0
- package/dist/components/input/props.d.ts +95 -0
- package/dist/components/input/utils.d.ts +6 -0
- package/dist/components/message/Message.d.ts +108 -0
- package/dist/{componets/message/index.vue.d.ts → components/message/MessageVue.vue.d.ts} +23 -48
- package/dist/components/message/index.d.ts +193 -0
- package/dist/components/message-box/index.d.ts +4 -0
- package/dist/components/message-box/warp.d.ts +2 -0
- package/dist/components/notification/Notification.d.ts +89 -0
- package/dist/components/notification/index.d.ts +166 -0
- package/dist/components/popconfirm/index.d.ts +193 -0
- package/dist/components/popconfirm/src/Popconfirm.d.ts +104 -0
- package/dist/components/popconfirm/src/popup.vue.d.ts +407 -0
- package/dist/components/popconfirm/src/props.d.ts +45 -0
- package/dist/components/popconfirm/src/types.d.ts +3 -0
- package/dist/components/popup/Popup.d.ts +188 -0
- package/dist/components/popup/index.d.ts +334 -0
- package/dist/components/popup/props.d.ts +83 -0
- package/dist/components/popup/use-props.d.ts +33 -0
- package/dist/components/popup/use.d.ts +3 -0
- package/dist/components/popup/warp.d.ts +2 -0
- package/dist/components/scrollbar/index.d.ts +291 -0
- package/dist/components/scrollbar/src/Scrollbar.vue.d.ts +134 -0
- package/dist/components/scrollbar/src/constant.d.ts +1 -0
- package/dist/components/scrollbar/src/scrollbar.d.ts +24 -0
- package/dist/components/scrollbar/src/thumb.d.ts +20 -0
- package/dist/components/scrollbar/src/thumb.vue.d.ts +47 -0
- package/dist/components/scrollbar/src/types.d.ts +18 -0
- package/dist/{componets/space/index.d.ts → components/space/Space.d.ts} +1 -1
- package/dist/components/space/index.d.ts +82 -0
- package/dist/components/tabs/TabPane.vue.d.ts +78 -0
- package/dist/components/tabs/Tabs.d.ts +349 -0
- package/dist/components/tabs/context.d.ts +11 -0
- package/dist/components/tabs/index.d.ts +400 -0
- package/dist/components/tabs/interface.d.ts +12 -0
- package/dist/components/tabs/tabs-button.d.ts +43 -0
- package/dist/components/tabs/tabs-nav-ink.vue.d.ts +36 -0
- package/dist/components/tabs/tabs-nav.d.ts +110 -0
- package/dist/components/tabs/tabs-tab.vue.d.ts +129 -0
- package/dist/components/tabs/utils.d.ts +13 -0
- package/dist/components/tag/Tag.vue.d.ts +375 -0
- package/dist/components/tag/index.d.ts +519 -0
- package/dist/components/tag/interface.d.ts +49 -0
- package/dist/components/timeline/index.d.ts +58 -0
- package/dist/components/timeline/src/Timeline.d.ts +24 -0
- package/dist/components/timeline/src/TimelineItem.d.ts +12 -0
- package/dist/components/timeline/src/context.d.ts +12 -0
- package/dist/components/timeline/src/props.d.ts +31 -0
- package/dist/components/timeline/src/types.d.ts +9 -0
- package/dist/components/timeline-item/index.d.ts +34 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +760 -0
- package/dist/components/tooltip/index.d.ts +1317 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +277 -0
- package/dist/components/trend-chart/components/trend-chart-curve.d.ts +111 -0
- package/dist/components/trend-chart/components/trend-chart-grid.d.ts +55 -0
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +22 -0
- package/dist/components/trend-chart/helpers/genPath.d.ts +8 -0
- package/dist/components/trend-chart/helpers/genPoints.d.ts +3 -0
- package/dist/components/trend-chart/helpers/getPadding.d.ts +7 -0
- package/dist/components/trend-chart/helpers/validatePadding.d.ts +2 -0
- package/dist/components/trend-chart/index.d.ts +535 -0
- package/dist/components/trend-chart/props.d.ts +203 -0
- package/dist/components/trend-chart/themes.d.ts +128 -0
- package/dist/{componets/trend-chart → components/trend-chart.bak}/components/trend-chart-curve.d.ts +2 -5
- package/dist/{componets/trend-chart → components/trend-chart.bak}/components/trend-chart.d.ts +19 -15
- package/dist/components/trend-chart.bak/index.d.ts +530 -0
- package/dist/{componets/trend-chart → components/trend-chart.bak}/props.d.ts +10 -5
- package/dist/components/trend-chart.bak/themes.d.ts +152 -0
- package/dist/components/trigger/index.d.ts +487 -0
- package/dist/components/trigger/src/_trigger.d.ts +217 -0
- package/dist/components/trigger/src/constant.d.ts +8 -0
- package/dist/components/trigger/src/trigger.d.ts +288 -0
- package/dist/components/trigger/src/utils.d.ts +50 -0
- package/dist/components/trigger-v2/context.d.ts +8 -0
- package/dist/components/trigger-v2/index.d.ts +562 -0
- package/dist/components/trigger-v2/interface.d.ts +40 -0
- package/dist/components/trigger-v2/trigger.d.ts +627 -0
- package/dist/components/trigger-v2/utils.d.ts +51 -0
- package/dist/directives/clipboard/cache.d.ts +8 -0
- package/dist/directives/clipboard/clipboard.d.ts +18 -0
- package/dist/directives/clipboard/convert.d.ts +3 -0
- package/dist/directives/clipboard/index.d.ts +3 -0
- package/dist/directives/clipboard/plugin.d.ts +2 -0
- package/dist/directives/clipboard/textarea.d.ts +3 -0
- package/dist/icons/{default/exclamation-circle-fill.vue.d.ts → _self/down.d.ts} +4 -9
- package/dist/icons/{default/close-circle-fill.vue.d.ts → _self/full-screen.d.ts} +4 -9
- package/dist/icons/{animation/animation-loading.vue.d.ts → _self/left.d.ts} +4 -9
- package/dist/icons/{default/check-circle-fill.vue.d.ts → _self/next.d.ts} +4 -9
- package/dist/icons/_self/original-size.d.ts +50 -0
- package/dist/icons/_self/plus.d.ts +50 -0
- package/dist/icons/_self/prev.d.ts +50 -0
- package/dist/icons/_self/right.d.ts +50 -0
- package/dist/icons/_self/rotate-left.d.ts +50 -0
- package/dist/icons/_self/rotate-right.d.ts +50 -0
- package/dist/icons/_self/up.d.ts +50 -0
- package/dist/icons/_self/zoom-in.d.ts +50 -0
- package/dist/icons/_self/zoom-out.d.ts +50 -0
- package/dist/icons/animation/animation-loading.d.ts +50 -0
- package/dist/icons/default/check-circle-fill.d.ts +50 -0
- package/dist/icons/default/close-circle-fill.d.ts +50 -0
- package/dist/icons/default/close.d.ts +50 -0
- package/dist/icons/default/exclamation-circle-fill.d.ts +50 -0
- package/dist/icons/default/info-circle-fill.d.ts +50 -0
- package/dist/icons/default/left.d.ts +50 -0
- package/dist/icons/default/logo-simple.d.ts +50 -0
- package/dist/icons/default/minus-circle-fill.d.ts +50 -0
- package/dist/icons/default/right.d.ts +50 -0
- package/dist/icons/icon.d.ts +51 -0
- package/dist/icons/index.d.ts +11 -7
- package/dist/index.d.ts +13 -0
- package/dist/index.es.js +7265 -1062
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +26 -0
- package/package.json +25 -11
- package/volar.d.ts +27 -0
- package/dist/_utils/icon.d.ts +0 -59
- package/dist/componets/button/index.vue.d.ts +0 -162
- package/dist/componets/message-box/warp.d.ts +0 -2
- package/dist/componets/notification/index.vue.d.ts +0 -160
- package/dist/componets/trend-chart/index.d.ts +0 -2
- package/dist/icons/default/info-circle-fill.vue.d.ts +0 -55
- package/dist/icons/default/minus-circle-fill.vue.d.ts +0 -55
- package/dist/ui.d.ts +0 -5
- /package/dist/{componets → components}/dialog/use-props.d.ts +0 -0
- /package/dist/{componets → components}/dialog/use.d.ts +0 -0
- /package/dist/{componets → components}/dialog/warp.d.ts +0 -0
- /package/dist/{componets → components}/message/props.d.ts +0 -0
- /package/dist/{componets → components}/message/warp.d.ts +0 -0
- /package/dist/{componets/message-box/index.d.ts → components/message-box/MessageBox.d.ts} +0 -0
- /package/dist/{componets → components}/message-box/props.d.ts +0 -0
- /package/dist/{componets → components}/notification/props.d.ts +0 -0
- /package/dist/{componets → components}/notification/warp.d.ts +0 -0
- /package/dist/{componets → components}/tag-cloud/index.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/components/trend-chart-grid.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/components/trend-chart-labels.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/helpers/genPath.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/helpers/genPoints.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/helpers/getPadding.d.ts +0 -0
- /package/dist/{componets/trend-chart → components/trend-chart.bak}/helpers/validatePadding.d.ts +0 -0
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# 简介
|
2
2
|
|
3
|
-
X-Next
|
3
|
+
X-Next致力打造一套最好看、最好用的Vue3 UI组件库。
|
4
4
|
|
5
5
|
# 安装
|
6
6
|
|
@@ -24,3 +24,28 @@ const app = createApp(App)
|
|
24
24
|
app.use(XNext)
|
25
25
|
app.mount('#app')
|
26
26
|
```
|
27
|
+
### 目前已完成的组件
|
28
|
+
|
29
|
+
```
|
30
|
+
XButton: (typeof import('x-next'))['XButton'];
|
31
|
+
XDialog: (typeof import('x-next'))['XDialog'];
|
32
|
+
XMessage: (typeof import('x-next'))['XMessage'];
|
33
|
+
XMessageBox: (typeof import('x-next'))['XMessageBox'];
|
34
|
+
XNotification: (typeof import('x-next'))['XNotification'];
|
35
|
+
XSpace: (typeof import('x-next'))['XSpace'];
|
36
|
+
XPopconfirm: (typeof import('x-next'))['XPopconfirm'];
|
37
|
+
XTrendChart: (typeof import('x-next'))['XTrendChart'];
|
38
|
+
XTimeline: (typeof import('x-next'))['XTimeline'];
|
39
|
+
XTimelineItem: (typeof import('x-next'))['XTimelineItem'];
|
40
|
+
XPopup: (typeof import('x-next'))['XPopup'];
|
41
|
+
XScrollbar: (typeof import('x-next'))['XScrollbar'];
|
42
|
+
XDrawer: (typeof import('x-next'))['XDrawer'];
|
43
|
+
XTag: (typeof import('x-next'))['XTag'];
|
44
|
+
XTooltip: (typeof import('x-next'))['XTooltip'];
|
45
|
+
XImage: (typeof import('x-next'))['XImage'];
|
46
|
+
XImagePreview: (typeof import('x-next'))['XImagePreview'];
|
47
|
+
XImagePreviewGroup: (typeof import('x-next'))['XImagePreviewGroup'];
|
48
|
+
XImagePreviewAction: (typeof import('x-next'))['XImagePreviewAction'];
|
49
|
+
XTabPane: (typeof import('x-next'))['XTabPane'];
|
50
|
+
XTabs: (typeof import('x-next'))['XTabs'];
|
51
|
+
```
|
@@ -0,0 +1,4 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
2
|
+
[key: string]: any;
|
3
|
+
}>[] | null | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
4
|
+
export default _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
2
|
+
[key: string]: any;
|
3
|
+
}>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "scroll"[], "scroll", import('vue').PublicProps, Readonly<{}> & Readonly<{
|
4
|
+
onScroll?: ((...args: any[]) => any) | undefined;
|
5
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
6
|
+
export default _default;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { PropType, VNodeTypes } from 'vue';
|
2
|
+
export type RenderFunc = (props: Record<string, unknown>) => VNodeTypes;
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
4
|
+
renderFunc: {
|
5
|
+
type: PropType<RenderFunc>;
|
6
|
+
required: true;
|
7
|
+
};
|
8
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
9
|
+
renderFunc: {
|
10
|
+
type: PropType<RenderFunc>;
|
11
|
+
required: true;
|
12
|
+
};
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
2
|
+
watchOnUpdated: BooleanConstructor;
|
3
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
4
|
+
[key: string]: any;
|
5
|
+
}>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "resize"[], "resize", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
6
|
+
watchOnUpdated: BooleanConstructor;
|
7
|
+
}>> & Readonly<{
|
8
|
+
onResize?: ((...args: any[]) => any) | undefined;
|
9
|
+
}>, {
|
10
|
+
watchOnUpdated: boolean;
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
2
|
+
[key: string]: any;
|
3
|
+
}>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "resize"[], "resize", import('vue').PublicProps, Readonly<{}> & Readonly<{
|
4
|
+
onResize?: ((...args: any[]) => any) | undefined;
|
5
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
6
|
+
export default _default;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export declare const getProp: (target: any, path: any, defVal?: any) => any;
|
2
|
+
export declare const setProp: (target: any, path: any, value: any) => any;
|
3
|
+
export declare const deepClone: (obj: any, set?: any) => any;
|
4
|
+
export declare const NOOP: () => void;
|
5
|
+
export declare const addUnit: (value: string | number | undefined, unit?: string) => string;
|
6
|
+
export declare const upperFirstChar: (text: string) => string | undefined;
|
7
|
+
export declare const compose: <T>(...fns: ((...v: T[]) => T)[]) => (...v: T[]) => T;
|
8
|
+
export declare const pipe: <T>(...fns: ((...v: T[]) => T)[]) => (...v: T[]) => T;
|
9
|
+
export declare const findLastIndex: (arr: never[] | undefined, callback: (item: any, i: number, origin: any[]) => boolean) => number;
|
10
|
+
export declare const getUniqueId: (size?: number) => string;
|
11
|
+
export declare const genMatrix: (list: any[], row: number) => any[];
|
12
|
+
export declare const sleep: (delay?: number) => Promise<unknown>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
export declare const useIndex: ({ itemRef, selector, index, parentClassName, }: {
|
3
|
+
itemRef: Ref<HTMLElement | undefined | null>;
|
4
|
+
selector: string;
|
5
|
+
index?: Ref<number | undefined>;
|
6
|
+
parentClassName?: string;
|
7
|
+
}) => {
|
8
|
+
innerIndex: import('vue').ComputedRef<number>;
|
9
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { ComputedRef } from 'vue';
|
2
|
+
interface PopupContainerProps {
|
3
|
+
popupContainer: string | HTMLElement | undefined;
|
4
|
+
}
|
5
|
+
export default function usePopupContainer(defaultPopupContainer: HTMLElement, props: PopupContainerProps): ComputedRef<HTMLElement>;
|
6
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
export declare const useResizeObserver: ({ elementRef, onResize, }: {
|
3
|
+
elementRef: Ref<HTMLElement | undefined>;
|
4
|
+
onResize: (args: ResizeObserverEntry) => void;
|
5
|
+
}) => {
|
6
|
+
createResizeObserver: () => void;
|
7
|
+
destroyResizeObserver: () => void;
|
8
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { Size } from '../_utils/constant';
|
3
|
+
export declare const useSize: (size?: Ref<Size | undefined>, { defaultValue }?: {
|
4
|
+
defaultValue?: Size;
|
5
|
+
}) => {
|
6
|
+
mergedSize: import('vue').ComputedRef<"mini" | "small" | "medium" | "large">;
|
7
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
export declare const useTeleportContainer: ({ popupContainer, visible, defaultContainer, documentContainer, }: {
|
3
|
+
popupContainer: Ref<string | HTMLElement | undefined>;
|
4
|
+
visible: Ref<boolean>;
|
5
|
+
defaultContainer?: string;
|
6
|
+
documentContainer?: boolean;
|
7
|
+
}) => {
|
8
|
+
teleportContainer: Ref<string | HTMLElement | undefined, string | HTMLElement | undefined>;
|
9
|
+
containerRef: Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
10
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export declare const TRIGGER_POSITIONS: readonly ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
|
2
|
+
export type TriggerPosition = (typeof TRIGGER_POSITIONS)[number];
|
3
|
+
export declare const TRIGGER_EVENTS: readonly ["hover", "click", "focus", "contextMenu"];
|
4
|
+
export type TriggerEvent = (typeof TRIGGER_EVENTS)[number];
|
@@ -0,0 +1 @@
|
|
1
|
+
export type ClassName = string | Record<string, boolean> | (string | Record<string, boolean>)[];
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* @description: 防抖函数
|
3
|
+
* @param callback
|
4
|
+
* @param delay
|
5
|
+
* @param immediate
|
6
|
+
*/
|
7
|
+
export declare const debounce: (callback: (e: any) => void, delay: number, immediate?: boolean) => any;
|
8
|
+
/**
|
9
|
+
* @description: 节流函数
|
10
|
+
* @param callback
|
11
|
+
* @param delay
|
12
|
+
*/
|
13
|
+
export declare const throttle: (callback: (e: any) => void, delay?: number) => any;
|
package/dist/_utils/config.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export declare const COMPONENT_INSTALLED_KEY: unique symbol;
|
2
2
|
export declare const getClassPrefix: (name?: string) => string;
|
3
|
-
export declare const getComponentPrefix: (name: string) => string
|
3
|
+
export declare const getComponentPrefix: (name: string) => `X${string}`;
|
4
4
|
export declare const getClassNameMixin: (name: string) => {
|
5
5
|
block: string;
|
6
6
|
element: (className: string) => string;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare const SIZES: readonly ["mini", "small", "medium", "large"];
|
2
|
+
export type Size = typeof SIZES[number];
|
3
|
+
export declare const BORDER_SHAPES: readonly ["square", "round", "circle"];
|
4
|
+
export type BorderShape = typeof BORDER_SHAPES[number];
|
5
|
+
export declare const STATUSES: readonly ["normal", "success", "warning", "danger"];
|
6
|
+
export type Status = typeof STATUSES[number];
|
7
|
+
export declare const MESSAGE_TYPES: readonly ["info", "success", "warning", "error"];
|
8
|
+
export type MessageType = typeof MESSAGE_TYPES[number];
|
9
|
+
export declare const TRIGGER_POSITIONS: readonly ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
|
10
|
+
export type TriggerPosition = typeof TRIGGER_POSITIONS[number];
|
11
|
+
export declare const TRIGGER_EVENTS: readonly ["hover", "click", "focus", "contextMenu"];
|
12
|
+
export type TriggerEvent = typeof TRIGGER_EVENTS[number];
|
13
|
+
export declare const DIRECTIONS: readonly ["horizontal", "vertical"];
|
14
|
+
export type Direction = typeof DIRECTIONS[number];
|
15
|
+
export declare const INPUT_EVENTS: string[];
|
16
|
+
export declare const TEXT_ALIGNS: readonly ["left", "center", "right"];
|
17
|
+
export type TextAlign = typeof TEXT_ALIGNS[number];
|
package/dist/_utils/dom.d.ts
CHANGED
@@ -3,8 +3,14 @@ export declare const NOOP: () => void;
|
|
3
3
|
export declare const querySelector: (selectors: string, container?: Document | HTMLElement) => HTMLElement | undefined;
|
4
4
|
export declare const getScrollBarWidth: (element: HTMLElement) => number;
|
5
5
|
export declare const isScroll: (element: HTMLElement) => boolean;
|
6
|
+
export declare const isServerRendering: boolean;
|
6
7
|
export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
|
7
8
|
export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
|
8
9
|
export declare const getElement: (target: string | HTMLElement | undefined, container?: Document | HTMLElement) => HTMLElement | undefined;
|
9
10
|
export declare const on: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, event: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
10
11
|
export declare const off: <K extends keyof HTMLElementEventMap>(element: HTMLElement | Window, type: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void;
|
12
|
+
export interface Size {
|
13
|
+
height: number;
|
14
|
+
width: number;
|
15
|
+
}
|
16
|
+
export declare const getDocumentSize: () => Size;
|
package/dist/_utils/is.d.ts
CHANGED
@@ -5,6 +5,8 @@ export declare function isNull(obj: any): obj is null;
|
|
5
5
|
export declare function isBoolean(obj: unknown): obj is boolean;
|
6
6
|
export declare function isObject<T>(obj: T): obj is Extract<T, Record<string, any>>;
|
7
7
|
export declare const isPromise: <T>(obj: unknown) => obj is Promise<T>;
|
8
|
+
export declare const isAsync: (fn: unknown) => boolean;
|
9
|
+
export declare const isAsyncOrPromise: (fn: unknown) => boolean;
|
8
10
|
export declare function isString(obj: any): obj is string;
|
9
11
|
export declare function isNumber(obj: any): obj is number;
|
10
12
|
export declare function isRegExp(obj: any): boolean;
|
@@ -20,3 +22,4 @@ export declare const isArrayChildren: (children: VNodeNormalizedChildren) => chi
|
|
20
22
|
export declare const isQuarter: (fromat: string) => boolean;
|
21
23
|
export declare function isDayjs(time: any): time is Dayjs;
|
22
24
|
export declare function isClient(): boolean;
|
25
|
+
export declare const isFirefox: () => boolean;
|
@@ -0,0 +1 @@
|
|
1
|
+
export type Data = Record<string, any>;
|
package/dist/_utils/vue-eco.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import { VNodeTypes, VNode, PropType, Component, Slots, Plugin } from 'vue';
|
1
|
+
import { VNodeTypes, VNode, PropType, Component, Slots, App, Plugin, DefineComponent } from 'vue';
|
2
2
|
export type SFCWithInstall<T> = T & Plugin;
|
3
|
+
type ObjectData = Record<string, unknown>;
|
3
4
|
/**
|
4
5
|
* @description Vue生态操作封装
|
5
6
|
*/
|
@@ -22,7 +23,19 @@ export declare const isComponent: (vn: VNode, type?: VNodeTypes) => type is Comp
|
|
22
23
|
export declare const isTextChildren: (child: VNode, children: VNode["children"]) => children is string;
|
23
24
|
export declare const isArrayChildren: (vn: VNode, children: VNode["children"]) => children is VNode[];
|
24
25
|
export declare const isSlotsChildren: (vn: VNode, children: VNode["children"]) => children is Slots;
|
26
|
+
export declare const isEmptyChildren: (children?: VNode[]) => boolean;
|
25
27
|
export declare const getAllElements: (children: VNode[] | undefined, includeText?: boolean) => VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
26
28
|
[key: string]: any;
|
27
29
|
}>[];
|
30
|
+
export declare const getFirstElement: (vn: VNode | VNode[]) => HTMLElement | null;
|
31
|
+
export declare const getFirstElementFromVNode: (vn: VNode) => HTMLElement | undefined;
|
32
|
+
export declare const getFirstElementFromChildren: (children: VNode[] | undefined) => HTMLElement | undefined;
|
33
|
+
export declare const getChildrenArray: (vn: VNode) => VNode[] | undefined;
|
34
|
+
export declare const getComponentsFromVNode: (vn: VNode, name: string) => number[];
|
35
|
+
export declare const getComponentsFromChildren: (children: VNode[] | undefined, name: string) => number[];
|
36
|
+
export declare const mergeFirstChild: (children: VNode[] | undefined, extraProps: ObjectData | ((vn: VNode) => ObjectData)) => boolean;
|
28
37
|
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
|
38
|
+
export declare const generateComponent: <T extends Component | DefineComponent>(name: string, component: T) => T & {
|
39
|
+
install(app: App): void;
|
40
|
+
};
|
41
|
+
export {};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
type Size = 'mini' | 'small' | 'medium' | 'large' | 'huge';
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
4
|
+
prefix: {
|
5
|
+
type: StringConstructor;
|
6
|
+
};
|
7
|
+
size: {
|
8
|
+
type: PropType<Size>;
|
9
|
+
default: string;
|
10
|
+
};
|
11
|
+
disabled: {
|
12
|
+
type: BooleanConstructor;
|
13
|
+
default: boolean;
|
14
|
+
};
|
15
|
+
}>, {
|
16
|
+
className: {
|
17
|
+
block: string;
|
18
|
+
element: (className: string) => string;
|
19
|
+
modifier: (className: string) => string;
|
20
|
+
is: (className: string) => string;
|
21
|
+
};
|
22
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
23
|
+
prefix: {
|
24
|
+
type: StringConstructor;
|
25
|
+
};
|
26
|
+
size: {
|
27
|
+
type: PropType<Size>;
|
28
|
+
default: string;
|
29
|
+
};
|
30
|
+
disabled: {
|
31
|
+
type: BooleanConstructor;
|
32
|
+
default: boolean;
|
33
|
+
};
|
34
|
+
}>> & Readonly<{}>, {
|
35
|
+
size: Size;
|
36
|
+
disabled: boolean;
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
38
|
+
export default _default;
|
@@ -0,0 +1,97 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
2
|
+
disabled: BooleanConstructor;
|
3
|
+
block: BooleanConstructor;
|
4
|
+
loading: BooleanConstructor;
|
5
|
+
loadingFill: {
|
6
|
+
type: BooleanConstructor;
|
7
|
+
default: boolean;
|
8
|
+
};
|
9
|
+
debounce: {
|
10
|
+
type: NumberConstructor;
|
11
|
+
default: number;
|
12
|
+
};
|
13
|
+
shape: {
|
14
|
+
type: import('vue').PropType<import('./props').ButtonShape>;
|
15
|
+
default: undefined;
|
16
|
+
};
|
17
|
+
link: {
|
18
|
+
type: BooleanConstructor;
|
19
|
+
default: boolean;
|
20
|
+
};
|
21
|
+
type: {
|
22
|
+
type: import('vue').PropType<import('./props').ButtonType>;
|
23
|
+
default: string;
|
24
|
+
};
|
25
|
+
status: {
|
26
|
+
type: import('vue').PropType<import('./props').ButtonStatus>;
|
27
|
+
default: string;
|
28
|
+
};
|
29
|
+
plain: {
|
30
|
+
type: BooleanConstructor;
|
31
|
+
default: boolean;
|
32
|
+
};
|
33
|
+
size: {
|
34
|
+
type: import('vue').PropType<import('./props').ButtonSize>;
|
35
|
+
default: string;
|
36
|
+
};
|
37
|
+
border: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
default: boolean;
|
40
|
+
};
|
41
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
42
|
+
disabled: BooleanConstructor;
|
43
|
+
block: BooleanConstructor;
|
44
|
+
loading: BooleanConstructor;
|
45
|
+
loadingFill: {
|
46
|
+
type: BooleanConstructor;
|
47
|
+
default: boolean;
|
48
|
+
};
|
49
|
+
debounce: {
|
50
|
+
type: NumberConstructor;
|
51
|
+
default: number;
|
52
|
+
};
|
53
|
+
shape: {
|
54
|
+
type: import('vue').PropType<import('./props').ButtonShape>;
|
55
|
+
default: undefined;
|
56
|
+
};
|
57
|
+
link: {
|
58
|
+
type: BooleanConstructor;
|
59
|
+
default: boolean;
|
60
|
+
};
|
61
|
+
type: {
|
62
|
+
type: import('vue').PropType<import('./props').ButtonType>;
|
63
|
+
default: string;
|
64
|
+
};
|
65
|
+
status: {
|
66
|
+
type: import('vue').PropType<import('./props').ButtonStatus>;
|
67
|
+
default: string;
|
68
|
+
};
|
69
|
+
plain: {
|
70
|
+
type: BooleanConstructor;
|
71
|
+
default: boolean;
|
72
|
+
};
|
73
|
+
size: {
|
74
|
+
type: import('vue').PropType<import('./props').ButtonSize>;
|
75
|
+
default: string;
|
76
|
+
};
|
77
|
+
border: {
|
78
|
+
type: BooleanConstructor;
|
79
|
+
default: boolean;
|
80
|
+
};
|
81
|
+
}>> & Readonly<{
|
82
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
83
|
+
}>, {
|
84
|
+
size: import('./props').ButtonSize;
|
85
|
+
type: import('./props').ButtonType;
|
86
|
+
link: boolean;
|
87
|
+
disabled: boolean;
|
88
|
+
block: boolean;
|
89
|
+
loading: boolean;
|
90
|
+
loadingFill: boolean;
|
91
|
+
debounce: number;
|
92
|
+
shape: import('./props').ButtonShape;
|
93
|
+
status: import('./props').ButtonStatus;
|
94
|
+
plain: boolean;
|
95
|
+
border: boolean;
|
96
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
97
|
+
export default _default;
|
@@ -0,0 +1,181 @@
|
|
1
|
+
export declare const XButton: {
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
3
|
+
disabled: BooleanConstructor;
|
4
|
+
block: BooleanConstructor;
|
5
|
+
loading: BooleanConstructor;
|
6
|
+
loadingFill: {
|
7
|
+
type: BooleanConstructor;
|
8
|
+
default: boolean;
|
9
|
+
};
|
10
|
+
debounce: {
|
11
|
+
type: NumberConstructor;
|
12
|
+
default: number;
|
13
|
+
};
|
14
|
+
shape: {
|
15
|
+
type: import('vue').PropType<import('./props').ButtonShape>;
|
16
|
+
default: undefined;
|
17
|
+
};
|
18
|
+
link: {
|
19
|
+
type: BooleanConstructor;
|
20
|
+
default: boolean;
|
21
|
+
};
|
22
|
+
type: {
|
23
|
+
type: import('vue').PropType<import('./props').ButtonType>;
|
24
|
+
default: string;
|
25
|
+
};
|
26
|
+
status: {
|
27
|
+
type: import('vue').PropType<import('./props').ButtonStatus>;
|
28
|
+
default: string;
|
29
|
+
};
|
30
|
+
plain: {
|
31
|
+
type: BooleanConstructor;
|
32
|
+
default: boolean;
|
33
|
+
};
|
34
|
+
size: {
|
35
|
+
type: import('vue').PropType<import('./props').ButtonSize>;
|
36
|
+
default: string;
|
37
|
+
};
|
38
|
+
border: {
|
39
|
+
type: BooleanConstructor;
|
40
|
+
default: boolean;
|
41
|
+
};
|
42
|
+
}>> & Readonly<{
|
43
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
44
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], import('vue').PublicProps, {
|
45
|
+
size: import('./props').ButtonSize;
|
46
|
+
type: import('./props').ButtonType;
|
47
|
+
link: boolean;
|
48
|
+
disabled: boolean;
|
49
|
+
block: boolean;
|
50
|
+
loading: boolean;
|
51
|
+
loadingFill: boolean;
|
52
|
+
debounce: number;
|
53
|
+
shape: import('./props').ButtonShape;
|
54
|
+
status: import('./props').ButtonStatus;
|
55
|
+
plain: boolean;
|
56
|
+
border: boolean;
|
57
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
58
|
+
P: {};
|
59
|
+
B: {};
|
60
|
+
D: {};
|
61
|
+
C: {};
|
62
|
+
M: {};
|
63
|
+
Defaults: {};
|
64
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
65
|
+
disabled: BooleanConstructor;
|
66
|
+
block: BooleanConstructor;
|
67
|
+
loading: BooleanConstructor;
|
68
|
+
loadingFill: {
|
69
|
+
type: BooleanConstructor;
|
70
|
+
default: boolean;
|
71
|
+
};
|
72
|
+
debounce: {
|
73
|
+
type: NumberConstructor;
|
74
|
+
default: number;
|
75
|
+
};
|
76
|
+
shape: {
|
77
|
+
type: import('vue').PropType<import('./props').ButtonShape>;
|
78
|
+
default: undefined;
|
79
|
+
};
|
80
|
+
link: {
|
81
|
+
type: BooleanConstructor;
|
82
|
+
default: boolean;
|
83
|
+
};
|
84
|
+
type: {
|
85
|
+
type: import('vue').PropType<import('./props').ButtonType>;
|
86
|
+
default: string;
|
87
|
+
};
|
88
|
+
status: {
|
89
|
+
type: import('vue').PropType<import('./props').ButtonStatus>;
|
90
|
+
default: string;
|
91
|
+
};
|
92
|
+
plain: {
|
93
|
+
type: BooleanConstructor;
|
94
|
+
default: boolean;
|
95
|
+
};
|
96
|
+
size: {
|
97
|
+
type: import('vue').PropType<import('./props').ButtonSize>;
|
98
|
+
default: string;
|
99
|
+
};
|
100
|
+
border: {
|
101
|
+
type: BooleanConstructor;
|
102
|
+
default: boolean;
|
103
|
+
};
|
104
|
+
}>> & Readonly<{
|
105
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
106
|
+
}>, () => any, {}, {}, {}, {
|
107
|
+
size: import('./props').ButtonSize;
|
108
|
+
type: import('./props').ButtonType;
|
109
|
+
link: boolean;
|
110
|
+
disabled: boolean;
|
111
|
+
block: boolean;
|
112
|
+
loading: boolean;
|
113
|
+
loadingFill: boolean;
|
114
|
+
debounce: number;
|
115
|
+
shape: import('./props').ButtonShape;
|
116
|
+
status: import('./props').ButtonStatus;
|
117
|
+
plain: boolean;
|
118
|
+
border: boolean;
|
119
|
+
}>;
|
120
|
+
__isFragment?: never;
|
121
|
+
__isTeleport?: never;
|
122
|
+
__isSuspense?: never;
|
123
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
124
|
+
disabled: BooleanConstructor;
|
125
|
+
block: BooleanConstructor;
|
126
|
+
loading: BooleanConstructor;
|
127
|
+
loadingFill: {
|
128
|
+
type: BooleanConstructor;
|
129
|
+
default: boolean;
|
130
|
+
};
|
131
|
+
debounce: {
|
132
|
+
type: NumberConstructor;
|
133
|
+
default: number;
|
134
|
+
};
|
135
|
+
shape: {
|
136
|
+
type: import('vue').PropType<import('./props').ButtonShape>;
|
137
|
+
default: undefined;
|
138
|
+
};
|
139
|
+
link: {
|
140
|
+
type: BooleanConstructor;
|
141
|
+
default: boolean;
|
142
|
+
};
|
143
|
+
type: {
|
144
|
+
type: import('vue').PropType<import('./props').ButtonType>;
|
145
|
+
default: string;
|
146
|
+
};
|
147
|
+
status: {
|
148
|
+
type: import('vue').PropType<import('./props').ButtonStatus>;
|
149
|
+
default: string;
|
150
|
+
};
|
151
|
+
plain: {
|
152
|
+
type: BooleanConstructor;
|
153
|
+
default: boolean;
|
154
|
+
};
|
155
|
+
size: {
|
156
|
+
type: import('vue').PropType<import('./props').ButtonSize>;
|
157
|
+
default: string;
|
158
|
+
};
|
159
|
+
border: {
|
160
|
+
type: BooleanConstructor;
|
161
|
+
default: boolean;
|
162
|
+
};
|
163
|
+
}>> & Readonly<{
|
164
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
165
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", {
|
166
|
+
size: import('./props').ButtonSize;
|
167
|
+
type: import('./props').ButtonType;
|
168
|
+
link: boolean;
|
169
|
+
disabled: boolean;
|
170
|
+
block: boolean;
|
171
|
+
loading: boolean;
|
172
|
+
loadingFill: boolean;
|
173
|
+
debounce: number;
|
174
|
+
shape: import('./props').ButtonShape;
|
175
|
+
status: import('./props').ButtonStatus;
|
176
|
+
plain: boolean;
|
177
|
+
border: boolean;
|
178
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
179
|
+
install(app: import('vue').App): void;
|
180
|
+
};
|
181
|
+
export { XButton as default };
|