vap1 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/base.json +30 -0
  2. package/basetype.d.ts +0 -1
  3. package/cems/admin/AsyncSelect.d.ts +45 -0
  4. package/cems/admin/AsyncSelect.js +2 -0
  5. package/cems/admin/CardTable.d.ts +207 -0
  6. package/cems/admin/CardTable.js +2 -0
  7. package/cems/admin/EasyuiTree.d.ts +131 -0
  8. package/cems/admin/EasyuiTree.js +2 -0
  9. package/cems/admin/utils.d.ts +5 -0
  10. package/cems/admin/utils.js +3 -0
  11. package/cems/admin/validator.d.ts +137 -0
  12. package/cems/admin/validator.js +2 -0
  13. package/cems/assets/CUpload.d.ts +23 -0
  14. package/cems/assets/CUpload.js +2 -0
  15. package/cems/assets/Charts.d.ts +37 -0
  16. package/cems/assets/Charts.js +2 -0
  17. package/cems/assets/DInfo.d.ts +38 -0
  18. package/cems/assets/DInfo.js +2 -0
  19. package/cems/assets/DModal.d.ts +84 -0
  20. package/cems/assets/DModal.js +2 -0
  21. package/cems/assets/DTable.d.ts +128 -0
  22. package/cems/assets/DTable.js +2 -0
  23. package/cems/assets/DivWidth.d.ts +14 -0
  24. package/cems/assets/DivWidth.js +2 -0
  25. package/cems/assets/Patch.d.ts +9 -0
  26. package/cems/assets/Patch.js +2 -0
  27. package/cems/assets/Sensitive.d.ts +33 -0
  28. package/cems/assets/Sensitive.js +2 -0
  29. package/cems/assets/types.d.ts +200 -0
  30. package/cems/assets/types.js +2 -0
  31. package/cems/assets/utils.d.ts +61 -0
  32. package/cems/assets/utils.js +2 -0
  33. package/cems/define.d.ts +9 -0
  34. package/cems/define.js +18 -0
  35. package/cems/index.d.ts +228 -0
  36. package/cems/index.js +81 -0
  37. package/cems/policy/CForm.d.ts +133 -0
  38. package/cems/policy/CForm.js +2 -0
  39. package/cems/policy/DApiTable.d.ts +78 -0
  40. package/cems/policy/DApiTable.js +2 -0
  41. package/cems/policy/DButton.d.ts +17 -0
  42. package/cems/policy/DButton.js +2 -0
  43. package/cems/policy/DCheckbox.d.ts +50 -0
  44. package/cems/policy/DCheckbox.js +2 -0
  45. package/cems/policy/DCheckboxGroup.d.ts +34 -0
  46. package/cems/policy/DCheckboxGroup.js +2 -0
  47. package/cems/policy/DCol.d.ts +33 -0
  48. package/cems/policy/DCol.js +2 -0
  49. package/cems/policy/DColorPicker.d.ts +9 -0
  50. package/cems/policy/DColorPicker.js +2 -0
  51. package/cems/policy/DDatePicker.d.ts +41 -0
  52. package/cems/policy/DDatePicker.js +2 -0
  53. package/cems/policy/DDiv.d.ts +65 -0
  54. package/cems/policy/DDiv.js +2 -0
  55. package/cems/policy/DDrawer.d.ts +6 -0
  56. package/cems/policy/DDrawer.js +2 -0
  57. package/cems/policy/DDynamicSelect.d.ts +50 -0
  58. package/cems/policy/DDynamicSelect.js +2 -0
  59. package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
  60. package/cems/policy/DDynamicTreeSelect.js +2 -0
  61. package/cems/policy/DForm.d.ts +248 -0
  62. package/cems/policy/DForm.js +2 -0
  63. package/cems/policy/DIcon.d.ts +33 -0
  64. package/cems/policy/DIcon.js +2 -0
  65. package/cems/policy/DInput.d.ts +41 -0
  66. package/cems/policy/DInput.js +2 -0
  67. package/cems/policy/DLabel.d.ts +17 -0
  68. package/cems/policy/DLabel.js +2 -0
  69. package/cems/policy/DPTable.d.ts +86 -0
  70. package/cems/policy/DPTable.js +2 -0
  71. package/cems/policy/DRadio.d.ts +34 -0
  72. package/cems/policy/DRadio.js +2 -0
  73. package/cems/policy/DSCTable.d.ts +33 -0
  74. package/cems/policy/DSCTable.js +2 -0
  75. package/cems/policy/DSelect.d.ts +42 -0
  76. package/cems/policy/DSelect.js +2 -0
  77. package/cems/policy/DSlider.d.ts +21 -0
  78. package/cems/policy/DSlider.js +2 -0
  79. package/cems/policy/DSwitch.d.ts +21 -0
  80. package/cems/policy/DSwitch.js +2 -0
  81. package/cems/policy/DTab.d.ts +30 -0
  82. package/cems/policy/DTab.js +2 -0
  83. package/cems/policy/DTimePicker.d.ts +37 -0
  84. package/cems/policy/DTimePicker.js +2 -0
  85. package/cems/policy/DTree.d.ts +98 -0
  86. package/cems/policy/DTree.js +2 -0
  87. package/cems/policy/DUpload.d.ts +33 -0
  88. package/cems/policy/DUpload.js +2 -0
  89. package/cems/policy/types.d.ts +200 -0
  90. package/cems/policy/types.js +2 -0
  91. package/cems/policy/utils.d.ts +13 -0
  92. package/cems/policy/utils.js +2 -0
  93. package/components/Box/Box.d.ts +42 -6
  94. package/components/Box/Box.js +66 -16
  95. package/components/Box/SelectBar.d.ts +1 -1
  96. package/components/Box/SelectBar.js +19 -9
  97. package/components/Lists/BaseList.d.ts +5 -0
  98. package/components/Lists/BaseList.js +111 -0
  99. package/components/Lists/Fields/IconRender.d.ts +53 -0
  100. package/components/Lists/Fields/IconRender.js +174 -0
  101. package/components/Lists/Fields/ItemRender.d.ts +2 -0
  102. package/components/Lists/Fields/ItemRender.js +127 -0
  103. package/components/Lists/Fields/_utils.d.ts +3 -0
  104. package/components/Lists/Fields/_utils.js +80 -0
  105. package/components/Lists/Fields/index.d.ts +3 -0
  106. package/components/Lists/Fields/index.js +47 -0
  107. package/components/Lists/Grid/grid.d.ts +7 -0
  108. package/components/Lists/Grid/grid.js +18 -0
  109. package/components/Lists/Grid/index.d.ts +3 -0
  110. package/components/Lists/Grid/index.js +50 -0
  111. package/components/Lists/Row/index.d.ts +3 -0
  112. package/components/Lists/Row/index.js +14 -0
  113. package/components/Lists/SList.js +17 -7
  114. package/components/Lists/Timeline/index.d.ts +3 -0
  115. package/components/Lists/Timeline/index.js +117 -0
  116. package/components/Lists/VList.d.ts +3 -0
  117. package/components/Lists/VList.js +92 -0
  118. package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
  119. package/components/Lists/components/LayoutSwitcher.js +121 -0
  120. package/components/Lists/components/SearchTool.d.ts +13 -0
  121. package/components/Lists/components/SearchTool.js +34 -0
  122. package/components/Lists/index.d.ts +129 -0
  123. package/components/Lists/index.js +2 -0
  124. package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
  125. package/components/SearchTool/SearchBand/BandInput.js +54 -0
  126. package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
  127. package/components/SearchTool/SearchBand/BandTag.js +82 -0
  128. package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
  129. package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
  130. package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
  131. package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
  132. package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
  133. package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
  134. package/components/SearchTool/SearchBand/_register.d.ts +47 -0
  135. package/components/SearchTool/SearchBand/_register.js +15 -0
  136. package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
  137. package/components/SearchTool/SearchBand/hooks.js +181 -0
  138. package/components/SearchTool/SearchBand/index.d.ts +3 -0
  139. package/components/SearchTool/SearchBand/index.js +66 -0
  140. package/components/SearchTool/SearchBand/type.d.ts +71 -0
  141. package/components/SearchTool/SearchBand/type.js +3 -0
  142. package/components/SearchTool/SearchBar/ActionButtons.js +17 -7
  143. package/components/SearchTool/SearchBar/ByField.d.ts +1 -1
  144. package/components/SearchTool/SearchBar/ByField.js +17 -7
  145. package/components/SearchTool/SearchBar/ByKeyword.d.ts +1 -1
  146. package/components/SearchTool/SearchBar/ByKeyword.js +17 -7
  147. package/components/SearchTool/SearchBar/SearchField.d.ts +1 -1
  148. package/components/SearchTool/SearchBar/_register.d.ts +1 -1
  149. package/components/SearchTool/SearchBar/index.d.ts +1 -65
  150. package/components/SearchTool/SearchBar/type.d.ts +133 -0
  151. package/components/SearchTool/SearchBar/type.js +35 -0
  152. package/components/SearchTool/index.d.ts +5 -63
  153. package/components/SearchTool/index.js +5 -0
  154. package/components/Tables/ApiTable.d.ts +5 -7
  155. package/components/Tables/ApiTable.js +17 -7
  156. package/components/Tables/ApiTableModal.d.ts +5 -7
  157. package/components/Tables/ApiTableModal.js +17 -7
  158. package/components/Tables/Components/ActionBar.d.ts +7 -10
  159. package/components/Tables/Components/ActionBar.js +73 -40
  160. package/components/Tables/Components/Actions.d.ts +3 -1
  161. package/components/Tables/Components/Actions.js +40 -3
  162. package/components/Tables/Components/index.d.ts +3 -1
  163. package/components/Tables/Components/useTableContext.d.ts +16 -0
  164. package/components/Tables/Components/useTableContext.js +116 -0
  165. package/components/Tables/STable.js +17 -7
  166. package/components/Tables/TopTable.js +17 -7
  167. package/components/Tables/Util.d.ts +2 -2
  168. package/components/Tables/Util.js +0 -1
  169. package/components/Tables/VTable.d.ts +9 -11
  170. package/components/Tables/VTable.js +119 -172
  171. package/components/Tables/VTableBack.d.ts +0 -0
  172. package/components/Tables/VTableBack.js +269 -0
  173. package/components/Tables/index.d.ts +11 -22
  174. package/components/TreeSelect/BaseTreeSelect.js +17 -7
  175. package/components/TreeSelect/DTreeSelect.js +19 -9
  176. package/components/TreeSelect/FTreeSelect.js +2 -2
  177. package/components/Trees/ActionTree.d.ts +3 -5
  178. package/components/Trees/ActionTree.js +19 -9
  179. package/components/Trees/BaseTree.js +17 -7
  180. package/components/Trees/COTree/COButton.js +17 -7
  181. package/components/Trees/COTree/COSelect.js +17 -7
  182. package/components/Trees/COTree/COTree.js +19 -9
  183. package/components/Trees/DTree.d.ts +0 -7
  184. package/components/Trees/DTree.js +19 -9
  185. package/components/Trees/FTree.js +19 -9
  186. package/components/Trees/STree.js +17 -7
  187. package/components/UForm/FormWrapper.js +17 -7
  188. package/components/UForm/UDescriptions.d.ts +2 -3
  189. package/components/UForm/UDescriptions.js +17 -7
  190. package/components/UForm/UForm.d.ts +1 -1
  191. package/components/UForm/UForm.js +24 -11
  192. package/components/UForm/UFormModal.js +19 -9
  193. package/components/UForm/_input.d.ts +5 -1
  194. package/components/UForm/_input.js +25 -8
  195. package/components/Upload/UploadImage.js +17 -7
  196. package/components/Upload/UploadModal.js +19 -9
  197. package/components/Upload/useUpload.js +2 -2
  198. package/components/_adapt/Alert.js +17 -7
  199. package/components/_adapt/ColorPicker.js +17 -7
  200. package/components/_adapt/Drawer.js +17 -7
  201. package/components/_adapt/Dropdown.js +17 -7
  202. package/components/_adapt/FloatButton.js +17 -7
  203. package/components/_adapt/Input.js +17 -7
  204. package/components/_adapt/InputNumber.js +17 -7
  205. package/components/_adapt/Layout.js +17 -7
  206. package/components/_adapt/Menu.js +17 -7
  207. package/components/_adapt/Modal.js +17 -7
  208. package/components/_adapt/Popconfirm.js +17 -7
  209. package/components/_adapt/Popover.js +17 -7
  210. package/components/_adapt/Progress.js +17 -7
  211. package/components/_adapt/Select.js +17 -7
  212. package/components/_adapt/Table.js +17 -7
  213. package/components/_adapt/Tabs.js +17 -7
  214. package/components/_adapt/Tag.js +17 -7
  215. package/components/_adapt/TreeSelect.js +17 -7
  216. package/components/_adapt/todo/Image.d.ts +0 -1
  217. package/components/_adapt/todo/Segmented.d.ts +0 -1
  218. package/components/_common/AutoComplete.js +35 -12
  219. package/components/_common/CountUp.js +17 -7
  220. package/components/_common/DateRange.d.ts +5 -2
  221. package/components/_common/DateRange.js +43 -40
  222. package/components/_common/HighLight.d.ts +1 -1
  223. package/components/_common/HighLight.js +26 -24
  224. package/components/_common/Loading.js +17 -7
  225. package/components/_common/MonthRange.js +17 -7
  226. package/components/_common/PromiseLabel.js +2 -2
  227. package/components/_common/UTitle.js +17 -7
  228. package/components/_common/Upagination.d.ts +1 -0
  229. package/components/_common/Upagination.js +5 -1
  230. package/components/_i18n.d.ts +1 -102
  231. package/components/index.js +4 -0
  232. package/deps/JsonView.js +17 -7
  233. package/deps/app-audit/LookUp.js +19 -9
  234. package/deps/app-data/useSource.js +19 -9
  235. package/deps/echarts.d.ts +3 -0
  236. package/deps/echarts.js +20 -10
  237. package/deps/editor/Article.js +17 -7
  238. package/deps/editor/Editor.js +17 -7
  239. package/deps/editor/EditorModal.js +17 -7
  240. package/deps/editor/support/buttons/ImageButton.js +17 -7
  241. package/deps/editor/tools/Button.js +0 -2
  242. package/deps/editor/tools/_TxtButton.js +17 -7
  243. package/deps/vapc/_basic.d.ts +1 -0
  244. package/deps/vapc/_basic.js +15 -0
  245. package/deps/vapc/index.d.ts +10 -0
  246. package/deps/vapc/index.js +70 -0
  247. package/hooks/useAjaxAction.js +2 -2
  248. package/hooks/useAjaxQuery.js +2 -2
  249. package/hooks/useApiBase.js +2 -2
  250. package/hooks/useApiGlobal.js +1 -1
  251. package/hooks/useArray.js +2 -2
  252. package/hooks/useDefault.d.ts +0 -1
  253. package/hooks/useDoLoad.d.ts +1 -1
  254. package/hooks/useError.d.ts +1 -1
  255. package/hooks/useMemoPromise.js +2 -2
  256. package/index.d.ts +2 -1
  257. package/login/Base65.d.ts +7 -1
  258. package/login/Base65.js +49 -22
  259. package/login/Password.d.ts +8 -5
  260. package/login/Password.js +68 -102
  261. package/package.json +1 -1
  262. package/screen/Page.js +17 -7
  263. package/screen/vapc-schema/dark.d.ts +1 -0
  264. package/screen/vapc-schema/dark.js +50 -0
  265. package/screen/vapc-schema/insight.d.ts +1 -0
  266. package/screen/vapc-schema/insight.js +49 -0
  267. package/uform/FormEditor.js +17 -7
  268. package/uform/FormViewer.js +17 -7
  269. package/uform/hooks/useEditor.d.ts +0 -1
  270. package/uform/hooks/useForm.d.ts +0 -1
  271. package/uform/inputs/index.d.ts +0 -1
  272. package/uform/panel/Editor/_GroupDefault.js +17 -7
  273. package/uform/panel/Editor/_GroupStep.js +17 -7
  274. package/uform/panel/Editor/_GroupTab.js +17 -7
  275. package/uform/panel/Editor/index.js +17 -7
  276. package/uform/panel/Items/Fields.js +17 -7
  277. package/uform/panel/Items/InputSelector.js +17 -7
  278. package/uform/panel/Items/Inputs.js +17 -7
  279. package/uform/panel/Items/index.d.ts +1 -1
  280. package/uform/panel/Propreties/CanvasProperties.js +17 -7
  281. package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
  282. package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
  283. package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
  284. package/uform/panel/Propreties/Component/Links.js +17 -7
  285. package/uform/panel/Propreties/Component/OptionTable.js +17 -7
  286. package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
  287. package/uform/panel/Propreties/Component/Validate.js +17 -7
  288. package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
  289. package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
  290. package/uform/panel/Propreties/FieldOptions.js +17 -7
  291. package/uform/panel/Propreties/FieldProperties.js +17 -7
  292. package/uform/panel/Propreties/_ItemAdvance.js +17 -7
  293. package/uform/panel/Propreties/_ItemBase.js +17 -7
  294. package/uform/panel/Propreties/_ItemLink.js +17 -7
  295. package/uform/panel/Propreties/_ItemValidate.js +17 -7
  296. package/uform/schema.d.ts +1 -1
  297. package/uform/utils/Convert.js +2 -2
  298. package/utils/Ajax.d.ts +3 -0
  299. package/utils/Ajax.js +10 -7
  300. package/utils/CacheUtil.d.ts +1 -1
  301. package/utils/Const.js +17 -7
  302. package/utils/Format.d.ts +138 -14
  303. package/utils/Format.js +127 -13
  304. package/utils/Global.d.ts +12 -0
  305. package/utils/Global.js +7 -1
  306. package/utils/PageUtil.d.ts +111 -23
  307. package/utils/PageUtil.js +163 -28
  308. package/utils/Renders/ApiGetRender.js +20 -10
  309. package/utils/Renders/ApiPostRender.js +3 -3
  310. package/utils/Renders/CondictionRender.js +17 -7
  311. package/utils/Renders/DateRender.js +20 -2
  312. package/utils/Renders/ListRender.js +1 -1
  313. package/utils/Renders/NumberRender.js +24 -5
  314. package/utils/Renders/StringRender.js +81 -11
  315. package/utils/Renders/_define.d.ts +8 -7
  316. package/utils/Renders/_define.js +76 -17
  317. package/utils/StringUtil.d.ts +292 -62
  318. package/utils/StringUtil.js +310 -63
  319. package/utils/TreeUtil.js +14 -10
  320. package/utils/VAP.d.ts +26 -1
  321. package/utils/VAP.js +57 -0
  322. package/utils/_AjaxUtil.d.ts +1 -0
  323. package/utils/_AjaxUtil.js +70 -3
  324. package/utils/_Support.d.ts +2 -2
  325. package/utils/_Support.js +4 -2
  326. package/utils/crontab/crontabRender.js +0 -1
  327. package/utils/i18n.d.ts +13 -2
  328. package/utils/i18n.js +13 -2
  329. package/utils/index.d.ts +4 -0
  330. package/utils/index.js +19 -9
  331. package/components/SearchTool/_FieldType.d.ts +0 -8
  332. package/components/SearchTool/_FieldType.js +0 -51
