fangguo-component 1.0.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/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/MInput-CO6YUVuZ.js +101 -0
- package/dist/MInput.css +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/cascader.css +1 -0
- package/dist/cascader.vue_vue_type_script_setup_true_lang-HFhhhQva.js +2268 -0
- package/dist/components/cascader/cascader/cascader.d.ts +49 -0
- package/dist/components/cascader/cascader/cascader.vue.d.ts +3734 -0
- package/dist/components/cascader/cascader/index.d.ts +6 -0
- package/dist/components/cascader/cascader-panel/config.d.ts +28 -0
- package/dist/components/cascader/cascader-panel/index.vue.d.ts +971 -0
- package/dist/components/cascader/cascader-panel/instance.d.ts +2 -0
- package/dist/components/cascader/cascader-panel/menu.vue.d.ts +659 -0
- package/dist/components/cascader/cascader-panel/node-content.d.ts +21 -0
- package/dist/components/cascader/cascader-panel/node.d.ts +85 -0
- package/dist/components/cascader/cascader-panel/node.vue.d.ts +481 -0
- package/dist/components/cascader/cascader-panel/store.d.ts +18 -0
- package/dist/components/cascader/cascader-panel/types.d.ts +36 -0
- package/dist/components/cascader/cascader-panel/utils.d.ts +4 -0
- package/dist/components/cascader/index.d.ts +4 -0
- package/dist/components/cascader/index.js +4 -0
- package/dist/components/cascader/utils/arrays.d.ts +5 -0
- package/dist/components/cascader/utils/browser.d.ts +3 -0
- package/dist/components/cascader/utils/dom/aria.d.ts +30 -0
- package/dist/components/cascader/utils/dom/event.d.ts +6 -0
- package/dist/components/cascader/utils/dom/index.d.ts +5 -0
- package/dist/components/cascader/utils/dom/position.d.ts +7 -0
- package/dist/components/cascader/utils/dom/scroll.d.ts +8 -0
- package/dist/components/cascader/utils/dom/style.d.ts +9 -0
- package/dist/components/cascader/utils/error.d.ts +3 -0
- package/dist/components/cascader/utils/functions.d.ts +1 -0
- package/dist/components/cascader/utils/i18n.d.ts +1 -0
- package/dist/components/cascader/utils/index.d.ts +13 -0
- package/dist/components/cascader/utils/objects.d.ts +8 -0
- package/dist/components/cascader/utils/raf.d.ts +2 -0
- package/dist/components/cascader/utils/rand.d.ts +10 -0
- package/dist/components/cascader/utils/strings.d.ts +6 -0
- package/dist/components/cascader/utils/types.d.ts +9 -0
- package/dist/components/cascader/utils/typescript.d.ts +12 -0
- package/dist/components/cascader/utils/vue/global-node.d.ts +3 -0
- package/dist/components/cascader/utils/vue/icon.d.ts +23 -0
- package/dist/components/cascader/utils/vue/index.d.ts +9 -0
- package/dist/components/cascader/utils/vue/install.d.ts +6 -0
- package/dist/components/cascader/utils/vue/props/index.d.ts +3 -0
- package/dist/components/cascader/utils/vue/props/runtime.d.ts +29 -0
- package/dist/components/cascader/utils/vue/props/types.d.ts +120 -0
- package/dist/components/cascader/utils/vue/props/util.d.ts +8 -0
- package/dist/components/cascader/utils/vue/refs.d.ts +3 -0
- package/dist/components/cascader/utils/vue/size.d.ts +2 -0
- package/dist/components/cascader/utils/vue/typescript.d.ts +5 -0
- package/dist/components/cascader/utils/vue/validator.d.ts +3 -0
- package/dist/components/cascader/utils/vue/vnode.d.ts +50 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +6 -0
- package/dist/components/mInput/MInput.vue.d.ts +28 -0
- package/dist/components/mInput/index.d.ts +2 -0
- package/dist/components/mInput/index.js +4 -0
- package/dist/components/mInput/types.d.ts +24 -0
- package/dist/directive/index.d.ts +1 -0
- package/dist/directive/index.js +4 -0
- package/dist/directive/loading/Loading.vue.d.ts +2 -0
- package/dist/directive/loading/index.d.ts +1 -0
- package/dist/directive/loading/index.js +4 -0
- package/dist/directive/loading/loading.d.ts +5 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/usePagination/index.d.ts +1 -0
- package/dist/hooks/usePagination/index.js +4 -0
- package/dist/hooks/usePagination/usePagination.d.ts +8 -0
- package/dist/index-CeWudY6u.js +8 -0
- package/dist/index-DihzpZcR.js +14 -0
- package/dist/index-DpPsTMp0.js +8 -0
- package/dist/index-wUcQXc_Z.js +10 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +55 -0
- package/dist/loading-DJVNc0eN.js +36 -0
- package/dist/loading.css +1 -0
- package/dist/shims.d.ts +20 -0
- package/dist/tools/Grid/Grid.d.ts +48 -0
- package/dist/tools/Grid/index.d.ts +1 -0
- package/dist/tools/Grid/index.js +217 -0
- package/dist/tools/common/common.d.ts +44 -0
- package/dist/tools/common/index.d.ts +1 -0
- package/dist/tools/common/index.js +5087 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +10 -0
- package/dist/usePagination-CwShBEjA.js +20 -0
- package/package.json +82 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const unique: <T>(arr: T[]) => T[];
|
|
2
|
+
type Many<T> = T | ReadonlyArray<T>;
|
|
3
|
+
/** like `_.castArray`, except falsy value returns empty array. */
|
|
4
|
+
export declare const castArray: <T>(arr: Many<T>) => T[];
|
|
5
|
+
export { castArray as ensureArray } from 'lodash-unified';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determine if the testing element is visible on screen no matter if its on the viewport or not
|
|
3
|
+
*/
|
|
4
|
+
export declare const isVisible: (element: HTMLElement) => boolean;
|
|
5
|
+
export declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
|
|
6
|
+
/**
|
|
7
|
+
* @desc Determine if target element is focusable
|
|
8
|
+
* @param element {HTMLElement}
|
|
9
|
+
* @returns {Boolean} true if it is focusable
|
|
10
|
+
*/
|
|
11
|
+
export declare const isFocusable: (element: HTMLElement) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @desc Set Attempt to set focus on the current node.
|
|
14
|
+
* @param element
|
|
15
|
+
* The node to attempt to focus on.
|
|
16
|
+
* @returns
|
|
17
|
+
* true if element is focused.
|
|
18
|
+
*/
|
|
19
|
+
export declare const attemptFocus: (element: HTMLElement) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Trigger an event
|
|
22
|
+
* mouseenter, mouseleave, mouseover, keyup, change, click, etc.
|
|
23
|
+
* @param {HTMLElement} elm
|
|
24
|
+
* @param {String} name
|
|
25
|
+
* @param {*} opts
|
|
26
|
+
*/
|
|
27
|
+
export declare const triggerEvent: (elm: HTMLElement, name: string, ...opts: Array<boolean>) => HTMLElement;
|
|
28
|
+
export declare const isLeaf: (el: HTMLElement) => boolean;
|
|
29
|
+
export declare const getSibling: (el: HTMLElement, distance: number, elClass: string) => Element;
|
|
30
|
+
export declare const focusNode: (el: HTMLElement) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const composeEventHandlers: <E>(theirsHandler?: (event: E) => boolean | void, oursHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
2
|
+
checkForDefaultPrevented?: boolean;
|
|
3
|
+
}) => (event: E) => void;
|
|
4
|
+
type WhenMouseHandler = (e: PointerEvent) => any;
|
|
5
|
+
export declare const whenMouse: (handler: WhenMouseHandler) => WhenMouseHandler;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const isInContainer: (el?: Element, container?: Element | Window) => boolean;
|
|
2
|
+
export declare const getOffsetTop: (el: HTMLElement) => number;
|
|
3
|
+
export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
|
|
4
|
+
export declare const getClientXY: (event: MouseEvent | TouchEvent) => {
|
|
5
|
+
clientX: number;
|
|
6
|
+
clientY: number;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const isScroll: (el: HTMLElement, isVertical?: boolean) => boolean;
|
|
2
|
+
export declare const getScrollContainer: (el: HTMLElement, isVertical?: boolean) => Window | HTMLElement | undefined;
|
|
3
|
+
export declare const getScrollBarWidth: (namespace: string) => number;
|
|
4
|
+
/**
|
|
5
|
+
* Scroll with in the container element, positioning the **selected** element at the top
|
|
6
|
+
* of the container
|
|
7
|
+
*/
|
|
8
|
+
export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
export declare const classNameToArray: (cls?: string) => string[];
|
|
3
|
+
export declare const hasClass: (el: Element, cls: string) => boolean;
|
|
4
|
+
export declare const addClass: (el: Element, cls: string) => void;
|
|
5
|
+
export declare const removeClass: (el: Element, cls: string) => void;
|
|
6
|
+
export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
|
|
7
|
+
export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
|
|
8
|
+
export declare const removeStyle: (element: HTMLElement, style: CSSProperties | keyof CSSProperties) => void;
|
|
9
|
+
export declare function addUnit(value?: string | number, defaultUnit?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NOOP } from '@vue/shared';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isKorean: (text: string) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './dom';
|
|
2
|
+
export * from './vue';
|
|
3
|
+
export * from './arrays';
|
|
4
|
+
export * from './browser';
|
|
5
|
+
export * from './error';
|
|
6
|
+
export * from './functions';
|
|
7
|
+
export * from './i18n';
|
|
8
|
+
export * from './objects';
|
|
9
|
+
export * from './raf';
|
|
10
|
+
export * from './rand';
|
|
11
|
+
export * from './strings';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './typescript';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Entries } from 'type-fest';
|
|
2
|
+
import { Arrayable } from '.';
|
|
3
|
+
export declare const keysOf: <T>(arr: T) => Array<keyof T>;
|
|
4
|
+
export declare const entriesOf: <T>(arr: T) => Entries<T>;
|
|
5
|
+
export { hasOwn } from '@vue/shared';
|
|
6
|
+
export declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
|
|
7
|
+
value: T;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate random number in range [0, 1000]
|
|
3
|
+
* Maybe replace with [uuid](https://www.npmjs.com/package/uuid)
|
|
4
|
+
*/
|
|
5
|
+
export declare const generateId: () => number;
|
|
6
|
+
/**
|
|
7
|
+
* Generating a random int in range (0, max - 1)
|
|
8
|
+
* @param max {number}
|
|
9
|
+
*/
|
|
10
|
+
export declare const getRandomInt: (max: number) => number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { camelize, hyphenate, hyphenate as kebabCase, } from '@vue/shared';
|
|
2
|
+
/**
|
|
3
|
+
* fork from {@link https://github.com/sindresorhus/escape-string-regexp}
|
|
4
|
+
*/
|
|
5
|
+
export declare const escapeStringRegexp: (string?: string) => string;
|
|
6
|
+
export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { isArray, isFunction, isObject, isString, isDate, isPromise, isSymbol, } from '@vue/shared';
|
|
2
|
+
export { isVNode } from 'vue';
|
|
3
|
+
export declare const isUndefined: (val: any) => val is undefined;
|
|
4
|
+
export declare const isBoolean: (val: any) => val is boolean;
|
|
5
|
+
export declare const isNumber: (val: any) => val is number;
|
|
6
|
+
export declare const isEmpty: (val: unknown) => boolean;
|
|
7
|
+
export declare const isElement: (e: unknown) => e is Element;
|
|
8
|
+
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
|
|
9
|
+
export declare const isStringNumber: (val: string) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const mutable: <T extends readonly any[] | Record<string, unknown>>(val: T) => Mutable<typeof val>;
|
|
2
|
+
export type Mutable<T> = {
|
|
3
|
+
-readonly [P in keyof T]: T[P];
|
|
4
|
+
};
|
|
5
|
+
export type HTMLElementCustomized<T> = HTMLElement & T;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated stop to use null
|
|
8
|
+
* @see {@link https://github.com/sindresorhus/meta/discussions/7}
|
|
9
|
+
*/
|
|
10
|
+
export type Nullable<T> = T | null;
|
|
11
|
+
export type Arrayable<T> = T | T[];
|
|
12
|
+
export type Awaitable<T> = Promise<T> | T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export declare const iconPropType: import('vue').PropType<string | Component>;
|
|
3
|
+
export declare const CloseComponents: {
|
|
4
|
+
Close: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
};
|
|
6
|
+
export declare const TypeComponents: {
|
|
7
|
+
Close: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
SuccessFilled: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
InfoFilled: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
WarningFilled: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
CircleCloseFilled: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
};
|
|
13
|
+
export declare const TypeComponentsMap: {
|
|
14
|
+
success: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
15
|
+
warning: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
error: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
info: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
};
|
|
19
|
+
export declare const ValidateComponentsMap: {
|
|
20
|
+
validating: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
21
|
+
success: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
error: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
import { SFCInstallWithContext, SFCWithInstall } from './typescript';
|
|
3
|
+
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
|
|
4
|
+
export declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>;
|
|
5
|
+
export declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>;
|
|
6
|
+
export declare const withNoopInstall: <T>(component: T) => SFCWithInstall<T>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { EpProp, EpPropConvert, EpPropFinalized, EpPropInput, EpPropMergeType, IfEpProp, IfNativePropType, NativePropType } from './types';
|
|
3
|
+
export declare const epPropKey = "__epPropKey";
|
|
4
|
+
export declare const definePropType: <T>(val: any) => PropType<T>;
|
|
5
|
+
export declare const isEpProp: (val: unknown) => val is EpProp<any, any, any>;
|
|
6
|
+
/**
|
|
7
|
+
* @description Build prop. It can better optimize prop types
|
|
8
|
+
* @description 生成 prop,能更好地优化类型
|
|
9
|
+
* @example
|
|
10
|
+
// limited options
|
|
11
|
+
// the type will be PropType<'light' | 'dark'>
|
|
12
|
+
buildProp({
|
|
13
|
+
type: String,
|
|
14
|
+
values: ['light', 'dark'],
|
|
15
|
+
} as const)
|
|
16
|
+
* @example
|
|
17
|
+
// limited options and other types
|
|
18
|
+
// the type will be PropType<'small' | 'large' | number>
|
|
19
|
+
buildProp({
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
values: ['small', 'large'],
|
|
22
|
+
validator: (val: unknown): val is number => typeof val === 'number',
|
|
23
|
+
} as const)
|
|
24
|
+
@link see more: https://github.com/element-plus/element-plus/pull/3341
|
|
25
|
+
*/
|
|
26
|
+
export declare const buildProp: <Type = never, Value = never, Validator = never, Default extends EpPropMergeType<Type, Value, Validator> = never, Required extends boolean = false>(prop: EpPropInput<Type, Value, Validator, Default, Required>, key?: string) => EpPropFinalized<Type, Value, Validator, Default, Required>;
|
|
27
|
+
export declare const buildProps: <Props extends Record<string, {
|
|
28
|
+
[epPropKey]: true;
|
|
29
|
+
} | NativePropType | EpPropInput<any, any, any, any, any>>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { epPropKey } from './runtime';
|
|
2
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { IfNever, UnknownToNever, WritableArray } from './util';
|
|
4
|
+
type Value<T> = T[keyof T];
|
|
5
|
+
/**
|
|
6
|
+
* Extract the type of a single prop
|
|
7
|
+
*
|
|
8
|
+
* 提取单个 prop 的参数类型
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ExtractPropType<{ type: StringConstructor }> => string | undefined
|
|
12
|
+
* ExtractPropType<{ type: StringConstructor, required: true }> => string
|
|
13
|
+
* ExtractPropType<{ type: BooleanConstructor }> => boolean
|
|
14
|
+
*/
|
|
15
|
+
export type ExtractPropType<T extends object> = Value<ExtractPropTypes<{
|
|
16
|
+
key: T;
|
|
17
|
+
}>>;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts types via `ExtractPropTypes`, accepting `PropType<T>`, `XXXConstructor`, `never`...
|
|
20
|
+
*
|
|
21
|
+
* 通过 `ExtractPropTypes` 提取类型,接受 `PropType<T>`、`XXXConstructor`、`never`...
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ResolvePropType<BooleanConstructor> => boolean
|
|
25
|
+
* ResolvePropType<PropType<T>> => T
|
|
26
|
+
**/
|
|
27
|
+
export type ResolvePropType<T> = IfNever<T, never, ExtractPropType<{
|
|
28
|
+
type: WritableArray<T>;
|
|
29
|
+
required: true;
|
|
30
|
+
}>>;
|
|
31
|
+
/**
|
|
32
|
+
* Merge Type, Value, Validator types
|
|
33
|
+
* 合并 Type、Value、Validator 的类型
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* EpPropMergeType<StringConstructor, '1', 1> => 1 | "1" // ignores StringConstructor
|
|
37
|
+
* EpPropMergeType<StringConstructor, never, number> => string | number
|
|
38
|
+
*/
|
|
39
|
+
export type EpPropMergeType<Type, Value, Validator> = IfNever<UnknownToNever<Value>, ResolvePropType<Type>, never> | UnknownToNever<Value> | UnknownToNever<Validator>;
|
|
40
|
+
/**
|
|
41
|
+
* Handling default values for input (constraints)
|
|
42
|
+
*
|
|
43
|
+
* 处理输入参数的默认值(约束)
|
|
44
|
+
*/
|
|
45
|
+
export type EpPropInputDefault<Required extends boolean, Default> = Required extends true ? never : Default extends Record<string, unknown> | Array<any> ? () => Default : (() => Default) | Default;
|
|
46
|
+
/**
|
|
47
|
+
* Native prop types, e.g: `BooleanConstructor`, `StringConstructor`, `null`, `undefined`, etc.
|
|
48
|
+
*
|
|
49
|
+
* 原生 prop `类型,BooleanConstructor`、`StringConstructor`、`null`、`undefined` 等
|
|
50
|
+
*/
|
|
51
|
+
export type NativePropType = ((...args: any) => any) | {
|
|
52
|
+
new (...args: any): any;
|
|
53
|
+
} | undefined | null;
|
|
54
|
+
export type IfNativePropType<T, Y, N> = [T] extends [NativePropType] ? Y : N;
|
|
55
|
+
/**
|
|
56
|
+
* input prop `buildProp` or `buildProps` (constraints)
|
|
57
|
+
*
|
|
58
|
+
* prop 输入参数(约束)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* EpPropInput<StringConstructor, 'a', never, never, true>
|
|
62
|
+
* ⬇️
|
|
63
|
+
* {
|
|
64
|
+
type?: StringConstructor | undefined;
|
|
65
|
+
required?: true | undefined;
|
|
66
|
+
values?: readonly "a"[] | undefined;
|
|
67
|
+
validator?: ((val: any) => boolean) | ((val: any) => val is never) | undefined;
|
|
68
|
+
default?: undefined;
|
|
69
|
+
}
|
|
70
|
+
*/
|
|
71
|
+
export type EpPropInput<Type, Value, Validator, Default extends EpPropMergeType<Type, Value, Validator>, Required extends boolean> = {
|
|
72
|
+
type?: Type;
|
|
73
|
+
required?: Required;
|
|
74
|
+
values?: readonly Value[];
|
|
75
|
+
validator?: ((val: any) => val is Validator) | ((val: any) => boolean);
|
|
76
|
+
default?: EpPropInputDefault<Required, Default>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* output prop `buildProp` or `buildProps`.
|
|
80
|
+
*
|
|
81
|
+
* prop 输出参数。
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* EpProp<'a', 'b', true>
|
|
85
|
+
* ⬇️
|
|
86
|
+
* {
|
|
87
|
+
readonly type: PropType<"a">;
|
|
88
|
+
readonly required: true;
|
|
89
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
90
|
+
readonly default: "b";
|
|
91
|
+
__epPropKey: true;
|
|
92
|
+
}
|
|
93
|
+
*/
|
|
94
|
+
export type EpProp<Type, Default, Required> = {
|
|
95
|
+
readonly type: PropType<Type>;
|
|
96
|
+
readonly required: [Required] extends [true] ? true : false;
|
|
97
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
98
|
+
[epPropKey]: true;
|
|
99
|
+
} & IfNever<Default, unknown, {
|
|
100
|
+
readonly default: Default;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Determine if it is `EpProp`
|
|
104
|
+
*/
|
|
105
|
+
export type IfEpProp<T, Y, N> = T extends {
|
|
106
|
+
[epPropKey]: true;
|
|
107
|
+
} ? Y : N;
|
|
108
|
+
/**
|
|
109
|
+
* Converting input to output.
|
|
110
|
+
*
|
|
111
|
+
* 将输入转换为输出
|
|
112
|
+
*/
|
|
113
|
+
export type EpPropConvert<Input> = Input extends EpPropInput<infer Type, infer Value, infer Validator, any, infer Required> ? EpPropFinalized<Type, Value, Validator, Input['default'], Required> : never;
|
|
114
|
+
/**
|
|
115
|
+
* Finalized conversion output
|
|
116
|
+
*
|
|
117
|
+
* 最终转换 EpProp
|
|
118
|
+
*/
|
|
119
|
+
export type EpPropFinalized<Type, Value, Validator, Default, Required> = EpProp<EpPropMergeType<Type, Value, Validator>, UnknownToNever<Default>, Required>;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Writable<T> = {
|
|
2
|
+
-readonly [P in keyof T]: T[P];
|
|
3
|
+
};
|
|
4
|
+
export type WritableArray<T> = T extends readonly any[] ? Writable<T> : T;
|
|
5
|
+
export type IfNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
|
|
6
|
+
export type IfUnknown<T, Y, N> = [unknown] extends [T] ? Y : N;
|
|
7
|
+
export type UnknownToNever<T> = IfUnknown<T, never, T>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
export type RefSetter = (el: Element | ComponentPublicInstance | undefined) => void;
|
|
3
|
+
export declare const composeRefs: (...refs: (Ref<HTMLElement | undefined> | RefSetter)[]) => (el: Element | ComponentPublicInstance | null) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createBlock, VNode, VNodeArrayChildren, VNodeChild, VNodeNormalizedChildren } from 'vue';
|
|
2
|
+
export declare enum PatchFlags {
|
|
3
|
+
TEXT = 1,
|
|
4
|
+
CLASS = 2,
|
|
5
|
+
STYLE = 4,
|
|
6
|
+
PROPS = 8,
|
|
7
|
+
FULL_PROPS = 16,
|
|
8
|
+
HYDRATE_EVENTS = 32,
|
|
9
|
+
STABLE_FRAGMENT = 64,
|
|
10
|
+
KEYED_FRAGMENT = 128,
|
|
11
|
+
UNKEYED_FRAGMENT = 256,
|
|
12
|
+
NEED_PATCH = 512,
|
|
13
|
+
DYNAMIC_SLOTS = 1024,
|
|
14
|
+
HOISTED = -1,
|
|
15
|
+
BAIL = -2
|
|
16
|
+
}
|
|
17
|
+
export type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;
|
|
18
|
+
export type RawSlots = Exclude<VNodeNormalizedChildren, Array<any> | null | string>;
|
|
19
|
+
export declare function isFragment(node: VNode): boolean;
|
|
20
|
+
export declare function isFragment(node: unknown): node is VNode;
|
|
21
|
+
export declare function isText(node: VNode): boolean;
|
|
22
|
+
export declare function isText(node: unknown): node is VNode;
|
|
23
|
+
export declare function isComment(node: VNode): boolean;
|
|
24
|
+
export declare function isComment(node: unknown): node is VNode;
|
|
25
|
+
export declare function isTemplate(node: VNode): boolean;
|
|
26
|
+
export declare function isTemplate(node: unknown): node is VNode;
|
|
27
|
+
/**
|
|
28
|
+
* determine if the element is a valid element type rather than fragments and comment e.g. <template> v-if
|
|
29
|
+
* @param node {VNode} node to be tested
|
|
30
|
+
*/
|
|
31
|
+
export declare function isValidElementNode(node: VNode): boolean;
|
|
32
|
+
export declare function isValidElementNode(node: unknown): node is VNode;
|
|
33
|
+
export declare const getFirstValidNode: (nodes: VNodeNormalizedChildren, maxDepth?: number) => string | number | boolean | void | VNodeArrayChildren | {
|
|
34
|
+
[name: string]: unknown;
|
|
35
|
+
$stable?: boolean;
|
|
36
|
+
} | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function renderIf(condition: boolean, ...args: Parameters<typeof createBlock>): VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>;
|
|
42
|
+
export declare function renderBlock(...args: Parameters<typeof createBlock>): VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const getNormalizedProps: (node: VNode) => Record<string, any>;
|
|
46
|
+
export declare const ensureOnlyChild: (children: VNodeArrayChildren | undefined) => VNodeArrayChildren | (string | number | boolean | void | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>);
|
|
49
|
+
export type FlattenVNodes = Array<VNodeChildAtom | RawSlots>;
|
|
50
|
+
export declare const flattedChildren: (children: FlattenVNodes | VNode | VNodeNormalizedChildren) => FlattenVNodes;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FgMInputProps } from './types';
|
|
2
|
+
type __VLS_Props = FgMInputProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
prepend?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: string) => any;
|
|
17
|
+
saveEvent: (value: string) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
20
|
+
onSaveEvent?: (value: string) => any;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MInput 声明式 Props(与模板中 `defineProps` 一致,不含 v-model)。
|
|
3
|
+
* `v-model` / `modelValue` 由 `defineModel` 单独声明,类型见 {@link FgMInputModelValue}。
|
|
4
|
+
*/
|
|
5
|
+
export interface FgMInputProps {
|
|
6
|
+
/** 弹窗内提示信息 */
|
|
7
|
+
tip?: string;
|
|
8
|
+
/** 弹窗标题 */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** 主输入框与弹窗内文本域占位符 */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** 弹窗确认按钮文案,未传时为「确认」 */
|
|
13
|
+
saveBtnText?: string;
|
|
14
|
+
}
|
|
15
|
+
/** `v-model` 绑定值类型 */
|
|
16
|
+
export type FgMInputModelValue = string;
|
|
17
|
+
/** 组件 `emit` 声明(监听可用 `@save-event`) */
|
|
18
|
+
export type FgMInputEmits = {
|
|
19
|
+
saveEvent: [value: string];
|
|
20
|
+
};
|
|
21
|
+
/** 对外 Props + `modelValue`,便于在封装表单或二次封装时做类型合并 */
|
|
22
|
+
export type FgMInputPublicProps = FgMInputProps & {
|
|
23
|
+
modelValue?: FgMInputModelValue;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './loading';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FgLoading } from './loading';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePagination';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePagination';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const usePagination: () => {
|
|
2
|
+
defaultSize: import('vue').Ref<number, number>;
|
|
3
|
+
originList: any;
|
|
4
|
+
page: import('vue').Ref<number, number>;
|
|
5
|
+
size: import('vue').Ref<number, number>;
|
|
6
|
+
total: import('vue').ComputedRef<any>;
|
|
7
|
+
list: import('vue').ComputedRef<any>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GridArea as e } from "./tools/Grid/index.js";
|
|
2
|
+
import { aesDecrypt as r, aesEncrypt as t, createUuid as o, formatBytes as a, mergeColumns as m } from "./tools/common/index.js";
|
|
3
|
+
const s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
|
+
__proto__: null,
|
|
5
|
+
GridArea: e,
|
|
6
|
+
aesDecrypt: r,
|
|
7
|
+
aesEncrypt: t,
|
|
8
|
+
createUuid: o,
|
|
9
|
+
formatBytes: a,
|
|
10
|
+
mergeColumns: m
|
|
11
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12
|
+
export {
|
|
13
|
+
s as t
|
|
14
|
+
};
|