@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.
Files changed (104) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/es/components/BreakLines/index.js +43 -26
  3. package/es/components/BreakLines/index.js.map +1 -1
  4. package/es/components/ConfigProvider/context.js +3 -3
  5. package/es/components/ConfigProvider/context.js.map +1 -1
  6. package/es/components/ConfigProvider/index.js +37 -35
  7. package/es/components/ConfigProvider/index.js.map +1 -1
  8. package/es/components/ConfirmAction/index.d.ts +74 -6
  9. package/es/components/ConfirmAction/index.js +210 -104
  10. package/es/components/ConfirmAction/index.js.map +1 -1
  11. package/es/components/DeleteConfirmAction/index.js +22 -20
  12. package/es/components/DeleteConfirmAction/index.js.map +1 -1
  13. package/es/components/ModalAction/index.d.ts +45 -5
  14. package/es/components/ModalAction/index.js +393 -209
  15. package/es/components/ModalAction/index.js.map +1 -1
  16. package/es/components/index.js +10 -8
  17. package/es/components/index.js.map +1 -1
  18. package/es/hooks/index.d.ts +1 -0
  19. package/es/hooks/index.js +5 -4
  20. package/es/hooks/index.js.map +1 -1
  21. package/es/hooks/useContextValidator.js +7 -12
  22. package/es/hooks/useContextValidator.js.map +1 -1
  23. package/es/hooks/useLocalizedText.js +6 -4
  24. package/es/hooks/useLocalizedText.js.map +1 -1
  25. package/es/hooks/useRefFunction.js +13 -6
  26. package/es/hooks/useRefFunction.js.map +1 -1
  27. package/es/hooks/useRefValue.d.ts +12 -0
  28. package/es/hooks/useRefValue.js +18 -0
  29. package/es/hooks/useRefValue.js.map +1 -0
  30. package/es/hooks/useT.js +11 -8
  31. package/es/hooks/useT.js.map +1 -1
  32. package/es/hooks/useValidator.js +7 -4
  33. package/es/hooks/useValidator.js.map +1 -1
  34. package/es/hooks/useValidatorBuilder.js +146 -117
  35. package/es/hooks/useValidatorBuilder.js.map +1 -1
  36. package/es/hooks/useValidators.js +94 -58
  37. package/es/hooks/useValidators.js.map +1 -1
  38. package/es/index.js +2 -2
  39. package/es/index.js.map +1 -1
  40. package/es/locales/index.js +19 -13
  41. package/es/locales/index.js.map +1 -1
  42. package/es/locales/langs/en-US.js +20 -20
  43. package/es/locales/langs/en-US.js.map +1 -1
  44. package/es/locales/langs/en.js +1 -1
  45. package/es/locales/langs/en.js.map +1 -1
  46. package/es/locales/langs/zh-CN.js +20 -20
  47. package/es/locales/langs/zh-CN.js.map +1 -1
  48. package/es/utils/index.js +1 -1
  49. package/es/utils/index.js.map +1 -1
  50. package/lib/components/BreakLines/index.js +50 -37
  51. package/lib/components/BreakLines/index.js.map +7 -1
  52. package/lib/components/ConfigProvider/context.js +35 -6
  53. package/lib/components/ConfigProvider/context.js.map +7 -1
  54. package/lib/components/ConfigProvider/index.js +56 -42
  55. package/lib/components/ConfigProvider/index.js.map +7 -1
  56. package/lib/components/ConfirmAction/index.d.ts +74 -6
  57. package/lib/components/ConfirmAction/index.js +194 -138
  58. package/lib/components/ConfirmAction/index.js.map +7 -1
  59. package/lib/components/DeleteConfirmAction/index.js +50 -51
  60. package/lib/components/DeleteConfirmAction/index.js.map +7 -1
  61. package/lib/components/ModalAction/index.d.ts +45 -5
  62. package/lib/components/ModalAction/index.js +303 -243
  63. package/lib/components/ModalAction/index.js.map +7 -1
  64. package/lib/components/index.js +63 -11
  65. package/lib/components/index.js.map +7 -1
  66. package/lib/hooks/index.d.ts +1 -0
  67. package/lib/hooks/index.js +52 -5
  68. package/lib/hooks/index.js.map +7 -1
  69. package/lib/hooks/useContextValidator.js +47 -11
  70. package/lib/hooks/useContextValidator.js.map +7 -1
  71. package/lib/hooks/useLocalizedText.js +41 -15
  72. package/lib/hooks/useLocalizedText.js.map +7 -1
  73. package/lib/hooks/useRefFunction.js +34 -21
  74. package/lib/hooks/useRefFunction.js.map +7 -1
  75. package/lib/hooks/useRefValue.d.ts +12 -0
  76. package/lib/hooks/useRefValue.js +32 -0
  77. package/lib/hooks/useRefValue.js.map +7 -0
  78. package/lib/hooks/useT.js +43 -11
  79. package/lib/hooks/useT.js.map +7 -1
  80. package/lib/hooks/useValidator.js +41 -12
  81. package/lib/hooks/useValidator.js.map +7 -1
  82. package/lib/hooks/useValidatorBuilder.js +149 -132
  83. package/lib/hooks/useValidatorBuilder.js.map +7 -1
  84. package/lib/hooks/useValidators.js +104 -67
  85. package/lib/hooks/useValidators.js.map +7 -1
  86. package/lib/index.js +26 -3
  87. package/lib/index.js.map +7 -1
  88. package/lib/locales/index.js +58 -15
  89. package/lib/locales/index.js.map +7 -1
  90. package/lib/locales/langs/en-US.js +46 -22
  91. package/lib/locales/langs/en-US.js.map +7 -1
  92. package/lib/locales/langs/en.js +37 -3
  93. package/lib/locales/langs/en.js.map +7 -1
  94. package/lib/locales/langs/zh-CN.js +46 -22
  95. package/lib/locales/langs/zh-CN.js.map +7 -1
  96. package/lib/utils/index.js +1 -2
  97. package/lib/utils/index.js.map +7 -1
  98. package/package.json +14 -15
  99. package/es/hooks/useValidateContext.d.ts +0 -2
  100. package/es/hooks/useValidateContext.js +0 -16
  101. package/es/hooks/useValidateContext.js.map +0 -1
  102. package/lib/hooks/useValidateContext.d.ts +0 -2
  103. package/lib/hooks/useValidateContext.js +0 -16
  104. package/lib/hooks/useValidateContext.js.map +0 -1