@@ -1,17 +1,82 @@
1
1
  "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
2
18
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
19
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getList = exports.convertValue = exports.getValue = void 0;
22
+ exports.getList = exports.convertValue = exports.getValue = exports.getStyles = void 0;
7
23
  var react_1 = __importDefault(require("react"));
8
24
  var lodash_1 = __importDefault(require("lodash"));
9
25
  var Const_1 = require("../Const");
10
- var getValue = function (txt, options) {
26
+ var getStyles = function (value, options) {
27
+ if (options == null || options.onlyText)
28
+ return [undefined, undefined];
29
+ var clazz = [];
30
+ if (options.className) {
31
+ if (lodash_1.default.isString(options.className)) {
32
+ clazz.push(options.className);
33
+ }
34
+ else if (lodash_1.default.isFunction(options.className)) {
35
+ clazz.push(options.className(value));
36
+ }
37
+ }
38
+ if (options.bold) {
39
+ if (lodash_1.default.isBoolean(options.bold)) {
40
+ clazz.push('font-bold');
41
+ }
42
+ else if (lodash_1.default.isFunction(options.bold) && options.bold(value)) {
43
+ clazz.push('font-bold');
44
+ }
45
+ }
46
+ ;
47
+ if (options.italic) {
48
+ if (lodash_1.default.isBoolean(options.italic)) {
49
+ clazz.push('font-italic');
50
+ }
51
+ else if (lodash_1.default.isFunction(options.italic) && options.italic(value)) {
52
+ clazz.push('font-italic');
53
+ }
54
+ }
55
+ if (options.underline) {
56
+ if (lodash_1.default.isBoolean(options.underline)) {
57
+ clazz.push('font-underline');
58
+ }
59
+ else if (lodash_1.default.isFunction(options.underline) && options.underline(value)) {
60
+ clazz.push('font-underline');
61
+ }
62
+ }
63
+ var style = undefined;
64
+ if (options.color) {
65
+ if (lodash_1.default.isString(options.color)) {
66
+ style = { color: options.color };
67
+ }
68
+ else if (lodash_1.default.isFunction(options.color)) {
69
+ style = { color: options.color(value) };
70
+ }
71
+ }
72
+ return [clazz.length ? clazz.join(' ') : undefined, style];
73
+ };
74
+ exports.getStyles = getStyles;
75
+ var getValue = function (label, value, options) {
11
76
  if (options == null)
12
- return txt || Const_1.NONE;
77
+ return label || Const_1.NONE;
13
78
  var str;
14
- if (txt == null) {
79
+ if (label == null) {
15
80
  if (options.default)
16
81
  return options.default;
17
82
  if (options.format) {
@@ -19,24 +84,18 @@ var getValue = function (txt, options) {
19
84
  }
20
85
  }
21
86
  else {
22
- str = txt;
87
+ str = label;
23
88
  }
24
89
  if (options.len && str.length > options.len) {
25
90
  str = str.substring(0, options.len) + '...';
26
91
  }
27
- var clazz = [];
28
- if (options.className)
29
- clazz.push(options.className);
30
- if (options.bold)
31
- clazz.push('font-bold');
32
- if (options.italic)
33
- clazz.push('font-italic');
34
- if (options.underline)
35
- clazz.push('font-underline');
36
- var style = options.color ? { color: options.color } : undefined;
37
- if (options.onlyText || (clazz.length == 0 && style == undefined))
92
+ if (options.onlyText)
38
93
  return str;
39
- return react_1.default.createElement("span", { className: clazz.join(' '), style: style, title: txt }, str);
94
+ var _a = __read((0, exports.getStyles)(value, options), 2), clazz = _a[0], style = _a[1];
95
+ if (clazz || style) {
96
+ return react_1.default.createElement("span", { className: clazz, style: style, title: label }, str);
97
+ }
98
+ return str;
40
99
  };
41
100
  exports.getValue = getValue;
42
101
  var convertValue = function (value, config) {
@@ -1,132 +1,362 @@
1
1
  import { spellMatch } from './py';
2
2
  import type { MatchPatterns } from './py';
3
+ /**
4
+ * 邮箱地址正则表达式
5
+ */
3
6
  export declare const REG_EMAIL: RegExp;
7
+ /**
8
+ * 手机号码正则表达式
9
+ */
4
10
  export declare const REG_PHONE: RegExp;
11
+ /**
12
+ * 固定电话正则表达式
13
+ */
5
14
  export declare const REG_TELEPHONE: RegExp;
15
+ /**
16
+ * 英文字母集合
17
+ */
6
18
  export declare const LETTERS: Set<string>;
19
+ /**
20
+ * IPv4地址正则表达式
21
+ */
7
22
  export declare const REG_IPV4: RegExp;
23
+ /**
24
+ * IPv6地址正则表达式
25
+ */
8
26
  export declare const REG_IPV6: RegExp;
27
+ /**
28
+ * URL地址正则表达式
29
+ */
9
30
  export declare const REG_URL: RegExp;
31
+ /**
32
+ * 端口号正则表达式
33
+ */
10
34
  export declare const REG_PORT: RegExp;
11
35
  /**
12
- * 是否为一个手机号码
13
- */
36
+ * 判断是否为手机号码
37
+ * @param txt - 待验证的字符串
38
+ * @returns 是否为有效的手机号码
39
+ *
40
+ * @example
41
+ * isMobilePhone('13812345678') // => true
42
+ * isMobilePhone('1381234567') // => false
43
+ */
14
44
  export declare const isMobilePhone: (txt: string) => boolean;
15
45
  /**
16
- * 是否为一个固话号码
17
- */
46
+ * 判断是否为固定电话号码
47
+ * @param txt - 待验证的字符串
48
+ * @returns 是否为有效的固定电话号码
49
+ *
50
+ * @example
51
+ * isTelePhone('010-12345678') // => true
52
+ * isTelePhone('010123456789') // => false
53
+ */
18
54
  export declare const isTelePhone: (txt: string) => boolean;
19
55
  /**
20
- * 是否为一个Email地址
21
- */
56
+ * 判断是否为Email地址
57
+ * @param txt - 待验证的字符串
58
+ * @returns 是否为有效的Email地址
59
+ *
60
+ * @example
61
+ * isEmail('user@example.com') // => true
62
+ * isEmail('invalid.email') // => false
63
+ */
22
64
  export declare const isEmail: (txt: string) => boolean;
23
65
  /**
24
- * 是否为一个URL地址
25
- */
66
+ * 判断是否为URL地址
67
+ * @param txt - 待验证的字符串
68
+ * @returns 是否为有效的URL地址
69
+ *
70
+ * @example
71
+ * isURL('https://www.example.com') // => true
72
+ * isURL('invalid-url') // => false
73
+ */
26
74
  export declare const isURL: (txt: string) => boolean;
27
75
  /**
28
- * 是否为一个Mac地址
29
- */
76
+ * 判断是否为MAC地址
77
+ * @param txt - 待验证的字符串
78
+ * @returns 是否为有效的MAC地址
79
+ *
80
+ * @example
81
+ * isMAC('00:11:22:33:44:55') // => true
82
+ * isMAC('00-11-22-33-44-55') // => true
83
+ * isMAC('001122334455') // => true
84
+ * isMAC('invalid-mac') // => false
85
+ */
30
86
  export declare const isMAC: (txt: string) => boolean;
31
87
  /**
32
- * 是否为一个电话号码,支持固定电话和手机
33
- */
88
+ * 判断是否为电话号码(支持固定电话和手机)
89
+ * @param txt - 待验证的字符串
90
+ * @returns 是否为有效的电话号码
91
+ *
92
+ * @example
93
+ * isPhone('13812345678') // => true
94
+ * isPhone('010-12345678') // => true
95
+ * isPhone('invalid-phone') // => false
96
+ */
34
97
  export declare const isPhone: (txt: string) => boolean;
35
98
  type IP_VERSION = '' | '4' | '6';
99
+ /**
100
+ * 判断是否为IPv4地址
101
+ * @param str - 待验证的字符串
102
+ * @returns 是否为有效的IPv4地址
103
+ *
104
+ * @example
105
+ * isIP4('192.168.1.1') // => true
106
+ * isIP4('256.1.2.3') // => false
107
+ */
36
108
  export declare const isIP4: (str: string) => boolean;
109
+ /**
110
+ * 判断是否为IPv6地址
111
+ * @param str - 待验证的字符串
112
+ * @returns 是否为有效的IPv6地址
113
+ *
114
+ * @example
115
+ * isIP6('2001:0db8:85a3:0000:0000:8a2e:0370:7334') // => true
116
+ * isIP6('invalid-ipv6') // => false
117
+ */
37
118
  export declare const isIP6: (str: string) => boolean;
38
119
  /**
39
- * 判断是否是一个 IP 地址,默认
40
- * @param str : 要判断的字符串
41
- * @param version : IP版本,默认为 IP4, 如果要同时 46, 传 空字串 :''
42
- */
120
+ * 判断是否为IP地址
121
+ * @param str - 待验证的字符串
122
+ * @param version - IP版本('4'|'6'|''),默认为'4'。空字符串表示同时支持IPv4和IPv6
123
+ * @returns 是否为有效的IP地址
124
+ *
125
+ * @example
126
+ * isIP('192.168.1.1', '4') // => true
127
+ * isIP('2001:0db8:85a3:0000:0000:8a2e:0370:7334', '6') // => true
128
+ * isIP('192.168.1.1', '') // => true
129
+ */
43
130
  export declare const isIP: (str: string, version?: IP_VERSION) => boolean;
44
131
  export declare const REG_ID_18: RegExp;
45
132
  export declare const REG_ID_15: RegExp;
46
133
  /**
47
- * 判断是否是一个18位身份证号
48
- * @param txt : 要判断的字符串
49
- * @param strict : 是否开启严格校验,默认开启
50
- */
134
+ * 判断是否为18位身份证号
135
+ * @param txt - 待验证的字符串
136
+ * @param strict - 是否开启严格校验,默认为true
137
+ * @returns 是否为有效的18位身份证号
138
+ *
139
+ * @example
140
+ * isId18('110101199001011234') // => true
141
+ * isId18('11010119900101123X') // => true
142
+ * isId18('invalid-id', false) // => false
143
+ */
51
144
  export declare const isId18: (txt: string, strict?: boolean) => boolean;
52
145
  /**
53
- * 判断是否是一个15位身份证号
54
- * @param txt : 要判断的字符串
55
- * @param strict : 是否开启严格校验,默认开启,
56
- * 15位身份证号,只会判定省份与年份,不检验哈希,性别
146
+ * 判断是否为15位身份证号
147
+ * @param txt - 待验证的字符串
148
+ * @param strict - 是否开启严格校验,默认为true
149
+ * @returns 是否为有效的15位身份证号
57
150
  *
58
- */
151
+ * @example
152
+ * isId15('110101900101123') // => true
153
+ * isId15('invalid-id', false) // => false
154
+ */
59
155
  export declare const isId15: (txt: string, strict?: boolean) => boolean;
60
156
  /**
61
- * 判断是否是一个身份证号,支持18位和15
62
- * @param txt : 要判断的字符串
63
- * @param strict : 是否开启严格校验,默认开启
64
- */
157
+ * 判断是否为身份证号(支持15位和18位)
158
+ * @param txt - 待验证的字符串
159
+ * @param strict - 是否开启严格校验,默认为true
160
+ * @returns 是否为有效的身份证号
161
+ *
162
+ * @example
163
+ * isId('110101199001011234') // => true
164
+ * isId('110101900101123') // => true
165
+ * isId('invalid-id', false) // => false
166
+ */
65
167
  export declare const isId: (txt: string, strict?: boolean) => boolean;
66
168
  /**
67
- * 生成一个唯一 ID 标识
68
- */
169
+ * 生成唯一ID标识
170
+ * @returns 生成的唯一ID字符串
171
+ *
172
+ * @example
173
+ * genKey() // => "1a2b3c"
174
+ */
69
175
  export declare const genKey: () => string;
70
176
  /**
71
- * 生成uuid
72
- */
177
+ * 生成UUID
178
+ * @returns 生成的UUID字符串
179
+ *
180
+ * @example
181
+ * uuid() // => "550e8400-e29b-41d4-a716-446655440000"
182
+ */
73
183
  export declare const uuid: () => string;
74
184
  /**
75
- * 是否是一个 BTC 地址
76
- */
185
+ * 判断是否为BTC地址
186
+ * @param str - 待验证的字符串
187
+ * @returns 是否为有效的BTC地址
188
+ *
189
+ * @example
190
+ * isBTCAddress('1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2') // => true
191
+ * isBTCAddress('invalid-address') // => false
192
+ */
77
193
  export declare const isBTCAddress: (str: string) => boolean;
78
194
  /**
79
- * 说明:不能判断 变量类型,为 vap 内置识别方法
80
- * 可为 Boolean 的有字符串有 0 / 1 / true / false / yes / no
81
- * 通过 getBoolean 可获取到对应的 bool 值
82
- */
195
+ * 判断字符串是否可以转换为布尔值
196
+ * @param str - 待验证的字符串
197
+ * @returns 是否可以转换为布尔值
198
+ *
199
+ * @example
200
+ * isBoolean('true') // => true
201
+ * isBoolean('yes') // => true
202
+ * isBoolean('0') // => true
203
+ * isBoolean('invalid') // => false
204
+ */
83
205
  export declare const isBoolean: (str: string) => boolean;
84
206
  /**
85
- * 清空首尾空格,并小写
86
- */
207
+ * 清空字符串首尾空格并转换为小写
208
+ * @param str - 输入字符串
209
+ * @returns 处理后的字符串
210
+ *
211
+ * @example
212
+ * trimLower(' Hello World ') // => "hello world"
213
+ */
87
214
  export declare const trimLower: (str: string) => string;
88
215
  export { spellMatch };
89
216
  /**
90
- * 搜索,用于高亮,通常与 HighLight 结合使用,或只使用 HighLight 组件
91
- */
217
+ * 搜索文本并返回匹配结果,用于高亮显示
218
+ * @param sentence - 待搜索的文本
219
+ * @param keyword - 搜索关键词
220
+ * @returns 匹配结果数组
221
+ *
222
+ * @example
223
+ * searchText('Hello World', 'world') // => [{hit: false, text: 'Hello '}, {hit: true, text: 'World'}]
224
+ */
92
225
  export declare const searchText: (sentence: string, keyword: string) => MatchPatterns[];
93
226
  /**
94
- * 拼 className
95
- */
227
+ * 合并CSS类名
228
+ * @param base - 基础类名数组
229
+ * @param classNameProps - 额外的类名
230
+ * @returns 合并后的类名字符串
231
+ *
232
+ * @example
233
+ * className(['btn', 'primary'], 'large') // => "btn primary large"
234
+ */
96
235
  export declare const className: (base: string[], classNameProps?: string) => string;
236
+ /**
237
+ * 替换字符串中所有匹配的内容
238
+ * @param text - 原始字符串
239
+ * @param keyword - 要替换的关键词或正则表达式
240
+ * @param replaceText - 替换后的文本
241
+ * @returns 替换后的字符串
242
+ *
243
+ * @example
244
+ * replaceAll('hello world', 'o', '0') // => "hell0 w0rld"
245
+ */
97
246
  export declare const replaceAll: (text: string, keyword: string | RegExp, replaceText: string) => string;
98
247
  /**
99
- * 试图转px的值
100
- * 300px -> 300
101
- */
248
+ * 将字符串转换为像素值
249
+ * @param str - 输入的数字或字符串
250
+ * @returns 转换后的像素值数字
251
+ *
252
+ * @example
253
+ * px('300px') // => 300
254
+ * px(300) // => 300
255
+ * px('invalid') // => 0
256
+ */
102
257
  export declare const px: (str: number | string) => number;
103
258
  /**
104
- * 复制字符串
105
- */
259
+ * 复制文本到剪贴板
260
+ * @param text - 要复制的文本
261
+ * @param onCopied - 复制成功后的回调函数
262
+ *
263
+ * @example
264
+ * copy('Hello World', (text) => console.log(`Copied: ${text}`))
265
+ */
106
266
  export declare const copy: (text: string, onCopied?: (txt: any) => void) => void;
107
267
  /**
108
- * 获取字符串
109
- */
268
+ * 获取字符串值,空字符串返回默认值
269
+ * @param txt - 输入字符串
270
+ * @param defaultValue - 默认值
271
+ * @returns 处理后的字符串
272
+ *
273
+ * @example
274
+ * getString(' hello ') // => "hello"
275
+ * getString('', 'default') // => "default"
276
+ */
110
277
  export declare const getString: (txt: string, defaultValue?: string) => string;
111
278
  /**
112
279
  * 获取布尔值
113
- */
280
+ * @param key - 输入字符串
281
+ * @param defaultValue - 默认值
282
+ * @returns 转换后的布尔值
283
+ *
284
+ * @example
285
+ * getBoolean('true') // => true
286
+ * getBoolean('yes') // => true
287
+ * getBoolean('invalid', true) // => true
288
+ */
114
289
  export declare const getBoolean: (key: string, defaultValue?: boolean) => boolean;
115
290
  /**
116
- * 获取数字
117
- */
291
+ * 获取整数值
292
+ * @param txt - 输入字符串
293
+ * @param defaultValue - 默认值
294
+ * @returns 转换后的整数
295
+ *
296
+ * @example
297
+ * getInteger('123') // => 123
298
+ * getInteger('invalid', 0) // => 0
299
+ */
118
300
  export declare const getInteger: (txt: string, defaultValue?: number) => number;
119
301
  /**
120
- * 获取浮点数
121
- */
302
+ * 获取浮点数值
303
+ * @param txt - 输入字符串
304
+ * @param defaultValue - 默认值
305
+ * @returns 转换后的浮点数
306
+ *
307
+ * @example
308
+ * getFloat('123.45') // => 123.45
309
+ * getFloat('invalid', 0) // => 0
310
+ */
122
311
  export declare const getFloat: (txt: string, defaultValue?: number) => number;
312
+ /**
313
+ * 获取文件名
314
+ * @param uri - 文件路径
315
+ * @returns 文件名
316
+ *
317
+ * @example
318
+ * getFileName('/path/to/file.txt') // => "file.txt"
319
+ */
123
320
  export declare const getFileName: (uri: string) => string;
124
321
  /**
125
- * 获取文件后缀名,并以小写的形式返回
126
- */
322
+ * 获取文件后缀名
323
+ * @param fileName - 文件名
324
+ * @returns 小写的文件后缀名
325
+ *
326
+ * @example
327
+ * getSuffix('image.JPG') // => "jpg"
328
+ */
127
329
  export declare const getSuffix: (fileName: string) => string;
128
- type FileType = 'image' | 'pdf' | 'doc' | 'excel' | 'ppt' | 'zip' | 'video' | 'audio' | 'unknown';
330
+ type FileType = 'image' | 'pdf' | 'doc' | 'excel' | 'ppt' | 'zip' | 'video' | 'xml' | 'audio' | 'unknown';
129
331
  /**
130
- * 获取文件类及 icon
131
- */
332
+ * 获取文件类型和对应的图标
333
+ * @param fileName - 文件名
334
+ * @returns [文件类型, 图标名称]
335
+ *
336
+ * @example
337
+ * getFileType('document.pdf') // => ['pdf', 'file-pdf']
338
+ * getFileType('image.jpg') // => ['image', 'file-image']
339
+ */
132
340
  export declare const getFileType: (fileName: string) => [FileType, string];
341
+ /**
342
+ * 计算占比
343
+ * @param count - 分子
344
+ * @param total - 分母
345
+ * @returns 比率(0-1之间的小数)
346
+ *
347
+ * @example
348
+ * ratio(4, 10) // => 0.4
349
+ * ratio(0, 10) // => 0
350
+ */
351
+ export declare const ratio: (count: number, total: number) => number;
352
+ /**
353
+ * 计算增长率
354
+ * @param current - 当前值
355
+ * @param prev - 上一个值
356
+ * @returns 增长率(-1到1之间的小数)
357
+ *
358
+ * @example
359
+ * rise(120, 100) // => 0.2
360
+ * rise(80, 100) // => -0.2
361
+ */
362
+ export declare const rise: (current: number, prev: number) => number;