@tiny-codes/react-easy 1.0.3 → 1.0.5
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/CHANGELOG.md +21 -0
- package/es/components/BreakLines/index.js +43 -26
- package/es/components/BreakLines/index.js.map +1 -1
- package/es/components/ConfigProvider/context.js +3 -3
- package/es/components/ConfigProvider/context.js.map +1 -1
- package/es/components/ConfigProvider/index.js +37 -35
- package/es/components/ConfigProvider/index.js.map +1 -1
- package/es/components/ConfirmAction/index.d.ts +74 -6
- package/es/components/ConfirmAction/index.js +210 -104
- package/es/components/ConfirmAction/index.js.map +1 -1
- package/es/components/DeleteConfirmAction/index.js +22 -20
- package/es/components/DeleteConfirmAction/index.js.map +1 -1
- package/es/components/ModalAction/index.d.ts +45 -5
- package/es/components/ModalAction/index.js +393 -209
- package/es/components/ModalAction/index.js.map +1 -1
- package/es/components/index.js +10 -8
- package/es/components/index.js.map +1 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +5 -4
- package/es/hooks/index.js.map +1 -1
- package/es/hooks/useContextValidator.js +7 -12
- package/es/hooks/useContextValidator.js.map +1 -1
- package/es/hooks/useLocalizedText.js +6 -4
- package/es/hooks/useLocalizedText.js.map +1 -1
- package/es/hooks/useRefFunction.js +13 -6
- package/es/hooks/useRefFunction.js.map +1 -1
- package/es/hooks/useRefValue.d.ts +12 -0
- package/es/hooks/useRefValue.js +18 -0
- package/es/hooks/useRefValue.js.map +1 -0
- package/es/hooks/useT.js +11 -8
- package/es/hooks/useT.js.map +1 -1
- package/es/hooks/useValidator.js +7 -4
- package/es/hooks/useValidator.js.map +1 -1
- package/es/hooks/useValidatorBuilder.js +146 -117
- package/es/hooks/useValidatorBuilder.js.map +1 -1
- package/es/hooks/useValidators.js +94 -58
- package/es/hooks/useValidators.js.map +1 -1
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/locales/index.js +19 -13
- package/es/locales/index.js.map +1 -1
- package/es/locales/langs/en-US.js +20 -20
- package/es/locales/langs/en-US.js.map +1 -1
- package/es/locales/langs/en.js +1 -1
- package/es/locales/langs/en.js.map +1 -1
- package/es/locales/langs/zh-CN.js +20 -20
- package/es/locales/langs/zh-CN.js.map +1 -1
- package/es/utils/index.js +1 -1
- package/es/utils/index.js.map +1 -1
- package/lib/components/BreakLines/index.js +50 -37
- package/lib/components/BreakLines/index.js.map +7 -1
- package/lib/components/ConfigProvider/context.js +35 -6
- package/lib/components/ConfigProvider/context.js.map +7 -1
- package/lib/components/ConfigProvider/index.js +56 -42
- package/lib/components/ConfigProvider/index.js.map +7 -1
- package/lib/components/ConfirmAction/index.d.ts +74 -6
- package/lib/components/ConfirmAction/index.js +194 -138
- package/lib/components/ConfirmAction/index.js.map +7 -1
- package/lib/components/DeleteConfirmAction/index.js +50 -51
- package/lib/components/DeleteConfirmAction/index.js.map +7 -1
- package/lib/components/ModalAction/index.d.ts +45 -5
- package/lib/components/ModalAction/index.js +303 -243
- package/lib/components/ModalAction/index.js.map +7 -1
- package/lib/components/index.js +63 -11
- package/lib/components/index.js.map +7 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +52 -5
- package/lib/hooks/index.js.map +7 -1
- package/lib/hooks/useContextValidator.js +47 -11
- package/lib/hooks/useContextValidator.js.map +7 -1
- package/lib/hooks/useLocalizedText.js +41 -15
- package/lib/hooks/useLocalizedText.js.map +7 -1
- package/lib/hooks/useRefFunction.js +34 -21
- package/lib/hooks/useRefFunction.js.map +7 -1
- package/lib/hooks/useRefValue.d.ts +12 -0
- package/lib/hooks/useRefValue.js +32 -0
- package/lib/hooks/useRefValue.js.map +7 -0
- package/lib/hooks/useT.js +43 -11
- package/lib/hooks/useT.js.map +7 -1
- package/lib/hooks/useValidator.js +41 -12
- package/lib/hooks/useValidator.js.map +7 -1
- package/lib/hooks/useValidatorBuilder.js +149 -132
- package/lib/hooks/useValidatorBuilder.js.map +7 -1
- package/lib/hooks/useValidators.js +104 -67
- package/lib/hooks/useValidators.js.map +7 -1
- package/lib/index.js +26 -3
- package/lib/index.js.map +7 -1
- package/lib/locales/index.js +58 -15
- package/lib/locales/index.js.map +7 -1
- package/lib/locales/langs/en-US.js +46 -22
- package/lib/locales/langs/en-US.js.map +7 -1
- package/lib/locales/langs/en.js +37 -3
- package/lib/locales/langs/en.js.map +7 -1
- package/lib/locales/langs/zh-CN.js +46 -22
- package/lib/locales/langs/zh-CN.js.map +7 -1
- package/lib/utils/index.js +1 -2
- package/lib/utils/index.js.map +7 -1
- package/package.json +14 -15
- package/es/hooks/useValidateContext.d.ts +0 -2
- package/es/hooks/useValidateContext.js +0 -16
- package/es/hooks/useValidateContext.js.map +0 -1
- package/lib/hooks/useValidateContext.d.ts +0 -2
- package/lib/hooks/useValidateContext.js +0 -16
- package/lib/hooks/useValidateContext.js.map +0 -1
package/lib/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './components';\nexport * from './hooks';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;AACA,wBAAc,oBADd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/locales/index.js
CHANGED
|
@@ -1,19 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/locales/index.ts
|
|
30
|
+
var locales_exports = {};
|
|
31
|
+
__export(locales_exports, {
|
|
32
|
+
default: () => locales_default,
|
|
33
|
+
langs: () => langs,
|
|
34
|
+
resources: () => resources,
|
|
35
|
+
t: () => t
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(locales_exports);
|
|
38
|
+
var import_i18next = require("i18next");
|
|
39
|
+
var import_en_US = __toESM(require("./langs/en-US"));
|
|
40
|
+
var import_zh_CN = __toESM(require("./langs/zh-CN"));
|
|
41
|
+
var langs = ["en", "en-US", "zh-CN"];
|
|
42
|
+
var resources = {
|
|
43
|
+
en: { translation: import_en_US.default },
|
|
44
|
+
"en-US": { translation: import_en_US.default },
|
|
45
|
+
"zh-CN": { translation: import_zh_CN.default }
|
|
46
|
+
};
|
|
47
|
+
var reactEasyI18n = (0, import_i18next.createInstance)({});
|
|
11
48
|
reactEasyI18n.init({
|
|
12
|
-
|
|
13
|
-
|
|
49
|
+
lng: "en",
|
|
50
|
+
resources
|
|
14
51
|
});
|
|
15
|
-
|
|
16
|
-
|
|
52
|
+
var t = (...args) => {
|
|
53
|
+
return reactEasyI18n.t(...args);
|
|
54
|
+
};
|
|
55
|
+
var locales_default = reactEasyI18n;
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
langs,
|
|
59
|
+
resources,
|
|
60
|
+
t
|
|
17
61
|
});
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
package/lib/locales/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/locales/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { createInstance, type i18n } from 'i18next';\nimport enUS from './langs/en-US';\nimport zhCN from './langs/zh-CN';\n\nexport const langs = ['en', 'en-US', 'zh-CN'] as const;\n\nexport type Langs = (typeof langs)[number];\n\nexport const resources = {\n en: { translation: enUS },\n 'en-US': { translation: enUS },\n 'zh-CN': { translation: zhCN },\n} as const;\n\nconst reactEasyI18n: i18n = createInstance({});\n\nreactEasyI18n.init({\n lng: 'en',\n resources,\n});\n\nexport const t: i18n['t'] = ((...args) => {\n return reactEasyI18n.t(...args);\n}) as i18n['t'];\n\nexport default reactEasyI18n;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0C;AAC1C,mBAAiB;AACjB,mBAAiB;AAEV,IAAM,QAAQ,CAAC,MAAM,SAAS,OAAO;AAIrC,IAAM,YAAY;AAAA,EACvB,IAAI,EAAE,aAAa,aAAAA,QAAK;AAAA,EACxB,SAAS,EAAE,aAAa,aAAAA,QAAK;AAAA,EAC7B,SAAS,EAAE,aAAa,aAAAC,QAAK;AAC/B;AAEA,IAAM,oBAAsB,+BAAe,CAAC,CAAC;AAE7C,cAAc,KAAK;AAAA,EACjB,KAAK;AAAA,EACL;AACF,CAAC;AAEM,IAAM,IAAgB,IAAI,SAAS;AACxC,SAAO,cAAc,EAAE,GAAG,IAAI;AAChC;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["enUS", "zhCN"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'validation.rule.buildRule.includeMandatory': 'At least one field in the include option is true',
|
|
9
|
-
'validation.rule.buildRule.messageFormat': 'Allow {{content}}',
|
|
10
|
-
'validation.rule.buildRule.startsWithFormat': `, start with {{prefix}}`,
|
|
11
|
-
'validation.rule.buildRule.minLength': `, at least {{min}} characters`,
|
|
12
|
-
'validation.rule.buildRule.maxLength': `, up to {{max}} characters`,
|
|
13
|
-
'validation.rule.buildRule.rangeLength': `, {{min}}~{{max}} characters`,
|
|
14
|
-
'validation.rule.buildRule.token.separator': ', ',
|
|
15
|
-
'validation.rule.buildRule.token.chinese': 'Chinese characters',
|
|
16
|
-
'validation.rule.buildRule.token.chinesePunctuation': 'Chinese punctuation',
|
|
17
|
-
'validation.rule.buildRule.token.letter': 'letter',
|
|
18
|
-
'validation.rule.buildRule.token.lowerLetter': 'lowercase letter',
|
|
19
|
-
'validation.rule.buildRule.token.upperLetter': 'uppercase letter',
|
|
20
|
-
'validation.rule.buildRule.token.number': 'number',
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
8
|
};
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/locales/langs/en-US.ts
|
|
20
|
+
var en_US_exports = {};
|
|
21
|
+
__export(en_US_exports, {
|
|
22
|
+
default: () => en_US_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(en_US_exports);
|
|
25
|
+
var enUS = {
|
|
26
|
+
"validation.rule.number.message": "Please enter a number",
|
|
27
|
+
"validation.rule.floatNumber.message": "Please enter a number",
|
|
28
|
+
"validation.rule.email.message": "Please enter the correct email address",
|
|
29
|
+
"validation.rule.ip.message": "Please enter the correct ip address",
|
|
30
|
+
"validation.rule.chineseMobile.message": "Please enter the correct mobile number",
|
|
31
|
+
"validation.rule.password.message": "8-16 digit password, at least two of numbers, letters, and symbols",
|
|
32
|
+
"validation.rule.buildRule.includeMandatory": "At least one field in the include option is true",
|
|
33
|
+
"validation.rule.buildRule.messageFormat": "Allow {{content}}",
|
|
34
|
+
"validation.rule.buildRule.startsWithFormat": `, start with {{prefix}}`,
|
|
35
|
+
"validation.rule.buildRule.minLength": `, at least {{min}} characters`,
|
|
36
|
+
"validation.rule.buildRule.maxLength": `, up to {{max}} characters`,
|
|
37
|
+
"validation.rule.buildRule.rangeLength": `, {{min}}~{{max}} characters`,
|
|
38
|
+
"validation.rule.buildRule.token.separator": ", ",
|
|
39
|
+
"validation.rule.buildRule.token.chinese": "Chinese characters",
|
|
40
|
+
"validation.rule.buildRule.token.chinesePunctuation": "Chinese punctuation",
|
|
41
|
+
"validation.rule.buildRule.token.letter": "letter",
|
|
42
|
+
"validation.rule.buildRule.token.lowerLetter": "lowercase letter",
|
|
43
|
+
"validation.rule.buildRule.token.upperLetter": "uppercase letter",
|
|
44
|
+
"validation.rule.buildRule.token.number": "number"
|
|
45
|
+
};
|
|
46
|
+
var en_US_default = enUS;
|
|
47
|
+
//# sourceMappingURL=en-US.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/locales/langs/en-US.ts"],
|
|
4
|
+
"sourcesContent": ["const enUS = {\n 'validation.rule.number.message': 'Please enter a number',\n 'validation.rule.floatNumber.message': 'Please enter a number',\n 'validation.rule.email.message': 'Please enter the correct email address',\n 'validation.rule.ip.message': 'Please enter the correct ip address',\n 'validation.rule.chineseMobile.message': 'Please enter the correct mobile number',\n 'validation.rule.password.message': '8-16 digit password, at least two of numbers, letters, and symbols',\n 'validation.rule.buildRule.includeMandatory': 'At least one field in the include option is true',\n 'validation.rule.buildRule.messageFormat': 'Allow {{content}}',\n 'validation.rule.buildRule.startsWithFormat': `, start with {{prefix}}`,\n 'validation.rule.buildRule.minLength': `, at least {{min}} characters`,\n 'validation.rule.buildRule.maxLength': `, up to {{max}} characters`,\n 'validation.rule.buildRule.rangeLength': `, {{min}}~{{max}} characters`,\n 'validation.rule.buildRule.token.separator': ', ',\n 'validation.rule.buildRule.token.chinese': 'Chinese characters',\n 'validation.rule.buildRule.token.chinesePunctuation': 'Chinese punctuation',\n 'validation.rule.buildRule.token.letter': 'letter',\n 'validation.rule.buildRule.token.lowerLetter': 'lowercase letter',\n 'validation.rule.buildRule.token.upperLetter': 'uppercase letter',\n 'validation.rule.buildRule.token.number': 'number',\n} as const;\nexport default enUS;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,OAAO;AAAA,EACX,kCAAkC;AAAA,EAClC,uCAAuC;AAAA,EACvC,iCAAiC;AAAA,EACjC,8BAA8B;AAAA,EAC9B,yCAAyC;AAAA,EACzC,oCAAoC;AAAA,EACpC,8CAA8C;AAAA,EAC9C,2CAA2C;AAAA,EAC3C,8CAA8C;AAAA,EAC9C,uCAAuC;AAAA,EACvC,uCAAuC;AAAA,EACvC,yCAAyC;AAAA,EACzC,6CAA6C;AAAA,EAC7C,2CAA2C;AAAA,EAC3C,sDAAsD;AAAA,EACtD,0CAA0C;AAAA,EAC1C,+CAA+C;AAAA,EAC/C,+CAA+C;AAAA,EAC/C,0CAA0C;AAC5C;AACA,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/locales/langs/en.js
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/locales/langs/en.ts
|
|
30
|
+
var en_exports = {};
|
|
31
|
+
__export(en_exports, {
|
|
32
|
+
default: () => en_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(en_exports);
|
|
35
|
+
var import_en_US = __toESM(require("./en-US"));
|
|
36
|
+
var en_default = import_en_US.default;
|
|
37
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/locales/langs/en.ts"],
|
|
4
|
+
"sourcesContent": ["import enUS from './en-US';\n\nexport default enUS;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiB;AAEjB,IAAO,aAAQ,aAAAA;",
|
|
6
|
+
"names": ["enUS"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'validation.rule.buildRule.includeMandatory': 'include选项中至少有一个字段为true',
|
|
9
|
-
'validation.rule.buildRule.messageFormat': '支持{{content}}',
|
|
10
|
-
'validation.rule.buildRule.startsWithFormat': `,以{{prefix}}开头`,
|
|
11
|
-
'validation.rule.buildRule.minLength': `,至少{{min}}字符`,
|
|
12
|
-
'validation.rule.buildRule.maxLength': `,{{max}}字符以内`,
|
|
13
|
-
'validation.rule.buildRule.rangeLength': `,{{min}}~{{max}}个字符`,
|
|
14
|
-
'validation.rule.buildRule.token.separator': '、',
|
|
15
|
-
'validation.rule.buildRule.token.chinese': '汉字',
|
|
16
|
-
'validation.rule.buildRule.token.chinesePunctuation': '中文标点',
|
|
17
|
-
'validation.rule.buildRule.token.letter': '字母',
|
|
18
|
-
'validation.rule.buildRule.token.lowerLetter': '小写字母',
|
|
19
|
-
'validation.rule.buildRule.token.upperLetter': '大写字母',
|
|
20
|
-
'validation.rule.buildRule.token.number': '数字',
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
8
|
};
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/locales/langs/zh-CN.ts
|
|
20
|
+
var zh_CN_exports = {};
|
|
21
|
+
__export(zh_CN_exports, {
|
|
22
|
+
default: () => zh_CN_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
25
|
+
var zhCN = {
|
|
26
|
+
"validation.rule.number.message": "请输入数字",
|
|
27
|
+
"validation.rule.floatNumber.message": "请输入数字",
|
|
28
|
+
"validation.rule.email.message": "请输入正确的邮箱地址",
|
|
29
|
+
"validation.rule.ip.message": "请输入正确的ip地址",
|
|
30
|
+
"validation.rule.chineseMobile.message": "请输入正确的手机号",
|
|
31
|
+
"validation.rule.password.message": "8-16位密码,数字、字母、符号至少包含两种",
|
|
32
|
+
"validation.rule.buildRule.includeMandatory": "include选项中至少有一个字段为true",
|
|
33
|
+
"validation.rule.buildRule.messageFormat": "支持{{content}}",
|
|
34
|
+
"validation.rule.buildRule.startsWithFormat": `,以{{prefix}}开头`,
|
|
35
|
+
"validation.rule.buildRule.minLength": `,至少{{min}}字符`,
|
|
36
|
+
"validation.rule.buildRule.maxLength": `,{{max}}字符以内`,
|
|
37
|
+
"validation.rule.buildRule.rangeLength": `,{{min}}~{{max}}个字符`,
|
|
38
|
+
"validation.rule.buildRule.token.separator": "、",
|
|
39
|
+
"validation.rule.buildRule.token.chinese": "汉字",
|
|
40
|
+
"validation.rule.buildRule.token.chinesePunctuation": "中文标点",
|
|
41
|
+
"validation.rule.buildRule.token.letter": "字母",
|
|
42
|
+
"validation.rule.buildRule.token.lowerLetter": "小写字母",
|
|
43
|
+
"validation.rule.buildRule.token.upperLetter": "大写字母",
|
|
44
|
+
"validation.rule.buildRule.token.number": "数字"
|
|
45
|
+
};
|
|
46
|
+
var zh_CN_default = zhCN;
|
|
47
|
+
//# sourceMappingURL=zh-CN.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/locales/langs/zh-CN.ts"],
|
|
4
|
+
"sourcesContent": ["const zhCN = {\n 'validation.rule.number.message': '请输入数字',\n 'validation.rule.floatNumber.message': '请输入数字',\n 'validation.rule.email.message': '请输入正确的邮箱地址',\n 'validation.rule.ip.message': '请输入正确的ip地址',\n 'validation.rule.chineseMobile.message': '请输入正确的手机号',\n 'validation.rule.password.message': '8-16位密码,数字、字母、符号至少包含两种',\n 'validation.rule.buildRule.includeMandatory': 'include选项中至少有一个字段为true',\n 'validation.rule.buildRule.messageFormat': '支持{{content}}',\n 'validation.rule.buildRule.startsWithFormat': `,以{{prefix}}开头`,\n 'validation.rule.buildRule.minLength': `,至少{{min}}字符`,\n 'validation.rule.buildRule.maxLength': `,{{max}}字符以内`,\n 'validation.rule.buildRule.rangeLength': `,{{min}}~{{max}}个字符`,\n 'validation.rule.buildRule.token.separator': '、',\n 'validation.rule.buildRule.token.chinese': '汉字',\n 'validation.rule.buildRule.token.chinesePunctuation': '中文标点',\n 'validation.rule.buildRule.token.letter': '字母',\n 'validation.rule.buildRule.token.lowerLetter': '小写字母',\n 'validation.rule.buildRule.token.upperLetter': '大写字母',\n 'validation.rule.buildRule.token.number': '数字',\n} as const;\nexport default zhCN;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,OAAO;AAAA,EACX,kCAAkC;AAAA,EAClC,uCAAuC;AAAA,EACvC,iCAAiC;AAAA,EACjC,8BAA8B;AAAA,EAC9B,yCAAyC;AAAA,EACzC,oCAAoC;AAAA,EACpC,8CAA8C;AAAA,EAC9C,2CAA2C;AAAA,EAC3C,8CAA8C;AAAA,EAC9C,uCAAuC;AAAA,EACvC,uCAAuC;AAAA,EACvC,yCAAyC;AAAA,EACzC,6CAA6C;AAAA,EAC7C,2CAA2C;AAAA,EAC3C,sDAAsD;AAAA,EACtD,0CAA0C;AAAA,EAC1C,+CAA+C;AAAA,EAC/C,+CAA+C;AAAA,EAC/C,0CAA0C;AAC5C;AACA,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/utils/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiny-codes/react-easy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Helps you use React and AntDesign more easily",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -25,35 +25,34 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"lib",
|
|
27
27
|
"es",
|
|
28
|
-
"CHANGELOG.md"
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"README.md",
|
|
30
|
+
"README.zh-CN.md"
|
|
29
31
|
],
|
|
30
32
|
"scripts": {
|
|
31
33
|
"prepare": "husky",
|
|
32
|
-
"build
|
|
33
|
-
"
|
|
34
|
-
"build:lib": "tsc -p tsconfig.lib.json",
|
|
35
|
-
"test": "ls && ls node_modules/.bin",
|
|
36
|
-
"prepublishOnly": "npm run test && npm run build"
|
|
34
|
+
"build": "father build",
|
|
35
|
+
"prepublishOnly": "npm run build"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"i18next": "^24.2.
|
|
38
|
+
"i18next": "^24.2.3"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@tiny-codes/code-style-all-in-one": "^1.
|
|
41
|
+
"@tiny-codes/code-style-all-in-one": "^1.1.5",
|
|
43
42
|
"@types/jest": "^29.5.14",
|
|
44
|
-
"@types/node": "^22.13.
|
|
45
|
-
"@types/react": "^19.0.
|
|
46
|
-
"@types/react-dom": "^19.0.
|
|
43
|
+
"@types/node": "^22.13.14",
|
|
44
|
+
"@types/react": "^19.0.12",
|
|
45
|
+
"@types/react-dom": "^19.0.4",
|
|
47
46
|
"@types/react-is": "^19.0.0",
|
|
48
|
-
"antd": "^5.
|
|
47
|
+
"antd": "^5.24.5",
|
|
49
48
|
"father": "^4.5.2",
|
|
50
49
|
"jest": "^29.7.0",
|
|
51
50
|
"npm-run-all2": "^7.0.2",
|
|
52
51
|
"react": "^19.0.0",
|
|
53
52
|
"react-dom": "^19.0.0",
|
|
54
53
|
"react-is": "^19.0.0",
|
|
55
|
-
"ts-jest": "^29.
|
|
56
|
-
"typescript": "^5.
|
|
54
|
+
"ts-jest": "^29.3.0",
|
|
55
|
+
"typescript": "^5.8.2"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
58
|
"antd": ">=5.1.0",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import AntHelperContext, { defaultContextValue } from '../components/ConfigProvider/context';
|
|
3
|
-
const useValidateContext = () => {
|
|
4
|
-
const context = useContext(AntHelperContext);
|
|
5
|
-
if (!context || context === defaultContextValue) {
|
|
6
|
-
console.warn(`ConfigProvider should be wrapped outside of any components of @tiny-codes/react-easy!
|
|
7
|
-
|
|
8
|
-
import { ConfigProvider } from '@tiny-codes/react-easy';
|
|
9
|
-
<ConfigProvider>
|
|
10
|
-
<App />
|
|
11
|
-
</ConfigProvider>`);
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
15
|
-
export default useValidateContext;
|
|
16
|
-
//# sourceMappingURL=useValidateContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValidateContext.js","sourceRoot":"","sources":["../../src/hooks/useValidateContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,gBAAgB,EAAE,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE7F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,CACV;;;;;kBAKY,CACb,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import AntHelperContext, { defaultContextValue } from '../components/ConfigProvider/context';
|
|
3
|
-
const useValidateContext = () => {
|
|
4
|
-
const context = useContext(AntHelperContext);
|
|
5
|
-
if (!context || context === defaultContextValue) {
|
|
6
|
-
console.warn(`ConfigProvider should be wrapped outside of any components of @tiny-codes/react-easy!
|
|
7
|
-
|
|
8
|
-
import { ConfigProvider } from '@tiny-codes/react-easy';
|
|
9
|
-
<ConfigProvider>
|
|
10
|
-
<App />
|
|
11
|
-
</ConfigProvider>`);
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
15
|
-
export default useValidateContext;
|
|
16
|
-
//# sourceMappingURL=useValidateContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValidateContext.js","sourceRoot":"","sources":["../../src/hooks/useValidateContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,gBAAgB,EAAE,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE7F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,mBAAmB,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,CACV;;;;;kBAKY,CACb,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|