@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
@@ -1,23 +1,23 @@
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 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'
21
21
  };
22
22
  export default enUS;
23
23
  //# sourceMappingURL=en-US.js.map
@@ -1 +1 @@
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
+ {"version":3,"names":["enUS"],"sources":["../../../src/locales/langs/en-US.ts"],"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"],"mappings":"AAAA,IAAMA,IAAI,GAAG;EACX,gCAAgC,EAAE,uBAAuB;EACzD,qCAAqC,EAAE,uBAAuB;EAC9D,+BAA+B,EAAE,wCAAwC;EACzE,4BAA4B,EAAE,qCAAqC;EACnE,uCAAuC,EAAE,wCAAwC;EACjF,kCAAkC,EAAE,oEAAoE;EACxG,4CAA4C,EAAE,kDAAkD;EAChG,yCAAyC,EAAE,mBAAmB;EAC9D,4CAA4C,2BAA2B;EACvE,qCAAqC,iCAAiC;EACtE,qCAAqC,8BAA8B;EACnE,uCAAuC,gCAAgC;EACvE,2CAA2C,EAAE,IAAI;EACjD,yCAAyC,EAAE,oBAAoB;EAC/D,oDAAoD,EAAE,qBAAqB;EAC3E,wCAAwC,EAAE,QAAQ;EAClD,6CAA6C,EAAE,kBAAkB;EACjE,6CAA6C,EAAE,kBAAkB;EACjE,wCAAwC,EAAE;AAC5C,CAAU;AACV,eAAeA,IAAI"}
@@ -1,3 +1,3 @@
1
- import enUS from './en-US';
1
+ import enUS from "./en-US";
2
2
  export default enUS;
3
3
  //# sourceMappingURL=en.js.map
@@ -1 +1 @@
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
+ {"version":3,"names":["enUS"],"sources":["../../../src/locales/langs/en.ts"],"sourcesContent":["import enUS from './en-US';\n\nexport default enUS;\n"],"mappings":"AAAA,OAAOA,IAAI;AAEX,eAAeA,IAAI"}
@@ -1,23 +1,23 @@
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 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': "\uFF0C\u4EE5{{prefix}}\u5F00\u5934",
11
+ 'validation.rule.buildRule.minLength': "\uFF0C\u81F3\u5C11{{min}}\u5B57\u7B26",
12
+ 'validation.rule.buildRule.maxLength': "\uFF0C{{max}}\u5B57\u7B26\u4EE5\u5185",
13
+ 'validation.rule.buildRule.rangeLength': "\uFF0C{{min}}~{{max}}\u4E2A\u5B57\u7B26",
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': '数字'
21
21
  };
22
22
  export default zhCN;
23
23
  //# sourceMappingURL=zh-CN.js.map