package/lib/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
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
+ }
@@ -1,19 +1,62 @@
1
- import { createInstance } from 'i18next';
2
- import enUS from './langs/en-US';
3
- import zhCN from './langs/zh-CN';
4
- export const langs = ['en', 'en-US', 'zh-CN'];
5
- export const resources = {
6
- en: { translation: enUS },
7
- 'en-US': { translation: enUS },
8
- 'zh-CN': { translation: zhCN },
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
- const reactEasyI18n = createInstance({});
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
- lng: 'en',
13
- resources,
49
+ lng: "en",
50
+ resources
14
51
  });
15
- export const t = ((...args) => {
16
- return reactEasyI18n.t(...args);
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
- export default reactEasyI18n;
19
- //# sourceMappingURL=index.js.map
62
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AACpD,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,IAAI,MAAM,eAAe,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAIvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;IACzB,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;IAC9B,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;CACtB,CAAC;AAEX,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;AAEzC,aAAa,CAAC,IAAI,CAAC;IACjB,GAAG,EAAE,IAAI;IACT,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,CAAC,GAAc,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;IACvC,OAAO,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAClC,CAAC,CAAc,CAAC;AAEhB,eAAe,aAAa,CAAC"}
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
- const enUS = {
2
- 'validation.rule.number.message': 'Please enter a number',
3
- 'validation.rule.floatNumber.message': 'Please enter a number',
4
- 'validation.rule.email.message': 'Please enter the correct email address',
5
- 'validation.rule.ip.message': 'Please enter the correct ip address',
6
- 'validation.rule.chineseMobile.message': 'Please enter the correct mobile number',
7
- 'validation.rule.password.message': '8-16 digit password, at least two of numbers, letters, and symbols',
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
- export default enUS;
23
- //# sourceMappingURL=en-US.js.map
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
- {"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../src/locales/langs/en-US.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG;IACX,gCAAgC,EAAE,uBAAuB;IACzD,qCAAqC,EAAE,uBAAuB;IAC9D,+BAA+B,EAAE,wCAAwC;IACzE,4BAA4B,EAAE,qCAAqC;IACnE,uCAAuC,EAAE,wCAAwC;IACjF,kCAAkC,EAAE,oEAAoE;IACxG,4CAA4C,EAAE,kDAAkD;IAChG,yCAAyC,EAAE,mBAAmB;IAC9D,4CAA4C,EAAE,yBAAyB;IACvE,qCAAqC,EAAE,+BAA+B;IACtE,qCAAqC,EAAE,4BAA4B;IACnE,uCAAuC,EAAE,8BAA8B;IACvE,2CAA2C,EAAE,IAAI;IACjD,yCAAyC,EAAE,oBAAoB;IAC/D,oDAAoD,EAAE,qBAAqB;IAC3E,wCAAwC,EAAE,QAAQ;IAClD,6CAA6C,EAAE,kBAAkB;IACjE,6CAA6C,EAAE,kBAAkB;IACjE,wCAAwC,EAAE,QAAQ;CAC1C,CAAC;AACX,eAAe,IAAI,CAAC"}
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
+ }
@@ -1,3 +1,37 @@
1
- import enUS from './en-US';
2
- export default enUS;
3
- //# sourceMappingURL=en.js.map
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
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../../src/locales/langs/en.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe,IAAI,CAAC"}
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
- const zhCN = {
2
- 'validation.rule.number.message': '请输入数字',
3
- 'validation.rule.floatNumber.message': '请输入数字',
4
- 'validation.rule.email.message': '请输入正确的邮箱地址',
5
- 'validation.rule.ip.message': '请输入正确的ip地址',
6
- 'validation.rule.chineseMobile.message': '请输入正确的手机号',
7
- 'validation.rule.password.message': '8-16位密码,数字、字母、符号至少包含两种',
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
- export default zhCN;
23
- //# sourceMappingURL=zh-CN.js.map
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
- {"version":3,"file":"zh-CN.js","sourceRoot":"","sources":["../../../src/locales/langs/zh-CN.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG;IACX,gCAAgC,EAAE,OAAO;IACzC,qCAAqC,EAAE,OAAO;IAC9C,+BAA+B,EAAE,YAAY;IAC7C,4BAA4B,EAAE,YAAY;IAC1C,uCAAuC,EAAE,WAAW;IACpD,kCAAkC,EAAE,wBAAwB;IAC5D,4CAA4C,EAAE,wBAAwB;IACtE,yCAAyC,EAAE,eAAe;IAC1D,4CAA4C,EAAE,gBAAgB;IAC9D,qCAAqC,EAAE,cAAc;IACrD,qCAAqC,EAAE,cAAc;IACrD,uCAAuC,EAAE,qBAAqB;IAC9D,2CAA2C,EAAE,GAAG;IAChD,yCAAyC,EAAE,IAAI;IAC/C,oDAAoD,EAAE,MAAM;IAC5D,wCAAwC,EAAE,IAAI;IAC9C,6CAA6C,EAAE,MAAM;IACrD,6CAA6C,EAAE,MAAM;IACrD,wCAAwC,EAAE,IAAI;CACtC,CAAC;AACX,eAAe,IAAI,CAAC"}
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
+ }
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=index.js.map
1
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-codes/react-easy",
3
- "version": "1.0.3",
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:es": "tsc -p tsconfig.es.json",
33
- "build": "run-p build:lib build:es",
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.2"
38
+ "i18next": "^24.2.3"
40
39
  },
41
40
  "devDependencies": {
42
- "@tiny-codes/code-style-all-in-one": "^1.0.0",
41
+ "@tiny-codes/code-style-all-in-one": "^1.1.5",
43
42
  "@types/jest": "^29.5.14",
44
- "@types/node": "^22.13.1",
45
- "@types/react": "^19.0.8",
46
- "@types/react-dom": "^19.0.3",
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.23.4",
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.2.5",
56
- "typescript": "^5.7.3"
54
+ "ts-jest": "^29.3.0",
55
+ "typescript": "^5.8.2"
57
56
  },
58
57
  "peerDependencies": {
59
58
  "antd": ">=5.1.0",
@@ -1,2 +0,0 @@
1
- declare const useValidateContext: () => import("../components/ConfigProvider/context").AntHelperContextProps;
2
- export default useValidateContext;
@@ -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,2 +0,0 @@
1
- declare const useValidateContext: () => import("../components/ConfigProvider/context").AntHelperContextProps;
2
- export default useValidateContext;
@@ -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"}