@allahjs/utils 1.10.0 → 1.12.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/dist/.tsbuildinfo +1 -1
- package/dist/core/arrayUtils/index.cjs +327 -3
- package/dist/core/arrayUtils/index.cjs.map +1 -1
- package/dist/core/arrayUtils/index.d.ts +137 -3
- package/dist/core/constants/asyncTaskScheduleVo.d.ts +1 -1
- package/dist/core/constants/comm.cjs +8 -8
- package/dist/core/constants/comm.cjs.map +1 -1
- package/dist/core/constants/comm.d.ts +4 -4
- package/dist/core/constants/index.cjs +2 -2
- package/dist/core/constants/index.d.ts +1 -1
- package/dist/core/diffUtils/index.cjs +219 -0
- package/dist/core/diffUtils/index.cjs.map +1 -0
- package/dist/core/diffUtils/index.d.ts +32 -0
- package/dist/core/fileUtils/index.cjs +21 -0
- package/dist/core/fileUtils/index.cjs.map +1 -0
- package/dist/core/fileUtils/index.d.ts +10 -0
- package/dist/core/index.cjs +20 -10
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +69 -1
- package/dist/core/pageUtils/index.cjs +21 -1
- package/dist/core/pageUtils/index.cjs.map +1 -1
- package/dist/core/pageUtils/index.d.ts +1 -0
- package/dist/esm/core/arrayUtils/index.d.ts +137 -3
- package/dist/esm/core/arrayUtils/index.js +327 -3
- package/dist/esm/core/arrayUtils/index.js.map +1 -1
- package/dist/esm/core/constants/asyncTaskScheduleVo.d.ts +1 -1
- package/dist/esm/core/constants/comm.d.ts +4 -4
- package/dist/esm/core/constants/comm.js +9 -9
- package/dist/esm/core/constants/comm.js.map +1 -1
- package/dist/esm/core/constants/index.d.ts +1 -1
- package/dist/esm/core/constants/index.js +1 -1
- package/dist/esm/core/diffUtils/index.d.ts +32 -0
- package/dist/esm/core/diffUtils/index.js +215 -0
- package/dist/esm/core/diffUtils/index.js.map +1 -0
- package/dist/esm/core/fileUtils/index.d.ts +10 -0
- package/dist/esm/core/fileUtils/index.js +16 -0
- package/dist/esm/core/fileUtils/index.js.map +1 -0
- package/dist/esm/core/index.d.ts +69 -1
- package/dist/esm/core/index.js +10 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/pageUtils/index.d.ts +1 -0
- package/dist/esm/core/pageUtils/index.js +21 -2
- package/dist/esm/core/pageUtils/index.js.map +1 -1
- package/dist/esm/form/attributes.d.ts +32 -0
- package/dist/esm/form/formItem.d.ts +163 -0
- package/dist/esm/form/index.d.ts +4 -1
- package/dist/esm/form/rule.d.ts +37 -0
- package/dist/esm/form/types.d.ts +12 -213
- package/dist/esm/index.d.ts +11 -2
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js +20 -0
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js +256 -0
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js +11 -0
- package/dist/esm/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js.map +1 -0
- package/dist/esm/request/ReqQueue/index.d.ts +25 -0
- package/dist/esm/request/httpCode/index.d.ts +9 -0
- package/dist/esm/request/index.d.ts +6 -3
- package/dist/esm/request/index.js +4 -2
- package/dist/esm/request/index.js.map +1 -1
- package/dist/esm/request/uniRequest/index.d.ts +5 -0
- package/dist/esm/types/dbData/index.d.ts +83 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/form/attributes.d.ts +32 -0
- package/dist/form/formItem.d.ts +163 -0
- package/dist/form/index.d.ts +4 -1
- package/dist/form/rule.d.ts +37 -0
- package/dist/form/types.d.ts +12 -213
- package/dist/index.cjs +61 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.cjs +23 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/array.cjs.map +1 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.cjs +260 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.cjs.map +1 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.cjs +14 -0
- package/dist/node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.cjs.map +1 -0
- package/dist/request/ReqQueue/index.d.ts +25 -0
- package/dist/request/httpCode/index.d.ts +9 -0
- package/dist/request/index.cjs +25 -20
- package/dist/request/index.cjs.map +1 -1
- package/dist/request/index.d.ts +6 -3
- package/dist/request/uniRequest/index.d.ts +5 -0
- package/dist/types/dbData/index.d.ts +83 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +28 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../../../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/base.js"],"sourcesContent":["export default class Diff {\n diff(oldStr, newStr, \n // Type below is not accurate/complete - see above for full possibilities - but it compiles\n options = {}) {\n let callback;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n else if ('callback' in options) {\n callback = options.callback;\n }\n // Allow subclasses to massage the input prior to running\n const oldString = this.castInput(oldStr, options);\n const newString = this.castInput(newStr, options);\n const oldTokens = this.removeEmpty(this.tokenize(oldString, options));\n const newTokens = this.removeEmpty(this.tokenize(newString, options));\n return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);\n }\n diffWithOptionsObj(oldTokens, newTokens, options, callback) {\n var _a;\n const done = (value) => {\n value = this.postProcess(value, options);\n if (callback) {\n setTimeout(function () { callback(value); }, 0);\n return undefined;\n }\n else {\n return value;\n }\n };\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let editLength = 1;\n let maxEditLength = newLen + oldLen;\n if (options.maxEditLength != null) {\n maxEditLength = Math.min(maxEditLength, options.maxEditLength);\n }\n const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;\n const abortAfterTimestamp = Date.now() + maxExecutionTime;\n const bestPath = [{ oldPos: -1, lastComponent: undefined }];\n // Seed editLength = 0, i.e. the content starts with the same values\n let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);\n if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // Identity per the equality and tokenizer\n return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));\n }\n // Once we hit the right edge of the edit graph on some diagonal k, we can\n // definitely reach the end of the edit graph in no more than k edits, so\n // there's no point in considering any moves to diagonal k+1 any more (from\n // which we're guaranteed to need at least k+1 more edits).\n // Similarly, once we've reached the bottom of the edit graph, there's no\n // point considering moves to lower diagonals.\n // We record this fact by setting minDiagonalToConsider and\n // maxDiagonalToConsider to some finite value once we've hit the edge of\n // the edit graph.\n // This optimization is not faithful to the original algorithm presented in\n // Myers's paper, which instead pointlessly extends D-paths off the end of\n // the edit graph - see page 7 of Myers's paper which notes this point\n // explicitly and illustrates it with a diagram. This has major performance\n // implications for some common scenarios. For instance, to compute a diff\n // where the new text simply appends d characters on the end of the\n // original text of length n, the true Myers algorithm will take O(n+d^2)\n // time while this optimization needs only O(n+d) time.\n let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;\n // Main worker method. checks all permutations of a given edit length for acceptance.\n const execEditLength = () => {\n for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {\n let basePath;\n const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];\n if (removePath) {\n // No one else is going to attempt to use this value, clear it\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath - 1] = undefined;\n }\n let canAdd = false;\n if (addPath) {\n // what newPos will be after we do an insertion:\n const addPathNewPos = addPath.oldPos - diagonalPath;\n canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;\n }\n const canRemove = removePath && removePath.oldPos + 1 < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath] = undefined;\n continue;\n }\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the old string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) {\n basePath = this.addToPath(addPath, true, false, 0, options);\n }\n else {\n basePath = this.addToPath(removePath, false, true, 1, options);\n }\n newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);\n if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // If we have hit the end of both strings, then we are done\n return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;\n }\n else {\n bestPath[diagonalPath] = basePath;\n if (basePath.oldPos + 1 >= oldLen) {\n maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);\n }\n if (newPos + 1 >= newLen) {\n minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);\n }\n }\n }\n editLength++;\n };\n // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced, or until the edit length exceeds options.maxEditLength (if given),\n // in which case it will return undefined.\n if (callback) {\n (function exec() {\n setTimeout(function () {\n if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {\n return callback(undefined);\n }\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n }());\n }\n else {\n while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {\n const ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n }\n }\n addToPath(path, added, removed, oldPosInc, options) {\n const last = path.lastComponent;\n if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent }\n };\n }\n else {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: 1, added: added, removed: removed, previousComponent: last }\n };\n }\n }\n extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {\n newPos++;\n oldPos++;\n commonCount++;\n if (options.oneChangePerToken) {\n basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n }\n if (commonCount && !options.oneChangePerToken) {\n basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n basePath.oldPos = oldPos;\n return newPos;\n }\n equals(left, right, options) {\n if (options.comparator) {\n return options.comparator(left, right);\n }\n else {\n return left === right\n || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase());\n }\n }\n removeEmpty(array) {\n const ret = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n castInput(value, options) {\n return value;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tokenize(value, options) {\n return Array.from(value);\n }\n join(chars) {\n // Assumes ValueT is string, which is the case for most subclasses.\n // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op)\n // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF\n // assume tokens and values are strings, but not completely - is weird and janky.\n return chars.join('');\n }\n postProcess(changeObjects, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options) {\n return changeObjects;\n }\n get useLongestToken() {\n return false;\n }\n buildValues(lastComponent, newTokens, oldTokens) {\n // First we convert our linked list of components in reverse order to an\n // array in the right order:\n const components = [];\n let nextComponent;\n while (lastComponent) {\n components.push(lastComponent);\n nextComponent = lastComponent.previousComponent;\n delete lastComponent.previousComponent;\n lastComponent = nextComponent;\n }\n components.reverse();\n const componentLen = components.length;\n let componentPos = 0, newPos = 0, oldPos = 0;\n for (; componentPos < componentLen; componentPos++) {\n const component = components[componentPos];\n if (!component.removed) {\n if (!component.added && this.useLongestToken) {\n let value = newTokens.slice(newPos, newPos + component.count);\n value = value.map(function (value, i) {\n const oldValue = oldTokens[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n component.value = this.join(value);\n }\n else {\n component.value = this.join(newTokens.slice(newPos, newPos + component.count));\n }\n newPos += component.count;\n // Common case\n if (!component.added) {\n oldPos += component.count;\n }\n }\n else {\n component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));\n oldPos += component.count;\n }\n }\n return components;\n }\n}\n"],"names":[],"mappings":"AAAe,MAAM,IAAI,CAAC;AAC1B,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM;AACvB;AACA,IAAI,OAAO,GAAG,EAAE,EAAE;AAClB,QAAQ,IAAI,QAAQ;AACpB,QAAQ,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAC3C,YAAY,QAAQ,GAAG,OAAO;AAC9B,YAAY,OAAO,GAAG,EAAE;AACxB,QAAQ;AACR,aAAa,IAAI,UAAU,IAAI,OAAO,EAAE;AACxC,YAAY,QAAQ,GAAG,OAAO,CAAC,QAAQ;AACvC,QAAQ;AACR;AACA,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AACzD,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AACzD,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAA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+
const characterDiff = new CharacterDiff();
|
|
6
|
+
function diffChars(oldStr, newStr, options) {
|
|
7
|
+
return characterDiff.diff(oldStr, newStr, options);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { characterDiff, diffChars };
|
|
11
|
+
//# sourceMappingURL=character.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character.js","sources":["../../../../../../../../../node_modules/.pnpm/diff@8.0.3/node_modules/diff/libesm/diff/character.js"],"sourcesContent":["import Diff from './base.js';\nclass CharacterDiff extends Diff {\n}\nexport const characterDiff = new CharacterDiff();\nexport function diffChars(oldStr, newStr, options) {\n return characterDiff.diff(oldStr, newStr, options);\n}\n"],"names":[],"mappings":";;AACA,MAAM,aAAa,SAAS,IAAI,CAAC;AACjC;AACY,MAAC,aAAa,GAAG,IAAI,aAAa;AACvC,SAAS,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;AACnD,IAAI,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACtD;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type IReqQueueInit = {
|
|
2
|
+
maxQueueLength?: number;
|
|
3
|
+
cacheMethod?: (v: Record<string, any>) => void;
|
|
4
|
+
};
|
|
5
|
+
declare class ReqQueue {
|
|
6
|
+
private static instance;
|
|
7
|
+
private static reqQueue;
|
|
8
|
+
private static maxQueueLength;
|
|
9
|
+
private static cacheMethod;
|
|
10
|
+
constructor(p: IReqQueueInit);
|
|
11
|
+
static init(p: IReqQueueInit): ReqQueue;
|
|
12
|
+
static getInstance(p: IReqQueueInit): ReqQueue;
|
|
13
|
+
/**
|
|
14
|
+
* 获取下日志队列
|
|
15
|
+
*/
|
|
16
|
+
static getReqQueue(): Record<string, any>;
|
|
17
|
+
/**
|
|
18
|
+
* 添加或者更新一条记录
|
|
19
|
+
* @param data
|
|
20
|
+
* @param key
|
|
21
|
+
*/
|
|
22
|
+
static addReqQueue(data: any, key?: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { ReqQueue as default };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export { codeMessage, defOption } from './httpCode/index.js';
|
|
1
2
|
import { IRequestOption, ICallBack } from './typings/index.js';
|
|
2
3
|
export { ICacheData } from './typings/index.js';
|
|
4
|
+
export { default as uniRequest } from './uniRequest/index.js';
|
|
5
|
+
export { default as ReqQueue } from './ReqQueue/index.js';
|
|
3
6
|
|
|
4
|
-
type
|
|
7
|
+
type IResponse = {
|
|
5
8
|
code: number;
|
|
6
9
|
msg: string;
|
|
7
10
|
message: string;
|
|
@@ -10,7 +13,7 @@ type IZlResponse = {
|
|
|
10
13
|
status: number;
|
|
11
14
|
statusText: string;
|
|
12
15
|
};
|
|
13
|
-
declare const binRequest: (url: string, option?: IRequestOption, errorHandler?: (error:
|
|
16
|
+
declare const binRequest: (url: string, option?: IRequestOption, errorHandler?: (error: IResponse, opt: IRequestOption) => void, callback?: ICallBack) => Promise<any>;
|
|
14
17
|
|
|
15
18
|
export { ICallBack, IRequestOption, binRequest as default };
|
|
16
|
-
export type {
|
|
19
|
+
export type { IResponse };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { codeMessage } from './httpCode/index.js';
|
|
2
|
-
|
|
2
|
+
export { defOption } from './httpCode/index.js';
|
|
3
|
+
export { default as uniRequest } from './uniRequest/index.js';
|
|
3
4
|
import ReqQueue from './ReqQueue/index.js';
|
|
5
|
+
import { getRequestUtils, requestErrorIntercept, generateFetchRequest, responseErrorIntercept } from './httpUtils/index.js';
|
|
4
6
|
import cryptoUtils from '../core/cryptoUtils/index.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -162,5 +164,5 @@ const binRequest = async (url, option = {}, errorHandler, callback) => {
|
|
|
162
164
|
}));
|
|
163
165
|
};
|
|
164
166
|
|
|
165
|
-
export { binRequest as default };
|
|
167
|
+
export { ReqQueue, codeMessage, binRequest as default };
|
|
166
168
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/request/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/request/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAUA;;;;;AAKG;AACH,MAAM,WAAW,GAAG,OAAO,QAAa,EAAE,GAAmB,KAAI;IAC/D,IAAI,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;;QAE/B,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IACnD;AACA,IAAA,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE;;AAEnD,QAAA,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO,EAAE;AAC1B,YAAA,OAAO,QAAQ,CAAC,IAAI,EAAE;QACxB;AACA,QAAA,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE;YACvB,OAAO,QAAQ,CAAC,IAAI;QACtB;AACA,QAAA,OAAO,QAAQ,CAAC,IAAI,EAAE;IACxB;;AAEA,IAAA,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;AAC9D,IAAA,MAAM,SAAS,GAAG;AAChB,QAAA,GAAG,EAAE,GAAG;AACR,QAAA,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI,EAAE,QAAQ,CAAC,MAAM;AACrB,QAAA,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;QACxC;KACD;AACD,IAAA,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,C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W,CAAC,EAAE,CAAC;AACpB,gBAAA,OAAO,EAAE,WAAW,CAAC,EAAE;aACxB;QACH;AACA,QAAA,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,OAAO,KAAK,iBAAiB,EAAE;AAChE,YAAA,CAAC,GAAG;AACF,gBAAA,GAAG,CAAC;AACJ,gBAAA,IAAI,EAAE,cAAc;AACpB,gBAAA,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC;AAChC,gBAAA,OAAO,EAAE,WAAW,CAAC,cAAc;aACpC;QACH;AACA,QAAA,IAAI,MAAM,CAAC,QAAQ,EAAE;;YAEnB,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;QACzC;QACA,IAAI,YAAY,EAAE;AAChB,YAAA,YAAY,CAAC,CAAC,EAAE,UAAU,CAAC;AAC3B,YAAA,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;AAC7B,gBAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YAC1B;AACA,YAAA,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE;QACpB;AACA,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC;AAER;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { IBaseFilter } from '../data/index.js';
|
|
2
|
+
|
|
3
|
+
interface ISysDistrict {
|
|
4
|
+
distId: string;
|
|
5
|
+
/**
|
|
6
|
+
* 编码
|
|
7
|
+
*/
|
|
8
|
+
code: string;
|
|
9
|
+
/**
|
|
10
|
+
* 父编码
|
|
11
|
+
*/
|
|
12
|
+
parentCode: string;
|
|
13
|
+
/**
|
|
14
|
+
* 节点类型
|
|
15
|
+
*/
|
|
16
|
+
nodeType: string;
|
|
17
|
+
/**
|
|
18
|
+
* 地区名称
|
|
19
|
+
*/
|
|
20
|
+
disName: string;
|
|
21
|
+
/**
|
|
22
|
+
* 地区编码
|
|
23
|
+
*/
|
|
24
|
+
areaCode: string;
|
|
25
|
+
/**
|
|
26
|
+
* 备注
|
|
27
|
+
*/
|
|
28
|
+
remark: string;
|
|
29
|
+
/**
|
|
30
|
+
* 地区类型
|
|
31
|
+
*/
|
|
32
|
+
disType: string;
|
|
33
|
+
/**
|
|
34
|
+
* 排序号
|
|
35
|
+
*/
|
|
36
|
+
sequenceNo: number;
|
|
37
|
+
/**
|
|
38
|
+
* 创建人
|
|
39
|
+
*/
|
|
40
|
+
createBy: string;
|
|
41
|
+
/**
|
|
42
|
+
* 创建时间
|
|
43
|
+
*/
|
|
44
|
+
createAt: number;
|
|
45
|
+
/**
|
|
46
|
+
* 拼音名称
|
|
47
|
+
*/
|
|
48
|
+
spellName: string;
|
|
49
|
+
/**
|
|
50
|
+
* 创建时间
|
|
51
|
+
*/
|
|
52
|
+
updateAt: number;
|
|
53
|
+
/**
|
|
54
|
+
* 更新人
|
|
55
|
+
*/
|
|
56
|
+
updateBy: string;
|
|
57
|
+
/**
|
|
58
|
+
* 其他属性
|
|
59
|
+
*/
|
|
60
|
+
otherProperty: string;
|
|
61
|
+
}
|
|
62
|
+
interface ISysDisFilter extends IBaseFilter {
|
|
63
|
+
parentCode?: string;
|
|
64
|
+
/**
|
|
65
|
+
* 地区类型
|
|
66
|
+
*/
|
|
67
|
+
disType?: string;
|
|
68
|
+
/**
|
|
69
|
+
* 其他属性
|
|
70
|
+
*/
|
|
71
|
+
otherProperty?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 搜索方式
|
|
74
|
+
*/
|
|
75
|
+
searchType?: 'all' | '';
|
|
76
|
+
/**
|
|
77
|
+
* 地区编码
|
|
78
|
+
*/
|
|
79
|
+
areaCode?: string;
|
|
80
|
+
areaCodes?: string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type { ISysDisFilter, ISysDistrict };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基本的自定义属性对象
|
|
3
|
+
*/
|
|
4
|
+
type IDefSysDefinedAttributes<T = any> = {
|
|
5
|
+
id: string;
|
|
6
|
+
attLabel: string;
|
|
7
|
+
attType: T;
|
|
8
|
+
attTypeText: string;
|
|
9
|
+
description: string;
|
|
10
|
+
weight: number;
|
|
11
|
+
/**
|
|
12
|
+
* 基本的自定义对象对象的默认值
|
|
13
|
+
*/
|
|
14
|
+
defaultValue?: any;
|
|
15
|
+
dicGroupKey?: string;
|
|
16
|
+
options?: {
|
|
17
|
+
value: any;
|
|
18
|
+
eum: any;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 数据库中的字段名
|
|
22
|
+
*/
|
|
23
|
+
dbKey: string;
|
|
24
|
+
resValue: any;
|
|
25
|
+
showSearch?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 表单的额外配置
|
|
28
|
+
*/
|
|
29
|
+
fieldProps: Record<string, any>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type { IDefSysDefinedAttributes };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { IOptions } from '../types/data/index.js';
|
|
2
|
+
import { BaseRule } from './rule.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 必填标记类型
|
|
6
|
+
* 用于控制表单项的必填显示方式
|
|
7
|
+
*/
|
|
8
|
+
declare type RequiredMark = boolean | "optional";
|
|
9
|
+
/**
|
|
10
|
+
* 工具提示属性接口
|
|
11
|
+
* 用于配置提示框的样式和行为
|
|
12
|
+
*/
|
|
13
|
+
interface TooltipProps {
|
|
14
|
+
/** 样式对象 */
|
|
15
|
+
style?: any;
|
|
16
|
+
/** CSS类名 */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** 背景颜色 */
|
|
19
|
+
color?: string;
|
|
20
|
+
/** 打开状态的CSS类名 */
|
|
21
|
+
openClassName?: string;
|
|
22
|
+
/** 箭头是否指向中心 */
|
|
23
|
+
arrowPointAtCenter?: boolean;
|
|
24
|
+
/** 是否自动调整溢出 */
|
|
25
|
+
autoAdjustOverflow?: boolean;
|
|
26
|
+
/** 获取弹出容器的函数 */
|
|
27
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
28
|
+
/** 子元素 */
|
|
29
|
+
children?: any;
|
|
30
|
+
/** 标题内容 */
|
|
31
|
+
title?: any;
|
|
32
|
+
/** 覆盖层内容 */
|
|
33
|
+
overlay?: any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 包装工具提示属性
|
|
37
|
+
* 在基础TooltipProps上增加图标配置
|
|
38
|
+
*/
|
|
39
|
+
declare type WrapperTooltipProps = TooltipProps & {
|
|
40
|
+
/** 图标元素 */
|
|
41
|
+
icon?: any;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 表单项标签属性接口
|
|
45
|
+
* 用于配置表单项的标签显示
|
|
46
|
+
*/
|
|
47
|
+
interface FormItemLabelProps {
|
|
48
|
+
/** 是否显示冒号 */
|
|
49
|
+
colon?: boolean;
|
|
50
|
+
/** HTML for属性 */
|
|
51
|
+
htmlFor?: string;
|
|
52
|
+
/** 标签内容 */
|
|
53
|
+
label?: any | string;
|
|
54
|
+
/** 必填标记配置 */
|
|
55
|
+
requiredMark?: RequiredMark;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 验证状态类型
|
|
59
|
+
* 表示字段的验证结果状态
|
|
60
|
+
*/
|
|
61
|
+
type ValidateStatus = "success" | "warning" | "error" | "validating" | "";
|
|
62
|
+
/**
|
|
63
|
+
* 文件上传配置接口
|
|
64
|
+
* 用于配置文件上传相关参数
|
|
65
|
+
*/
|
|
66
|
+
interface IUploadProps {
|
|
67
|
+
/** 上传组件引用 */
|
|
68
|
+
uploadRef?: any;
|
|
69
|
+
/**
|
|
70
|
+
* 业务场景枚举
|
|
71
|
+
* 用于区分不同的上传场景
|
|
72
|
+
*/
|
|
73
|
+
busiScene?: string;
|
|
74
|
+
/**
|
|
75
|
+
* 权限枚举
|
|
76
|
+
* 基于EPermissionEnum的权限控制
|
|
77
|
+
*/
|
|
78
|
+
permission?: string;
|
|
79
|
+
/** 文件大小限制,单位MB,默认10MB */
|
|
80
|
+
fileSize?: number;
|
|
81
|
+
/** 接受的文件类型 */
|
|
82
|
+
accept?: string;
|
|
83
|
+
/** 是否支持多文件上传 */
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 表单项属性接口
|
|
88
|
+
* 继承标签属性和上传属性,提供完整的表单项配置
|
|
89
|
+
*/
|
|
90
|
+
interface FormItemProps extends FormItemLabelProps, IUploadProps {
|
|
91
|
+
/** 样式前缀 */
|
|
92
|
+
prefixCls?: string;
|
|
93
|
+
/** 是否无样式模式 */
|
|
94
|
+
noStyle?: boolean;
|
|
95
|
+
/** 内联样式 */
|
|
96
|
+
style?: any;
|
|
97
|
+
/** CSS类名 */
|
|
98
|
+
className?: string;
|
|
99
|
+
/** 子元素 */
|
|
100
|
+
children?: any;
|
|
101
|
+
/** 元素ID */
|
|
102
|
+
id?: string;
|
|
103
|
+
/** 是否有反馈效果 */
|
|
104
|
+
hasFeedback?: boolean;
|
|
105
|
+
/** 验证状态 */
|
|
106
|
+
validateStatus?: ValidateStatus;
|
|
107
|
+
/** 是否必填 */
|
|
108
|
+
required?: boolean;
|
|
109
|
+
/** 是否隐藏 */
|
|
110
|
+
hidden?: boolean;
|
|
111
|
+
/** 初始值 */
|
|
112
|
+
initialValue?: any;
|
|
113
|
+
/** 消息变量映射 */
|
|
114
|
+
messageVariables?: Record<string, string>;
|
|
115
|
+
/** 工具提示内容 */
|
|
116
|
+
tooltip?: any;
|
|
117
|
+
/** 字段键值 */
|
|
118
|
+
fieldKey?: (string | number | bigint) | (string | number | bigint)[];
|
|
119
|
+
/**
|
|
120
|
+
* 级联选择最少选择层级
|
|
121
|
+
* 如果不设置,则需要选择到最底层
|
|
122
|
+
*/
|
|
123
|
+
minLevel?: number;
|
|
124
|
+
/**
|
|
125
|
+
* 点击事件回调
|
|
126
|
+
*/
|
|
127
|
+
onPress?: () => void;
|
|
128
|
+
/**
|
|
129
|
+
* 可上传的文件数量限制
|
|
130
|
+
*/
|
|
131
|
+
maxNum?: number;
|
|
132
|
+
/** 验证规则数组 */
|
|
133
|
+
rules?: BaseRule[];
|
|
134
|
+
/**
|
|
135
|
+
* 值格式化函数
|
|
136
|
+
* 用于显示时格式化值
|
|
137
|
+
*/
|
|
138
|
+
format?: (value: any) => string;
|
|
139
|
+
/**
|
|
140
|
+
* 货币符号
|
|
141
|
+
* 用于金额类型字段
|
|
142
|
+
*/
|
|
143
|
+
moneySymbol?: string;
|
|
144
|
+
/**
|
|
145
|
+
* 选项数组
|
|
146
|
+
* 用于选择类型字段
|
|
147
|
+
*/
|
|
148
|
+
options?: IOptions<any>[];
|
|
149
|
+
/**
|
|
150
|
+
* 点击事件
|
|
151
|
+
*/
|
|
152
|
+
onClick?: () => void;
|
|
153
|
+
/**
|
|
154
|
+
* 禁用
|
|
155
|
+
*/
|
|
156
|
+
disabled?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* 占位
|
|
159
|
+
*/
|
|
160
|
+
placeholder?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type { FormItemLabelProps, FormItemProps, IUploadProps, RequiredMark, TooltipProps, ValidateStatus, WrapperTooltipProps };
|
package/dist/form/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export { FieldData, FieldError, FilterFunc, FormFieldType, FormInstance,
|
|
1
|
+
export { FieldData, FieldError, FilterFunc, FormFieldType, FormInstance, GetFieldsValueConfig, IAhCascaderProps, IAhFormColumns, IAhFormItemProps, IDependent, IEnumObj, IEnumObjAll, IFormColumns, IJsonRuleItem, IJsonRuleListItem, ISizeType, IValueType, InternalFieldData, InternalNamePath, Meta, NamePath, ProFieldValueType, ProFieldValueTypeWithFieldProps, ProFormInstance, ProFormInstanceType, ProSchemaValueEnumMap, ProSchemaValueEnumObj, ProSchemaValueEnumType, RcFormInstance, ValidateFields, ValidateOptions } from './types.js';
|
|
2
|
+
export { IDefSysDefinedAttributes } from './attributes.js';
|
|
3
|
+
export { FormItemLabelProps, FormItemProps, IUploadProps, RequiredMark, TooltipProps, ValidateStatus, WrapperTooltipProps } from './formItem.js';
|
|
4
|
+
export { BaseRule, RuleType } from './rule.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 验证规则类型枚举
|
|
3
|
+
* 定义了支持的数据类型验证
|
|
4
|
+
*/
|
|
5
|
+
type RuleType = "string" | "number" | "boolean" | "method" | "regexp" | "integer" | "float" | "object" | "enum" | "date" | "url" | "hex" | "email";
|
|
6
|
+
/**
|
|
7
|
+
* 基础验证规则接口
|
|
8
|
+
* 定义字段验证的各种规则配置
|
|
9
|
+
*/
|
|
10
|
+
interface BaseRule {
|
|
11
|
+
/** 是否仅警告,不阻止提交 */
|
|
12
|
+
warningOnly?: boolean;
|
|
13
|
+
/** 枚举值数组 */
|
|
14
|
+
enum?: any[];
|
|
15
|
+
/** 精确长度 */
|
|
16
|
+
len?: number;
|
|
17
|
+
/** 最大值/长度 */
|
|
18
|
+
max?: number;
|
|
19
|
+
/** 错误消息 */
|
|
20
|
+
message?: string | any;
|
|
21
|
+
/** 最小值/长度 */
|
|
22
|
+
min?: number;
|
|
23
|
+
/** 正则表达式模式 */
|
|
24
|
+
pattern?: RegExp;
|
|
25
|
+
/** 是否必填 */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** 值转换函数 */
|
|
28
|
+
transform?: (value: any) => any;
|
|
29
|
+
/** 验证类型 */
|
|
30
|
+
type?: RuleType;
|
|
31
|
+
/** 是否检查空白字符 */
|
|
32
|
+
whitespace?: boolean;
|
|
33
|
+
/** 自定义验证触发时机,必须是字段validateTrigger的子集 */
|
|
34
|
+
validateTrigger?: string | string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type { BaseRule, RuleType };
|