@@ -1 +1 @@
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
+ {"version":3,"names":["zhCN"],"sources":["../../../src/locales/langs/zh-CN.ts"],"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"],"mappings":"AAAA,IAAMA,IAAI,GAAG;EACX,gCAAgC,EAAE,OAAO;EACzC,qCAAqC,EAAE,OAAO;EAC9C,+BAA+B,EAAE,YAAY;EAC7C,4BAA4B,EAAE,YAAY;EAC1C,uCAAuC,EAAE,WAAW;EACpD,kCAAkC,EAAE,wBAAwB;EAC5D,4CAA4C,EAAE,wBAAwB;EACtE,yCAAyC,EAAE,eAAe;EAC1D,4CAA4C,sCAAkB;EAC9D,qCAAqC,yCAAgB;EACrD,qCAAqC,yCAAgB;EACrD,uCAAuC,2CAAuB;EAC9D,2CAA2C,EAAE,GAAG;EAChD,yCAAyC,EAAE,IAAI;EAC/C,oDAAoD,EAAE,MAAM;EAC5D,wCAAwC,EAAE,IAAI;EAC9C,6CAA6C,EAAE,MAAM;EACrD,6CAA6C,EAAE,MAAM;EACrD,wCAAwC,EAAE;AAC5C,CAAU;AACV,eAAeA,IAAI"}
package/es/utils/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
1
+
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":[""],"mappings":""}
@@ -1,40 +1,53 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createElement } from 'react';
3
- /**
4
- * **EN:** Output a piece of text, keeping line breaks
5
- *
6
- * **CN:** 输出一段文本,保留换行符
7
- *
8
- * @example
9
- * <BreakLines value="hello \n world" />;
10
- * // hello <br/> world
11
- */
12
- const BreakLines = (props) => {
13
- const { value, className, tagName = false, enabled = true, EOL = '\n' } = props;
14
- let content;
15
- if (value) {
16
- if (enabled) {
17
- if (value.includes(EOL)) {
18
- const segments = value === null || value === void 0 ? void 0 : value.split(EOL);
19
- content = segments.map((str, i) => (_jsxs(_Fragment, { children: [str, i !== segments.length - 1 && _jsx("br", {})] })));
20
- }
21
- else {
22
- content = value;
23
- }
24
- }
25
- else {
26
- content = value;
27
- }
28
- }
29
- else {
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 });
8
+ };
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/components/BreakLines/index.tsx
20
+ var BreakLines_exports = {};
21
+ __export(BreakLines_exports, {
22
+ default: () => BreakLines_default
23
+ });
24
+ module.exports = __toCommonJS(BreakLines_exports);
25
+ var import_react = require("react");
26
+ var BreakLines = (props) => {
27
+ const { value, className, tagName = false, enabled = true, EOL = "\n" } = props;
28
+ let content;
29
+ if (value) {
30
+ if (enabled) {
31
+ if (value.includes(EOL)) {
32
+ const segments = value == null ? void 0 : value.split(EOL);
33
+ content = segments.map((str, i) => (
34
+ // eslint-disable-next-line react/no-array-index-key
35
+ /* @__PURE__ */ React.createElement(import_react.Fragment, { key: `${str}:${i}` }, str, i !== segments.length - 1 && /* @__PURE__ */ React.createElement("br", null))
36
+ ));
37
+ } else {
30
38
  content = value;
39
+ }
40
+ } else {
41
+ content = value;
31
42
  }
32
- if (tagName) {
33
- return createElement(tagName, { className }, content);
34
- }
35
- else {
36
- return _jsx(_Fragment, { children: content });
37
- }
43
+ } else {
44
+ content = value;
45
+ }
46
+ if (tagName) {
47
+ return (0, import_react.createElement)(tagName, { className }, content);
48
+ } else {
49
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, content);
50
+ }
38
51
  };
