@tmagic/utils 1.3.7 → 1.3.9-hotfix
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/dist/tmagic-utils.js +20 -36
- package/dist/tmagic-utils.js.map +1 -1
- package/dist/tmagic-utils.umd.cjs +2733 -35
- package/dist/tmagic-utils.umd.cjs.map +1 -1
- package/package.json +11 -9
- package/src/index.ts +21 -38
- package/LICENSE +0 -5432
- package/types/dom.d.ts +0 -11
- package/types/index.d.ts +0 -48
package/types/dom.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const asyncLoadJs: (url: string, crossOrigin?: string, document?: Document) => any;
|
|
2
|
-
export declare const asyncLoadCss: (url: string, document?: Document) => any;
|
|
3
|
-
export declare const addClassName: (el: Element, doc: Document, className: string) => void;
|
|
4
|
-
export declare const removeClassName: (el: Element, ...className: string[]) => void;
|
|
5
|
-
export declare const removeClassNameByClassName: (doc: Document, className: string) => HTMLElement | null;
|
|
6
|
-
export declare const injectStyle: (doc: Document, style: string) => HTMLStyleElement;
|
|
7
|
-
export declare const createDiv: ({ className, cssText }: {
|
|
8
|
-
className: string;
|
|
9
|
-
cssText: string;
|
|
10
|
-
}) => HTMLDivElement;
|
|
11
|
-
export declare const getDocument: () => Document;
|
package/types/index.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { DataSchema, DataSourceDeps, Id, MComponent, MNode } from '@tmagic/schema';
|
|
2
|
-
export * from './dom';
|
|
3
|
-
export declare const sleep: (ms: number) => Promise<void>;
|
|
4
|
-
export declare const datetimeFormatter: (v: string | Date, defaultValue?: string, format?: string) => string | number;
|
|
5
|
-
export declare const toLine: (name?: string) => string;
|
|
6
|
-
export declare const toHump: (name?: string) => string;
|
|
7
|
-
export declare const emptyFn: () => any;
|
|
8
|
-
/**
|
|
9
|
-
* 通过id获取组件在应用的子孙路径
|
|
10
|
-
* @param {number | string} id 组件id
|
|
11
|
-
* @param {Array} data 要查找的根容器节点
|
|
12
|
-
* @return {Array} 组件在data中的子孙路径
|
|
13
|
-
*/
|
|
14
|
-
export declare const getNodePath: (id: Id, data?: MNode[]) => MNode[];
|
|
15
|
-
export declare const filterXSS: (str: string) => string;
|
|
16
|
-
export declare const getUrlParam: (param: string, url?: string) => string;
|
|
17
|
-
export declare const isObject: (obj: any) => boolean;
|
|
18
|
-
export declare const isPop: (node: MComponent | null) => boolean;
|
|
19
|
-
export declare const isPage: (node?: MComponent | null) => boolean;
|
|
20
|
-
export declare const isPageFragment: (node?: MComponent | null) => boolean;
|
|
21
|
-
export declare const isNumber: (value: string) => boolean;
|
|
22
|
-
export declare const getHost: (targetUrl: string) => string | undefined;
|
|
23
|
-
export declare const isSameDomain: (targetUrl?: string, source?: string) => boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 生成指定位数的GUID,无【-】格式
|
|
26
|
-
* @param digit 位数,默认值8
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
export declare const guid: (digit?: number) => string;
|
|
30
|
-
export declare const getValueByKeyPath: any;
|
|
31
|
-
export declare const getNodes: (ids: Id[], data?: MNode[]) => MNode[];
|
|
32
|
-
export declare const getDepKeys: (dataSourceDeps: DataSourceDeps | undefined, nodeId: Id) => Id[];
|
|
33
|
-
export declare const getDepNodeIds: (dataSourceDeps?: DataSourceDeps) => string[];
|
|
34
|
-
/**
|
|
35
|
-
* 将新节点更新到data或者parentId对应的节点的子节点中
|
|
36
|
-
* @param newNode 新节点
|
|
37
|
-
* @param data 需要修改的数据
|
|
38
|
-
* @param parentId 父节点 id
|
|
39
|
-
*/
|
|
40
|
-
export declare const replaceChildNode: (newNode: MNode, data?: MNode[], parentId?: Id) => void;
|
|
41
|
-
export declare const compiledNode: (compile: (value: any) => any, node: MNode, dataSourceDeps?: DataSourceDeps, sourceId?: Id) => MNode;
|
|
42
|
-
export declare const compiledCond: (op: string, fieldValue: any, value: any, range?: number[]) => boolean;
|
|
43
|
-
export declare const getDefaultValueFromFields: (fields: DataSchema[]) => Record<string, any>;
|
|
44
|
-
export declare const DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX = "ds-field::";
|
|
45
|
-
export declare const getKeys: <T extends object>(obj: T) => (keyof T)[];
|
|
46
|
-
export declare const calculatePercentage: (value: number, percentageStr: string) => number;
|
|
47
|
-
export declare const isPercentage: (value: number | string) => boolean;
|
|
48
|
-
export declare const convertToNumber: (value: number | string, parentValue?: number) => number;
|