@unicom-cloud/utils 0.1.31 → 0.1.33
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/case-name/index.js +1 -1
- package/caseName.js +1 -1
- package/class-name/index.js +6 -5
- package/className.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/clipboardCopy.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/emoji.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/isMobile.js +7 -0
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +18 -17
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/constant.js +1 -1
- package/content-disposition/index.js +1 -1
- package/contentDisposition.js +1 -1
- package/cookie/index.js +1 -1
- package/cookie/src/api.js +1 -1
- package/cookie/src/assign.js +1 -1
- package/cookie/src/converter.js +1 -1
- package/cookie.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +5 -5
- package/date.js +5 -5
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/decimal.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +46 -0
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +87 -84
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +2 -2
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/domHelpers.js +65 -63
- package/emitter/index.js +1 -1
- package/emitter/src/index.js +1 -1
- package/emitter.js +1 -1
- package/escape/index.js +11 -0
- package/escape.js +6 -0
- package/file/fileToURL.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/file.js +1 -1
- package/idb/index.js +1 -1
- package/idb.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/invariant.js +1 -1
- package/is/index.js +196 -141
- package/is/lib/isAscii.js +9 -0
- package/is/lib/isBase64.js +13 -0
- package/is/lib/isChinese.js +19 -0
- package/is/lib/isDataURI.js +25 -0
- package/is/lib/isEmail.js +72 -0
- package/is/lib/isFQDN.js +21 -0
- package/is/lib/isFullWidth.js +10 -0
- package/is/lib/isHSL.js +11 -0
- package/is/lib/isHalfWidth.js +10 -0
- package/is/lib/isHash.js +23 -0
- package/is/lib/isHexColor.js +12 -0
- package/is/lib/isIMEI.js +19 -0
- package/is/lib/isIP.js +21 -0
- package/is/lib/isIPRange.js +25 -0
- package/is/lib/isIdentityCard.js +190 -0
- package/is/lib/isJWT.js +14 -0
- package/is/lib/isMACAddress.js +9 -0
- package/is/lib/isMD5.js +9 -0
- package/is/lib/isMimeType.js +9 -0
- package/is/lib/isMobilePhone.js +192 -0
- package/is/lib/isPort.js +7 -0
- package/is/lib/isRgbColor.js +18 -0
- package/is/lib/isSemVer.js +20 -0
- package/is/lib/isSlug.js +9 -0
- package/is/lib/isStrongPassword.js +48 -0
- package/is/lib/isURL.js +78 -0
- package/is/lib/isUUID.js +24 -0
- package/is/lib/isVariableWidth.js +10 -0
- package/is/lib/util/assertString.js +12 -0
- package/is.js +122 -66
- package/lunar/index.js +1 -1
- package/lunar/lib/Holiday.js +1 -1
- package/lunar/lib/HolidayUtil.js +1 -1
- package/lunar/lib/I18n.js +1 -1
- package/lunar/lib/JieQi.js +1 -1
- package/lunar/lib/Lunar.js +1 -1
- package/lunar/lib/LunarMonth.js +1 -1
- package/lunar/lib/LunarTime.js +1 -1
- package/lunar/lib/LunarUtil.js +1 -1
- package/lunar/lib/LunarYear.js +1 -1
- package/lunar/lib/ShouXingUtil.js +1 -1
- package/lunar/lib/Solar.js +1 -1
- package/lunar/lib/SolarHalfYear.js +1 -1
- package/lunar/lib/SolarMonth.js +1 -1
- package/lunar/lib/SolarSeason.js +1 -1
- package/lunar/lib/SolarUtil.js +1 -1
- package/lunar/lib/SolarWeek.js +1 -1
- package/lunar/lib/SolarYear.js +1 -1
- package/lunar/lib/index.js +1 -1
- package/lunar.js +1 -1
- package/math/index.js +1 -1
- package/math.js +1 -1
- package/md5/index.js +1 -1
- package/md5.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/mock.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/normalizeWheel.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/numberToChinese.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/nzh.js +1 -1
- package/object-keys-sort/index.js +1 -1
- package/object-prototype-to-string-call/index.js +2 -2
- package/objectKeysSort.js +1 -1
- package/objectPrototypeToStringCall.js +1 -1
- package/package.json +1 -1
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/src/core.js +1 -1
- package/pinyin/src/simplified.js +6 -6
- package/pinyin/src/simplified_dict.js +5 -4
- package/pinyin/src/traditional.js +4 -4
- package/pinyin/src/traditional_dict.js +4 -3
- package/pinyin/traditional.js +1 -1
- package/pinyin.js +1 -1
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/queryString.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/random.js +1 -1
- package/screenfull/index.js +1 -1
- package/screenfull.js +1 -1
- package/sleep/index.js +1 -1
- package/sleep.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +198 -153
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +121 -326
- package/snapdom/src/core/clone.js +117 -266
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +48 -157
- package/snapdom/src/exporters/download.js +15 -11
- package/snapdom/src/exporters/toBlob.js +10 -15
- package/snapdom/src/exporters/toCanvas.js +72 -65
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +118 -112
- package/snapdom/src/modules/iconFonts.js +133 -69
- package/snapdom/src/modules/images.js +36 -33
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pseudo.js +275 -161
- package/snapdom/src/modules/rasterize.js +6 -7
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +89 -67
- package/snapdom/src/modules/svgDefs.js +73 -60
- package/snapdom/src/utils/browser.js +13 -8
- package/snapdom/src/utils/capture.helpers.js +131 -0
- package/snapdom/src/utils/clone.helpers.js +283 -0
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +15 -24
- package/snapdom/src/utils/prepare.helpers.js +8 -0
- package/snapdom/src/utils/transforms.helpers.js +211 -0
- package/snapdom.js +1 -1
- package/string/index.js +1 -1
- package/string.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/src/conversion.js +1 -1
- package/tinycolor/src/css-color-names.js +1 -1
- package/tinycolor/src/format-input.js +1 -1
- package/tinycolor/src/from-ratio.js +12 -11
- package/tinycolor/src/index.js +1 -1
- package/tinycolor/src/random.js +30 -29
- package/tinycolor/src/readability.js +1 -1
- package/tinycolor/src/to-ms-filter.js +1 -1
- package/tinycolor/src/utils.js +1 -1
- package/tinycolor.js +1 -1
- package/tree/index.js +54 -75
- package/tree/search/index.js +1 -1
- package/tree.js +9 -11
- package/tween/index.js +1 -1
- package/tween/src/easing.js +1 -1
- package/tween/src/tween.js +15 -14
- package/tween.js +1 -1
- package/types/constant/isMobile.d.ts +3 -0
- package/types/date/index.d.ts +3 -3
- package/types/dom-helpers/getElementCoordinates.d.ts +40 -0
- package/types/dom-helpers/index.d.ts +3 -1
- package/types/escape/index.d.ts +2 -0
- package/types/is/index.d.ts +28 -1
- package/types/is/lib/isAscii.d.ts +1 -0
- package/types/is/lib/isBase64.d.ts +1 -0
- package/types/is/lib/isChinese.d.ts +4 -0
- package/types/is/lib/isDataURI.d.ts +1 -0
- package/types/is/lib/isEmail.d.ts +1 -0
- package/types/is/lib/isFQDN.d.ts +1 -0
- package/types/is/lib/isFullWidth.d.ts +2 -0
- package/types/is/lib/isHSL.d.ts +1 -0
- package/types/is/lib/isHalfWidth.d.ts +2 -0
- package/types/is/lib/isHash.d.ts +1 -0
- package/types/is/lib/isHexColor.d.ts +1 -0
- package/types/is/lib/isIMEI.d.ts +1 -0
- package/types/is/lib/isIP.d.ts +1 -0
- package/types/is/lib/isIPRange.d.ts +1 -0
- package/types/is/lib/isIdentityCard.d.ts +1 -0
- package/types/is/lib/isJWT.d.ts +1 -0
- package/types/is/lib/isMACAddress.d.ts +1 -0
- package/types/is/lib/isMD5.d.ts +1 -0
- package/types/is/lib/isMimeType.d.ts +1 -0
- package/types/is/lib/isMobilePhone.d.ts +2 -0
- package/types/is/lib/isOctal.d.ts +1 -0
- package/types/is/lib/isPort.d.ts +1 -0
- package/types/is/lib/isRgbColor.d.ts +1 -0
- package/types/is/lib/isSemVer.d.ts +1 -0
- package/types/is/lib/isSlug.d.ts +1 -0
- package/types/is/lib/isStrongPassword.d.ts +1 -0
- package/types/is/lib/isURL.d.ts +1 -0
- package/types/is/lib/isUUID.d.ts +1 -0
- package/types/is/lib/isVariableWidth.d.ts +1 -0
- package/types/is/lib/util/assertString.d.ts +1 -0
- package/types/pinyin/es/main.d.ts +4 -0
- package/types/pinyin/es/traditional.d.ts +4 -0
- package/types/snapdom/src/api/snapdom.d.ts +11 -79
- package/types/snapdom/src/exporters/toCanvas.d.ts +11 -3
- package/types/snapdom/src/exporters/toJpg.d.ts +1 -0
- package/types/snapdom/src/exporters/toPng.d.ts +6 -0
- package/types/snapdom/src/exporters/toSvg.d.ts +1 -0
- package/types/snapdom/src/exporters/toWebp.d.ts +1 -0
- package/types/snapdom/src/modules/iconFonts.d.ts +7 -20
- package/types/snapdom/src/modules/pseudo.d.ts +18 -0
- package/types/snapdom/src/modules/rasterize.d.ts +6 -10
- package/types/snapdom/src/utils/browser.d.ts +0 -3
- package/types/snapdom/src/utils/capture.helpers.d.ts +45 -0
- package/types/snapdom/src/utils/clone.helpers.d.ts +97 -0
- package/types/snapdom/src/utils/image.d.ts +0 -8
- package/types/snapdom/src/utils/index.d.ts +1 -1
- package/types/snapdom/src/utils/prepare.helpers.d.ts +9 -0
- package/types/snapdom/src/utils/transforms.helpers.d.ts +118 -0
- package/types/tree/index.d.ts +3 -4
- package/types/validate/src/index.d.ts +23 -25
- package/types/validate/src/interface.d.ts +5 -3
- package/types/validate/src/locale/en-US.d.ts +12 -2
- package/types/validate/src/locale/index.d.ts +171 -0
- package/types/validate/src/locale/zh-CN.d.ts +12 -2
- package/types/validate/src/rules/base.d.ts +3 -1
- package/types/validate/src/rules/custom.d.ts +1 -1
- package/types/validate/src/rules/type.d.ts +10 -0
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +8 -7
- package/uiColor.js +25 -24
- package/url-toolkit/index.js +1 -1
- package/url-toolkit/src/url-toolkit.js +1 -1
- package/urlToolkit.js +1 -1
- package/validate/index.js +23 -25
- package/validate/src/index.js +116 -73
- package/validate/src/locale/en-US.js +12 -2
- package/validate/src/locale/index.js +11 -0
- package/validate/src/locale/zh-CN.js +12 -2
- package/validate/src/rules/array.js +2 -2
- package/validate/src/rules/base.js +35 -31
- package/validate/src/rules/boolean.js +1 -1
- package/validate/src/rules/custom.js +2 -2
- package/validate/src/rules/number.js +1 -1
- package/validate/src/rules/object.js +1 -1
- package/validate/src/rules/string.js +6 -5
- package/validate/src/rules/type.js +84 -14
- package/validate.js +23 -25
- package/version/index.js +1 -1
- package/version.js +1 -1
- package/xlsx/index.d.ts +4 -8
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +2 -2
- package/xlsx.js +1 -1
- package/types/validate/src/message.d.ts +0 -2
- package/types/validate/src/utils.d.ts +0 -3
- package/validate/src/message.js +0 -5
- package/validate/src/utils.js +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type ValidateMessagesTemplateType = typeof
|
|
1
|
+
import locale from './locale';
|
|
2
|
+
export type ValidateMessagesTemplateType = typeof locale.default;
|
|
3
3
|
export type ValidateMessagesType = Partial<{
|
|
4
4
|
[key in keyof ValidateMessagesTemplateType]: ValidateMessagesTemplateType[key] extends string ? ValidateMessagesTemplateType[key] : Record<keyof ValidateMessagesTemplateType[key], string | ((info: any) => unknown)>;
|
|
5
5
|
}>;
|
|
6
|
-
export type RuleType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'url' | 'email' | 'ip' | 'type' | 'custom';
|
|
6
|
+
export type RuleType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'url' | 'email' | 'ip' | 'strongPassword' | 'port' | 'mac' | 'identity' | 'phone' | 'semver' | 'ascii' | 'halfWidth' | 'fullWidth' | 'chinese' | 'type' | 'custom';
|
|
7
7
|
export type GlobalConfig = Pick<ValidateOptions, 'strict' | 'trim' | 'ignoreEmptyString' | 'validateMessages'>;
|
|
8
8
|
export type ValidateOptions = {
|
|
9
9
|
strict?: boolean;
|
|
@@ -12,9 +12,11 @@ export type ValidateOptions = {
|
|
|
12
12
|
message?: unknown;
|
|
13
13
|
type?: RuleType;
|
|
14
14
|
validateMessages?: ValidateMessagesType;
|
|
15
|
+
locale?: string;
|
|
15
16
|
};
|
|
16
17
|
export type InnerValidateOptions = ValidateOptions & {
|
|
17
18
|
field?: string;
|
|
19
|
+
label?: string;
|
|
18
20
|
};
|
|
19
21
|
export type CustomValidatorType = (value: unknown, callback: (message?: unknown) => void) => Promise<void> | void;
|
|
20
22
|
export type SchemaRuleType = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const en_US: {
|
|
2
2
|
required: string;
|
|
3
3
|
type: {
|
|
4
4
|
ip: string;
|
|
5
|
+
port: string;
|
|
6
|
+
mac: string;
|
|
5
7
|
email: string;
|
|
6
8
|
url: string;
|
|
7
9
|
string: string;
|
|
@@ -9,6 +11,14 @@ declare const enUS: {
|
|
|
9
11
|
array: string;
|
|
10
12
|
object: string;
|
|
11
13
|
boolean: string;
|
|
14
|
+
strongPassword: string;
|
|
15
|
+
identity: string;
|
|
16
|
+
phone: string;
|
|
17
|
+
semver: string;
|
|
18
|
+
ascii: string;
|
|
19
|
+
halfWidth: string;
|
|
20
|
+
fullWidth: string;
|
|
21
|
+
chinese: string;
|
|
12
22
|
};
|
|
13
23
|
number: {
|
|
14
24
|
min: string;
|
|
@@ -44,4 +54,4 @@ declare const enUS: {
|
|
|
44
54
|
false: string;
|
|
45
55
|
};
|
|
46
56
|
};
|
|
47
|
-
export default
|
|
57
|
+
export default en_US;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
declare const locale: {
|
|
2
|
+
en_US: {
|
|
3
|
+
required: string;
|
|
4
|
+
type: {
|
|
5
|
+
ip: string;
|
|
6
|
+
port: string;
|
|
7
|
+
mac: string;
|
|
8
|
+
email: string;
|
|
9
|
+
url: string;
|
|
10
|
+
string: string;
|
|
11
|
+
number: string;
|
|
12
|
+
array: string;
|
|
13
|
+
object: string;
|
|
14
|
+
boolean: string;
|
|
15
|
+
strongPassword: string;
|
|
16
|
+
identity: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
semver: string;
|
|
19
|
+
ascii: string;
|
|
20
|
+
halfWidth: string;
|
|
21
|
+
fullWidth: string;
|
|
22
|
+
chinese: string;
|
|
23
|
+
};
|
|
24
|
+
number: {
|
|
25
|
+
min: string;
|
|
26
|
+
max: string;
|
|
27
|
+
equal: string;
|
|
28
|
+
range: string;
|
|
29
|
+
positive: string;
|
|
30
|
+
negative: string;
|
|
31
|
+
};
|
|
32
|
+
string: {
|
|
33
|
+
maxLength: string;
|
|
34
|
+
minLength: string;
|
|
35
|
+
length: string;
|
|
36
|
+
match: string;
|
|
37
|
+
uppercase: string;
|
|
38
|
+
lowercase: string;
|
|
39
|
+
};
|
|
40
|
+
array: {
|
|
41
|
+
length: string;
|
|
42
|
+
minLength: string;
|
|
43
|
+
maxLength: string;
|
|
44
|
+
includes: string;
|
|
45
|
+
deepEqual: string;
|
|
46
|
+
empty: string;
|
|
47
|
+
};
|
|
48
|
+
object: {
|
|
49
|
+
deepEqual: string;
|
|
50
|
+
hasKeys: string;
|
|
51
|
+
empty: string;
|
|
52
|
+
};
|
|
53
|
+
boolean: {
|
|
54
|
+
true: string;
|
|
55
|
+
false: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
zh_CN: {
|
|
59
|
+
required: string;
|
|
60
|
+
type: {
|
|
61
|
+
string: string;
|
|
62
|
+
number: string;
|
|
63
|
+
boolean: string;
|
|
64
|
+
array: string;
|
|
65
|
+
object: string;
|
|
66
|
+
url: string;
|
|
67
|
+
email: string;
|
|
68
|
+
ip: string;
|
|
69
|
+
port: string;
|
|
70
|
+
mac: string;
|
|
71
|
+
identity: string;
|
|
72
|
+
phone: string;
|
|
73
|
+
strongPassword: string;
|
|
74
|
+
semver: string;
|
|
75
|
+
ascii: string;
|
|
76
|
+
halfWidth: string;
|
|
77
|
+
fullWidth: string;
|
|
78
|
+
chinese: string;
|
|
79
|
+
};
|
|
80
|
+
number: {
|
|
81
|
+
min: string;
|
|
82
|
+
max: string;
|
|
83
|
+
equal: string;
|
|
84
|
+
range: string;
|
|
85
|
+
positive: string;
|
|
86
|
+
negative: string;
|
|
87
|
+
};
|
|
88
|
+
array: {
|
|
89
|
+
length: string;
|
|
90
|
+
minLength: string;
|
|
91
|
+
maxLength: string;
|
|
92
|
+
includes: string;
|
|
93
|
+
deepEqual: string;
|
|
94
|
+
empty: string;
|
|
95
|
+
};
|
|
96
|
+
string: {
|
|
97
|
+
minLength: string;
|
|
98
|
+
maxLength: string;
|
|
99
|
+
length: string;
|
|
100
|
+
match: string;
|
|
101
|
+
uppercase: string;
|
|
102
|
+
lowercase: string;
|
|
103
|
+
};
|
|
104
|
+
object: {
|
|
105
|
+
deepEqual: string;
|
|
106
|
+
hasKeys: string;
|
|
107
|
+
empty: string;
|
|
108
|
+
};
|
|
109
|
+
boolean: {
|
|
110
|
+
true: string;
|
|
111
|
+
false: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
default: {
|
|
115
|
+
required: string;
|
|
116
|
+
type: {
|
|
117
|
+
string: string;
|
|
118
|
+
number: string;
|
|
119
|
+
boolean: string;
|
|
120
|
+
array: string;
|
|
121
|
+
object: string;
|
|
122
|
+
url: string;
|
|
123
|
+
email: string;
|
|
124
|
+
ip: string;
|
|
125
|
+
port: string;
|
|
126
|
+
mac: string;
|
|
127
|
+
identity: string;
|
|
128
|
+
phone: string;
|
|
129
|
+
strongPassword: string;
|
|
130
|
+
semver: string;
|
|
131
|
+
ascii: string;
|
|
132
|
+
halfWidth: string;
|
|
133
|
+
fullWidth: string;
|
|
134
|
+
chinese: string;
|
|
135
|
+
};
|
|
136
|
+
number: {
|
|
137
|
+
min: string;
|
|
138
|
+
max: string;
|
|
139
|
+
equal: string;
|
|
140
|
+
range: string;
|
|
141
|
+
positive: string;
|
|
142
|
+
negative: string;
|
|
143
|
+
};
|
|
144
|
+
array: {
|
|
145
|
+
length: string;
|
|
146
|
+
minLength: string;
|
|
147
|
+
maxLength: string;
|
|
148
|
+
includes: string;
|
|
149
|
+
deepEqual: string;
|
|
150
|
+
empty: string;
|
|
151
|
+
};
|
|
152
|
+
string: {
|
|
153
|
+
minLength: string;
|
|
154
|
+
maxLength: string;
|
|
155
|
+
length: string;
|
|
156
|
+
match: string;
|
|
157
|
+
uppercase: string;
|
|
158
|
+
lowercase: string;
|
|
159
|
+
};
|
|
160
|
+
object: {
|
|
161
|
+
deepEqual: string;
|
|
162
|
+
hasKeys: string;
|
|
163
|
+
empty: string;
|
|
164
|
+
};
|
|
165
|
+
boolean: {
|
|
166
|
+
true: string;
|
|
167
|
+
false: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
export default locale;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const zh_CN: {
|
|
2
2
|
required: string;
|
|
3
3
|
type: {
|
|
4
4
|
string: string;
|
|
@@ -9,6 +9,16 @@ declare const zhCN: {
|
|
|
9
9
|
url: string;
|
|
10
10
|
email: string;
|
|
11
11
|
ip: string;
|
|
12
|
+
port: string;
|
|
13
|
+
mac: string;
|
|
14
|
+
identity: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
strongPassword: string;
|
|
17
|
+
semver: string;
|
|
18
|
+
ascii: string;
|
|
19
|
+
halfWidth: string;
|
|
20
|
+
fullWidth: string;
|
|
21
|
+
chinese: string;
|
|
12
22
|
};
|
|
13
23
|
number: {
|
|
14
24
|
min: string;
|
|
@@ -44,4 +54,4 @@ declare const zhCN: {
|
|
|
44
54
|
false: string;
|
|
45
55
|
};
|
|
46
56
|
};
|
|
47
|
-
export default
|
|
57
|
+
export default zh_CN;
|
|
@@ -10,9 +10,11 @@ declare abstract class Base {
|
|
|
10
10
|
message: ValidateOptions['message'];
|
|
11
11
|
type: ValidateOptions['type'];
|
|
12
12
|
error: null | ValidatorError;
|
|
13
|
-
|
|
13
|
+
not_?: boolean;
|
|
14
14
|
validateMessages: ValidateMessagesTemplateType;
|
|
15
|
+
label?: string;
|
|
15
16
|
field?: string;
|
|
17
|
+
locale?: string;
|
|
16
18
|
constructor(object: unknown, options: InnerValidateOptions);
|
|
17
19
|
get not(): this;
|
|
18
20
|
get isRequired(): this;
|
|
@@ -2,6 +2,6 @@ import { CustomValidatorType, InnerValidateOptions, ValidatorError } from './../
|
|
|
2
2
|
import Base from './base';
|
|
3
3
|
declare class CustomValidator extends Base {
|
|
4
4
|
constructor(object: unknown, options: InnerValidateOptions);
|
|
5
|
-
|
|
5
|
+
validate2(validator: CustomValidatorType, callback?: (message?: ValidatorError | null) => void): ValidatorError | (Promise<void> | this)[] | null | undefined;
|
|
6
6
|
}
|
|
7
7
|
export default CustomValidator;
|
|
@@ -5,5 +5,15 @@ declare class TypeValidator extends Base {
|
|
|
5
5
|
get email(): this;
|
|
6
6
|
get url(): this;
|
|
7
7
|
get ip(): this;
|
|
8
|
+
get port(): this;
|
|
9
|
+
get strongPassword(): this;
|
|
10
|
+
get mac(): this;
|
|
11
|
+
get identity(): this;
|
|
12
|
+
get phone(): this;
|
|
13
|
+
get semver(): this;
|
|
14
|
+
get ascii(): this;
|
|
15
|
+
get halfWidth(): this;
|
|
16
|
+
get fullWidth(): this;
|
|
17
|
+
get chinese(): this;
|
|
8
18
|
}
|
|
9
19
|
export default TypeValidator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
2
|
function i(r = [34797, 15747172]) {
|
|
3
3
|
return (n = 1) => {
|
|
4
4
|
const o = r, t = Math.log(256) / Math.log(2), e = o[0] >>> t * 2 & 255, g = o[0] >>> t * 1 & 255, l = o[0] >>> t * 0 & 255, c = o[1] >>> t * 2 & 255, s = o[1] >>> t * 1 & 255, f = o[1] >>> t * 0 & 255, a = c - (c - e) * n, b = s - (s - g) * n, h = f - (f - l) * n;
|
package/ui-color/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import "lodash/isUndefined.js";
|
|
2
3
|
import { TinyColor as e } from "../tinycolor/src/index.js";
|
|
3
|
-
import { default as
|
|
4
|
+
import { default as U } from "./compareColorByRange.js";
|
|
4
5
|
const c = 10, f = {
|
|
5
6
|
name: { zh: "浪漫红", en: "red" },
|
|
6
7
|
value: "#F53F3F"
|
|
@@ -85,7 +86,7 @@ const c = 10, f = {
|
|
|
85
86
|
new e("#E4E6E8"),
|
|
86
87
|
new e("#E8EBEE")
|
|
87
88
|
]
|
|
88
|
-
},
|
|
89
|
+
}, j = I.map((n, l, h) => {
|
|
89
90
|
const t = n.name, a = t?.en ?? t?.zh ?? t, r = n.value;
|
|
90
91
|
return {
|
|
91
92
|
key: a,
|
|
@@ -129,7 +130,7 @@ function Y(n = {}) {
|
|
|
129
130
|
});
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
|
-
const
|
|
133
|
+
const q = {
|
|
133
134
|
primary: { label: "主色", key: "primary" },
|
|
134
135
|
success: { label: "成功色", key: "green" },
|
|
135
136
|
warning: { label: "警示色", key: "orange" },
|
|
@@ -137,11 +138,11 @@ const j = {
|
|
|
137
138
|
};
|
|
138
139
|
export {
|
|
139
140
|
c as LENGTH,
|
|
140
|
-
|
|
141
|
+
q as PRIMARY_COLOR_KEY_MAPPING,
|
|
141
142
|
x as blue,
|
|
142
|
-
|
|
143
|
+
j as colorPresets,
|
|
143
144
|
I as colors,
|
|
144
|
-
|
|
145
|
+
U as compareColorByRange,
|
|
145
146
|
P as cyan,
|
|
146
147
|
T as generate,
|
|
147
148
|
Y as generateDark,
|
package/uiColor.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import "lodash/isUndefined.js";
|
|
2
3
|
import "./tinycolor/src/index.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { LENGTH as
|
|
4
|
+
import { default as t } from "./ui-color/compareColorByRange.js";
|
|
5
|
+
import { LENGTH as p, PRIMARY_COLOR_KEY_MAPPING as g, blue as n, colorPresets as m, colors as s, cyan as y, generate as i, generateDark as P, gold as c, gray as d, grayPresets as u, green as R, lime as f, magenta as k, orange as _, orangered as x, palette as A, paletteDark as C, pinkpurple as D, primary as E, purple as G, red as I, yellow as L } from "./ui-color/index.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
p as LENGTH,
|
|
8
|
+
g as PRIMARY_COLOR_KEY_MAPPING,
|
|
9
|
+
n as blue,
|
|
10
|
+
m as colorPresets,
|
|
11
|
+
s as colors,
|
|
12
|
+
t as compareColorByRange,
|
|
13
|
+
y as cyan,
|
|
14
|
+
i as generate,
|
|
14
15
|
P as generateDark,
|
|
15
16
|
c as gold,
|
|
16
17
|
d as gray,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
u as grayPresets,
|
|
19
|
+
R as green,
|
|
20
|
+
f as lime,
|
|
21
|
+
k as magenta,
|
|
22
|
+
_ as orange,
|
|
23
|
+
x as orangered,
|
|
24
|
+
A as palette,
|
|
25
|
+
C as paletteDark,
|
|
26
|
+
D as pinkpurple,
|
|
27
|
+
E as primary,
|
|
28
|
+
G as purple,
|
|
29
|
+
I as red,
|
|
30
|
+
L as yellow
|
|
30
31
|
};
|
package/url-toolkit/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
2
|
const l = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^/?#]*)?))\2(?=((?:(?:[^?#/]*\/)*[^;?#/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/, p = /^(?=([^/?#]*))\1([^]*)$/, f = /(?:\/|^)\.(?=\/)/g, m = /(?:\/|^)\.\.\/(?!\.\.\/)[^/]*(?=\/)/g;
|
|
3
3
|
function E(r, a, s) {
|
|
4
4
|
if (s = s || {}, r = r.trim(), a = a.trim(), !a) {
|
package/urlToolkit.js
CHANGED
package/validate/index.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
/* 2025-
|
|
2
|
-
import {
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as u } from "./src/rules/
|
|
6
|
-
import { default as p
|
|
7
|
-
import { default as
|
|
1
|
+
/* 2025-12-17 18:26:57 */
|
|
2
|
+
import { PqbValidator as r, Validator as t, ValidatorSchema as e, Validator as l } from "./src/index.js";
|
|
3
|
+
import { default as f } from "./src/rules/array.js";
|
|
4
|
+
import { default as m } from "./src/rules/base.js";
|
|
5
|
+
import { default as u } from "./src/rules/boolean.js";
|
|
6
|
+
import { default as p } from "./src/rules/custom.js";
|
|
7
|
+
import { default as b } from "./src/locale/index.js";
|
|
8
8
|
import { default as n } from "./src/rules/number.js";
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { mergeTemplate as T } from "./src/utils.js";
|
|
9
|
+
import { default as B } from "./src/rules/object.js";
|
|
10
|
+
import { default as g } from "./src/rules/string.js";
|
|
11
|
+
import { default as j } from "./src/rules/type.js";
|
|
13
12
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
x as zhCNValidateLocale
|
|
13
|
+
r as PqbValidator,
|
|
14
|
+
t as Validator,
|
|
15
|
+
f as ValidatorArray,
|
|
16
|
+
m as ValidatorBase,
|
|
17
|
+
u as ValidatorBoolean,
|
|
18
|
+
p as ValidatorCustom,
|
|
19
|
+
n as ValidatorNumber,
|
|
20
|
+
B as ValidatorObject,
|
|
21
|
+
e as ValidatorSchema,
|
|
22
|
+
g as ValidatorString,
|
|
23
|
+
j as ValidatorType,
|
|
24
|
+
l as default,
|
|
25
|
+
b as validatorLocale
|
|
28
26
|
};
|