39
- export default BreakLines;
40
- //# sourceMappingURL=index.js.map
52
+ var BreakLines_default = BreakLines;
53
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/BreakLines/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,OAAO,CAAC;AA2C/D;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,EAAE;IAChD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEhF,IAAI,OAAkB,CAAC;IACvB,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,QAAQ,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnC,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACjC,8BACG,GAAG,EACH,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,cAAM,IACnC,CACJ,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,aAAa,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,OAAO,4BAAG,OAAO,GAAI,CAAC;IACxB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/BreakLines/index.tsx"],
4
+ "sourcesContent": ["import { createElement, type FC, Fragment, type ReactNode } from 'react';\n\nexport interface BreakLinesProps {\n /**\n * **EN:** Text content\n *\n * **CN:** 文本内容\n */\n value: string | undefined;\n /**\n * **EN:** Whether to enable line breaking\n *\n * **CN:** 是否启用换行功能\n *\n * @default true\n */\n enabled?: boolean;\n /**\n * **EN:** Line break character\n *\n * **CN:** 换行符\n *\n * @default '\\n'\n */\n EOL?: string;\n /**\n * **CN:** 渲染dom节点的标签名\n *\n * **EN:** Render the tag name of the DOM node\n *\n * @default false\n */\n // eslint-disable-next-line @typescript-eslint/ban-types\n tagName?: 'span' | 'div' | 'i' | 'pre' | (string & {}) | false;\n /**\n * **EN:** The CSS class name of the dom node, if `tagName` is set to false, this property is\n * invalid\n *\n * **CN:** dom节点的css类名,如果`tagName`设置为false,则此属性无效\n */\n className?: string;\n}\n\n/**\n * **EN:** Output a piece of text, keeping line breaks\n *\n * **CN:** 输出一段文本,保留换行符\n *\n * @example\n * <BreakLines value=\"hello \\n world\" />;\n * // hello <br/> world\n */\nconst BreakLines: FC<BreakLinesProps> = (props) => {\n const { value, className, tagName = false, enabled = true, EOL = '\\n' } = props;\n\n let content: ReactNode;\n if (value) {\n if (enabled) {\n if (value.includes(EOL)) {\n const segments = value?.split(EOL);\n content = segments.map((str, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={`${str}:${i}`}>\n {str}\n {i !== segments.length - 1 && <br />}\n </Fragment>\n ));\n } else {\n content = value;\n }\n } else {\n content = value;\n }\n } else {\n content = value;\n }\n\n if (tagName) {\n return createElement(tagName, { className }, content);\n } else {\n return <>{content}</>;\n }\n};\n\nexport default BreakLines;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiE;AAoDjE,IAAM,aAAkC,CAAC,UAAU;AACjD,QAAM,EAAE,OAAO,WAAW,UAAU,OAAO,UAAU,MAAM,MAAM,KAAK,IAAI;AAE1E,MAAI;AACJ,MAAI,OAAO;AACT,QAAI,SAAS;AACX,UAAI,MAAM,SAAS,GAAG,GAAG;AACvB,cAAM,WAAW,+BAAO,MAAM;AAC9B,kBAAU,SAAS,IAAI,CAAC,KAAK;AAAA;AAAA,UAE3B,oCAAC,yBAAS,KAAK,GAAG,OAAO,OACtB,KACA,MAAM,SAAS,SAAS,KAAK,oCAAC,UAAG,CACpC;AAAA,SACD;AAAA,MACH,OAAO;AACL,kBAAU;AAAA,MACZ;AAAA,IACF,OAAO;AACL,gBAAU;AAAA,IACZ;AAAA,EACF,OAAO;AACL,cAAU;AAAA,EACZ;AAEA,MAAI,SAAS;AACX,eAAO,4BAAc,SAAS,EAAE,UAAU,GAAG,OAAO;AAAA,EACtD,OAAO;AACL,WAAO,0DAAG,OAAQ;AAAA,EACpB;AACF;AAEA,IAAO,qBAAQ;",
6
+ "names": []
7
+ }
@@ -1,7 +1,36 @@
1
- import { createContext } from 'react';
2
- export const defaultContextValue = {
3
- lang: 'en',
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 });
4
8
  };
5
- const ReactEasyContext = createContext(defaultContextValue);
6
- export default ReactEasyContext;
7
- //# sourceMappingURL=context.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/components/ConfigProvider/context.tsx
20
+ var context_exports = {};
21
+ __export(context_exports, {
22
+ default: () => context_default,
23
+ defaultContextValue: () => defaultContextValue
24
+ });
25
+ module.exports = __toCommonJS(context_exports);
26
+ var import_react = require("react");
27
+ var defaultContextValue = {
28
+ lang: "en"
29
+ };
30
+ var ReactEasyContext = (0, import_react.createContext)(defaultContextValue);
31
+ var context_default = ReactEasyContext;
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ defaultContextValue
35
+ });
36
+ //# sourceMappingURL=context.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/ConfigProvider/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AA2DtD,MAAM,CAAC,MAAM,mBAAmB,GAA0B;IACxD,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,MAAM,gBAAgB,GAAG,aAAa,CAAwB,mBAAmB,CAAC,CAAC;AAEnF,eAAe,gBAAgB,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ConfigProvider/context.tsx"],
4
+ "sourcesContent": ["import { createContext, type ReactNode } from 'react';\nimport type { Langs } from '../../locales';\n\nexport interface ReactEasyContextProps {\n /**\n * **EN:** Language of the component, used for global configuration, can be 'en-US' or 'zh-CN'\n *\n * **CN:** 组件的语言,用于全局配置,可以是'en-US'或'zh-CN'\n */\n lang?: Langs;\n /**\n * **EN:** Default title of the confirm dialog, used for global configuration, can be normal text\n * or the key of localized resources, the key of localized resources will be converted into\n * localized text through the `localize` method\n *\n * **CN:** 确认弹框的默认标题,用于全局配置,可以是普通文本或本地化资源的键值,本地化资源的键值会通过`localize`方法转换成本地化文本\n */\n defaultConfirmTitle?: ReactNode;\n /**\n * **EN:** Default content of the confirm dialog, used for global configuration, can be normal\n * text or the key of localized resources, the key of localized resources will be converted into\n * localized text through the `localize` method\n *\n * **CN:** 确认弹框的默认内容,用于全局配置,可以是普通文本或本地化资源的键值,本地化资源的键值会通过`localize`方法转换成本地化文本\n */\n defaultConfirmContent?: ReactNode;\n\n /**\n * **EN:** Default title of the deletion confirmation dialog, used for global configuration, can\n * be normal text or the key of localized resources, the key of localized resources will be\n * converted into localized text through the `localize` method\n *\n * **CN:** 删除确认弹框的默认标题,用于全局配置,可以是普通文本或本地化资源的键值,本地化资源的键值会通过`localize`方法转换成本地化文本\n */\n defaultDeletionConfirmTitle?: ReactNode;\n\n /**\n * **EN:** Default content of the deletion confirmation dialog, used for global configuration, can\n * be normal text or the key of localized resources, the key of localized resources will be\n * converted into localized text through the `localize` method\n *\n * **CN:** 删除确认弹框的默认内容,用于全局配置,可以是普通文本或本地化资源的键值,本地化资源的键值会通过`localize`方法转换成本地化文本\n */\n defaultDeletionConfirmContent?: ReactNode;\n\n // /** 获取本地化文本 */\n /**\n * **EN:** Get localized text\n *\n * **CN:** 获取本地化文本\n *\n * @param key Normal text or key of local resource | 普通文本或本地资源的键值\n * @param args Parameters of the localized text | 本地化文本的参数\n *\n * @returns Localized text | 本地化文本\n */\n localize?: <T>(key: T, args?: Record<string, unknown>) => ReactNode;\n}\n\nexport const defaultContextValue: ReactEasyContextProps = {\n lang: 'en',\n};\n\nconst ReactEasyContext = createContext<ReactEasyContextProps>(defaultContextValue);\n\nexport default ReactEasyContext;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8C;AA2DvC,IAAM,sBAA6C;AAAA,EACxD,MAAM;AACR;AAEA,IAAM,uBAAmB,4BAAqC,mBAAmB;AAEjF,IAAO,kBAAQ;",
6
+ "names": []
7
+ }
@@ -1,44 +1,58 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
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 });
11
10
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { useEffect } from 'react';
14
- import locales, { langs, resources } from '../../locales';
15
- import ReactEasyContext from './context';
16
- /**
17
- * **EN:** Provide global configuration for AntdHelper
18
- *
19
- * **CN:** 提供AntdHelper的全局配置
20
- */
21
- const ConfigProvider = (props) => {
22
- const { children, locales: userLocales } = props, restProps = __rest(props, ["children", "locales"]);
23
- const { lang: langInProps } = restProps;
24
- useEffect(() => {
25
- // Dynamically add language pack
26
- if (userLocales) {
27
- const lang = langInProps || 'en';
28
- if (lang && langs.includes(lang)) {
29
- locales.removeResourceBundle(lang, 'translation');
30
- locales.addResourceBundle(lang, 'translation', Object.assign(Object.assign({}, resources[lang].translation), userLocales));
31
- }
32
- else {
33
- locales.addResourceBundle(lang, 'translation', Object.assign(Object.assign({}, resources.en.translation), userLocales));
34
- }
35
- }
36
- }, [langInProps, userLocales]);
37
- useEffect(() => {
38
- // Set the language of the component
39
- locales.changeLanguage(langInProps || 'en');
40
- }, [langInProps]);
41
- return _jsx(ReactEasyContext.Provider, { value: restProps, children: children });
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;
42
18
  };
43
- export default ConfigProvider;
44
- //# sourceMappingURL=index.js.map
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/components/ConfigProvider/index.tsx
30
+ var ConfigProvider_exports = {};
31
+ __export(ConfigProvider_exports, {
32
+ default: () => ConfigProvider_default
33
+ });
34
+ module.exports = __toCommonJS(ConfigProvider_exports);
35
+ var import_react = require("react");
36
+ var import_locales = __toESM(require("../../locales"));
37
+ var import_context = __toESM(require("./context"));
38
+ var ConfigProvider = (props) => {
39
+ const { children, locales: userLocales, ...restProps } = props;
40
+ const { lang: langInProps } = restProps;
41
+ (0, import_react.useEffect)(() => {
42
+ if (userLocales) {
43
+ const lang = langInProps || "en";
44
+ if (lang && import_locales.langs.includes(lang)) {
45
+ import_locales.default.removeResourceBundle(lang, "translation");
46
+ import_locales.default.addResourceBundle(lang, "translation", { ...import_locales.resources[lang].translation, ...userLocales });
47
+ } else {
48
+ import_locales.default.addResourceBundle(lang, "translation", { ...import_locales.resources.en.translation, ...userLocales });
49
+ }
50
+ }
51
+ }, [langInProps, userLocales]);
52
+ (0, import_react.useEffect)(() => {
53
+ import_locales.default.changeLanguage(langInProps || "en");
54
+ }, [langInProps]);
55
+ return /* @__PURE__ */ React.createElement(import_context.default.Provider, { value: restProps }, children);
56
+ };
57
+ var ConfigProvider_default = ConfigProvider;
58
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigProvider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,gBAAgD,MAAM,WAAW,CAAC;AAazE;;;;GAIG;AACH,MAAM,cAAc,GAA4B,CAAC,KAAK,EAAE,EAAE;IACxD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAAxD,uBAAgD,CAAQ,CAAC;IAC/D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IAExC,SAAS,CAAC,GAAG,EAAE;QACb,gCAAgC;QAChC,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,IAAI,GAAG,WAAW,IAAI,IAAI,CAAC;YACjC,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;gBAClD,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,kCAAO,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,GAAK,WAAW,EAAG,CAAC;YACrG,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,kCAAO,SAAS,CAAC,EAAE,CAAC,WAAW,GAAK,WAAW,EAAG,CAAC;YAClG,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,oCAAoC;QACpC,OAAO,CAAC,cAAc,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YAAG,QAAQ,GAA6B,CAAC;AAC7F,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ConfigProvider/index.tsx"],
4
+ "sourcesContent": ["import { type FC, type ReactNode, useEffect } from 'react';\nimport locales, { langs, resources } from '../../locales';\nimport type localesEn from '../../locales/langs/en';\nimport ReactEasyContext, { type ReactEasyContextProps } from './context';\n\nexport interface ConfigProviderProps extends ReactEasyContextProps {\n /**\n * **EN:** Custom localization resources, if `lang` exists, it will override the localization\n * resources of that language, otherwise, it will add a new language\n *\n * **CN:** 自定义本地化资源,如果`lang`存在,则会覆盖该语言的本地化资源,否则,会添加一种新的语言\n */\n locales?: Partial<typeof localesEn>;\n children: ReactNode;\n}\n\n/**\n * **EN:** Provide global configuration for AntdHelper\n *\n * **CN:** 提供AntdHelper的全局配置\n */\nconst ConfigProvider: FC<ConfigProviderProps> = (props) => {\n const { children, locales: userLocales, ...restProps } = props;\n const { lang: langInProps } = restProps;\n\n useEffect(() => {\n // Dynamically add language pack\n if (userLocales) {\n const lang = langInProps || 'en';\n if (lang && langs.includes(lang)) {\n locales.removeResourceBundle(lang, 'translation');\n locales.addResourceBundle(lang, 'translation', { ...resources[lang].translation, ...userLocales });\n } else {\n locales.addResourceBundle(lang, 'translation', { ...resources.en.translation, ...userLocales });\n }\n }\n }, [langInProps, userLocales]);\n\n useEffect(() => {\n // Set the language of the component\n locales.changeLanguage(langInProps || 'en');\n }, [langInProps]);\n\n return <ReactEasyContext.Provider value={restProps}>{children}</ReactEasyContext.Provider>;\n};\n\nexport default ConfigProvider;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmD;AACnD,qBAA0C;AAE1C,qBAA6D;AAkB7D,IAAM,iBAA0C,CAAC,UAAU;AACzD,QAAM,EAAE,UAAU,SAAS,aAAa,GAAG,UAAU,IAAI;AACzD,QAAM,EAAE,MAAM,YAAY,IAAI;AAE9B,8BAAU,MAAM;AAEd,QAAI,aAAa;AACf,YAAM,OAAO,eAAe;AAC5B,UAAI,QAAQ,qBAAM,SAAS,IAAI,GAAG;AAChC,uBAAAA,QAAQ,qBAAqB,MAAM,aAAa;AAChD,uBAAAA,QAAQ,kBAAkB,MAAM,eAAe,EAAE,GAAG,yBAAU,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;AAAA,MACnG,OAAO;AACL,uBAAAA,QAAQ,kBAAkB,MAAM,eAAe,EAAE,GAAG,yBAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AAAA,MAChG;AAAA,IACF;AAAA,EACF,GAAG,CAAC,aAAa,WAAW,CAAC;AAE7B,8BAAU,MAAM;AAEd,mBAAAA,QAAQ,eAAe,eAAe,IAAI;AAAA,EAC5C,GAAG,CAAC,WAAW,CAAC;AAEhB,SAAO,oCAAC,eAAAC,QAAiB,UAAjB,EAA0B,OAAO,aAAY,QAAS;AAChE;AAEA,IAAO,yBAAQ;",
6
+ "names": ["locales", "ReactEasyContext"]
7
+ }
@@ -5,6 +5,18 @@ import type confirm from 'antd/es/modal/confirm';
5
5
  import type { LinkProps } from 'antd/es/typography/Link';
6
6
  import type { TextProps } from 'antd/es/typography/Text';
7
7
  export type ConfirmActionProps<TP extends object, E extends keyof TP> = Omit<ModalFuncProps, 'onOk'> & ConfirmActionTrigger<TP, E> & {
8
+ /**
9
+ * **EN:** Whether to display in red danger mode, which will automatically affect the color of
10
+ * the title, icon, and confirm button. Default is `false`, for DeleteConfirmAction, the
11
+ * defaults is `true`.
12
+ *
13
+ * - You can explicitly set `titleColor`, `iconColor`, and `okButtonProps.type` to override
14
+ *
15
+ * **CN:** 是否显示为红色危险模式,会自动影响标题、图标和确认按钮的颜色。默认`false`,DeleteConfirmAction组件的默认值为`true`。
16
+ *
17
+ * - 可以显式设置`titleColor`、`iconColor`和`okButtonProps.type`来覆盖
18
+ */
19
+ danger?: boolean;
8
20
  /**
9
21
  * **EN:** The color of confirm box title, default is `warning`
10
22
  *
@@ -85,7 +97,7 @@ export type ConfirmActionRef = ReturnType<typeof confirm> & {
85
97
  * @returns Component render method | 组件render方法
86
98
  */
87
99
  export declare const genRenderer: (defaultProps: Partial<ConfirmActionProps<any, never>> & {
88
- confirmType: "normal" | "delete";
100
+ confirmType: 'normal' | 'delete';
89
101
  }) => {
90
102
  <TP extends object, E extends keyof TP>(props: ConfirmActionProps<TP, E>, ref: ForwardedRef<ConfirmActionRef>): import("react/jsx-runtime").JSX.Element;
91
103
  displayName: string;
@@ -98,25 +110,37 @@ export declare const genRenderer: (defaultProps: Partial<ConfirmActionProps<any,
98
110
  * @param WrappedComponent ConfirmAction component | ConfirmAction组件
99
111
  * @param defaultProps Default properties | 默认属性
100
112
  */
101
- export declare const withDefaultConfirmActionProps: <TP extends object, E extends keyof TP>(WrappedComponent: ComponentType<PropsWithoutRef<ConfirmActionProps<TP, E>> & RefAttributes<ConfirmActionRef>>, defaultProps?: Partial<ConfirmActionProps<TP, E>>) => import("react").ForwardRefExoticComponent<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
113
+ export declare const withDefaultConfirmActionProps: <TP extends object, E extends keyof TP>(WrappedComponent: ComponentType<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
114
+ /**
115
+ * **EN:** Whether to display in red danger mode, which will automatically affect the color of
116
+ * the title, icon, and confirm button. Default is `false`, for DeleteConfirmAction, the
117
+ * defaults is `true`.
118
+ *
119
+ * - You can explicitly set `titleColor`, `iconColor`, and `okButtonProps.type` to override
120
+ *
121
+ * **CN:** 是否显示为红色危险模式,会自动影响标题、图标和确认按钮的颜色。默认`false`,DeleteConfirmAction组件的默认值为`true`。
122
+ *
123
+ * - 可以显式设置`titleColor`、`iconColor`和`okButtonProps.type`来覆盖
124
+ */
125
+ danger?: boolean | undefined;
102
126
  /**
103
127
  * **EN:** The color of confirm box title, default is `warning`
104
128
  *
105
129
  * **CN:** 弹框标题颜色,默认`warning`
106
130
  */
107
- titleColor?: TextProps["type"] | "primary";
131
+ titleColor?: TextProps['type'] | 'primary';
108
132
  /**
109
133
  * **EN:** The color of confirm box content
110
134
  *
111
135
  * **CN:** 弹框内容文本颜色
112
136
  */
113
- contentColor?: TextProps["type"] | "primary";
137
+ contentColor?: TextProps['type'] | 'primary';
114
138
  /**
115
139
  * **EN:** The color of confirm box title icon, default is the same as `titleColor`
116
140
  *
117
141
  * **CN:** 弹框标题图标颜色,默认与`titleColor`相同
118
142
  */
119
- iconColor?: TextProps["type"] | "primary";
143
+ iconColor?: TextProps['type'] | 'primary';
120
144
  /**
121
145
  * **EN:** Callback when click confirm button
122
146
  *
@@ -129,7 +153,51 @@ export declare const withDefaultConfirmActionProps: <TP extends object, E extend
129
153
  *
130
154
  * **CN:** 确认事件完成后的回调,失败时不会触发,参数为`onOk`的返回值
131
155
  */
132
- afterOk?: (data?: any) => void;
156
+ afterOk?: ((data?: any) => void) | undefined;
157
+ } & RefAttributes<ConfirmActionRef>>, defaultProps?: Partial<ConfirmActionProps<TP, E>> | undefined) => import("react").ForwardRefExoticComponent<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
158
+ /**
159
+ * **EN:** Whether to display in red danger mode, which will automatically affect the color of
160
+ * the title, icon, and confirm button. Default is `false`, for DeleteConfirmAction, the
161
+ * defaults is `true`.
162
+ *
163
+ * - You can explicitly set `titleColor`, `iconColor`, and `okButtonProps.type` to override
164
+ *
165
+ * **CN:** 是否显示为红色危险模式,会自动影响标题、图标和确认按钮的颜色。默认`false`,DeleteConfirmAction组件的默认值为`true`。
166
+ *
167
+ * - 可以显式设置`titleColor`、`iconColor`和`okButtonProps.type`来覆盖
168
+ */
169
+ danger?: boolean | undefined;
170
+ /**
171
+ * **EN:** The color of confirm box title, default is `warning`
172
+ *
173
+ * **CN:** 弹框标题颜色,默认`warning`
174
+ */
175
+ titleColor?: TextProps['type'] | 'primary';
176
+ /**
177
+ * **EN:** The color of confirm box content
178
+ *
179
+ * **CN:** 弹框内容文本颜色
180
+ */
181
+ contentColor?: TextProps['type'] | 'primary';
182
+ /**
183
+ * **EN:** The color of confirm box title icon, default is the same as `titleColor`
184
+ *
185
+ * **CN:** 弹框标题图标颜色,默认与`titleColor`相同
186
+ */
187
+ iconColor?: TextProps['type'] | 'primary';
188
+ /**
189
+ * **EN:** Callback when click confirm button
190
+ *
191
+ * **CN:** 点击确认按钮的回调
192
+ */
193
+ onOk?: ((...args: Parameters<TP[E]>) => unknown | Promise<unknown>) | undefined;
194
+ /**
195
+ * **EN:** Callback after confirm event, won't trigger if failed, the argument is the return
196
+ * value of `onOk`
197
+ *
198
+ * **CN:** 确认事件完成后的回调,失败时不会触发,参数为`onOk`的返回值
199
+ */
200
+ afterOk?: ((data?: any) => void) | undefined;
133
201
  } & RefAttributes<ConfirmActionRef>>;
134
202
  /**
135
203
  * **EN:** Interface of generic type component