orion-design 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. package/README.md +5 -0
  2. package/dist/Throne/index.d.ts +18 -0
  3. package/dist/Throne/index.js +20 -0
  4. package/dist/Throne/index.js.map +1 -0
  5. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  6. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  7. package/dist/components/Button/Button.vue.d.ts +2 -0
  8. package/dist/components/Button/index.d.ts +2 -0
  9. package/dist/components/Button/index.js +27 -0
  10. package/dist/components/Button/index.js.map +1 -0
  11. package/dist/components/Flex/Col.d.ts +4 -4
  12. package/dist/components/Flex/Item.d.ts +4 -4
  13. package/dist/components/Flex/Row.d.ts +4 -4
  14. package/dist/components/Flex/index.d.ts +4 -4
  15. package/dist/components/Flex/index.js +95 -127
  16. package/dist/components/Flex/index.js.map +1 -0
  17. package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
  18. package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
  19. package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
  20. package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  21. package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
  22. package/dist/components/Form/ButtonGroup/index.js +2 -0
  23. package/dist/components/Form/ButtonGroup/index.js.map +1 -0
  24. package/dist/components/Form/Checkbox/Checkbox.d.ts +10 -0
  25. package/dist/components/Form/Checkbox/Checkbox.js +2 -0
  26. package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
  27. package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
  28. package/dist/components/Form/Checkbox/index.d.ts +1 -0
  29. package/dist/components/Form/Checkbox/index.js +2 -0
  30. package/dist/components/Form/Checkbox/index.js.map +1 -0
  31. package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
  32. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
  33. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
  34. package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
  35. package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
  36. package/dist/components/Form/CheckboxGroup/index.js +2 -0
  37. package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
  38. package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
  39. package/dist/components/Form/DateInput/DateInput.js +2 -0
  40. package/dist/components/Form/DateInput/DateInput.js.map +1 -0
  41. package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
  42. package/dist/components/Form/DateInput/index.d.ts +1 -0
  43. package/dist/components/Form/DateInput/index.js +2 -0
  44. package/dist/components/Form/DateInput/index.js.map +1 -0
  45. package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
  46. package/dist/components/Form/FileInput/FileInput.js +2 -0
  47. package/dist/components/Form/FileInput/FileInput.js.map +1 -0
  48. package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
  49. package/dist/components/Form/FileInput/index.d.ts +1 -0
  50. package/dist/components/Form/FileInput/index.js +2 -0
  51. package/dist/components/Form/FileInput/index.js.map +1 -0
  52. package/dist/components/Form/Form.d.ts +21 -0
  53. package/dist/components/Form/Form.js +5 -0
  54. package/dist/components/Form/Form.js.map +1 -0
  55. package/dist/components/Form/Form.vue.d.ts +465 -0
  56. package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
  57. package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
  58. package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
  59. package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
  60. package/dist/components/Form/MultiSelect/index.d.ts +1 -0
  61. package/dist/components/Form/MultiSelect/index.js +2 -0
  62. package/dist/components/Form/MultiSelect/index.js.map +1 -0
  63. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +13 -0
  64. package/dist/components/Form/PasswordInput/PasswordInput.js +2 -0
  65. package/dist/components/Form/PasswordInput/PasswordInput.js.map +1 -0
  66. package/dist/components/Form/PasswordInput/PasswordInput.vue.d.ts +3 -0
  67. package/dist/components/Form/PasswordInput/index.d.ts +1 -0
  68. package/dist/components/Form/PasswordInput/index.js +2 -0
  69. package/dist/components/Form/PasswordInput/index.js.map +1 -0
  70. package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
  71. package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
  72. package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
  73. package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
  74. package/dist/components/Form/RadioGroup/index.d.ts +1 -0
  75. package/dist/components/Form/RadioGroup/index.js +2 -0
  76. package/dist/components/Form/RadioGroup/index.js.map +1 -0
  77. package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
  78. package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
  79. package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
  80. package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
  81. package/dist/components/Form/SingleSelect/index.d.ts +1 -0
  82. package/dist/components/Form/SingleSelect/index.js +2 -0
  83. package/dist/components/Form/SingleSelect/index.js.map +1 -0
  84. package/dist/components/Form/StringInput/StringInput.d.ts +13 -0
  85. package/dist/components/Form/StringInput/StringInput.js +2 -0
  86. package/dist/components/Form/StringInput/StringInput.js.map +1 -0
  87. package/dist/components/Form/StringInput/StringInput.vue.d.ts +3 -0
  88. package/dist/components/Form/StringInput/index.d.ts +1 -0
  89. package/dist/components/Form/StringInput/index.js +2 -0
  90. package/dist/components/Form/StringInput/index.js.map +1 -0
  91. package/dist/components/Form/Switch/Switch.d.ts +10 -0
  92. package/dist/components/Form/Switch/Switch.js +2 -0
  93. package/dist/components/Form/Switch/Switch.js.map +1 -0
  94. package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
  95. package/dist/components/Form/Switch/index.d.ts +1 -0
  96. package/dist/components/Form/Switch/index.js +2 -0
  97. package/dist/components/Form/Switch/index.js.map +1 -0
  98. package/dist/components/Form/Textarea/Textarea.d.ts +14 -0
  99. package/dist/components/Form/Textarea/Textarea.js +2 -0
  100. package/dist/components/Form/Textarea/Textarea.js.map +1 -0
  101. package/dist/components/Form/Textarea/Textarea.vue.d.ts +3 -0
  102. package/dist/components/Form/Textarea/index.d.ts +1 -0
  103. package/dist/components/Form/Textarea/index.js +2 -0
  104. package/dist/components/Form/Textarea/index.js.map +1 -0
  105. package/dist/components/Form/hooks/useForm.d.ts +7 -0
  106. package/dist/components/Form/hooks/useForm.js +44 -0
  107. package/dist/components/Form/hooks/useForm.js.map +1 -0
  108. package/dist/components/Form/index.d.ts +301 -0
  109. package/dist/components/Form/index.js +660 -0
  110. package/dist/components/Form/index.js.map +1 -0
  111. package/dist/components/Form/utils/index.d.ts +8 -0
  112. package/dist/components/Form/utils/index.js +26 -0
  113. package/dist/components/Form/utils/index.js.map +1 -0
  114. package/dist/components/Modal/index.d.ts +1 -14
  115. package/dist/components/Modal/useModal.d.ts +1 -1
  116. package/dist/components/Modal/useModal.js +7 -7
  117. package/dist/components/Modal/useModal.js.map +1 -0
  118. package/dist/components/Pagetable/Pagetable.d.ts +91 -0
  119. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
  120. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
  121. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +101 -0
  122. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
  123. package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
  124. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
  125. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
  126. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
  127. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +75 -0
  128. package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
  129. package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
  130. package/dist/components/Pagetable/hooks/useColumns.js +96 -0
  131. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
  132. package/dist/components/Pagetable/index.d.ts +85 -0
  133. package/dist/components/Pagetable/index.js +521 -0
  134. package/dist/components/Pagetable/index.js.map +1 -0
  135. package/dist/components/Pagetable/interface.d.ts +10 -0
  136. package/dist/components/Pagetable/interface.js +2 -0
  137. package/dist/components/Pagetable/interface.js.map +1 -0
  138. package/dist/components/Pagetable/utils/index.d.ts +15 -0
  139. package/dist/components/Pagetable/utils/index.js +169 -0
  140. package/dist/components/Pagetable/utils/index.js.map +1 -0
  141. package/dist/components/Space/index.d.ts +12 -12
  142. package/dist/components/_util/arrays.d.ts +5 -0
  143. package/dist/components/_util/arrays.js +8 -0
  144. package/dist/components/_util/arrays.js.map +1 -0
  145. package/dist/components/_util/browser.d.ts +3 -0
  146. package/dist/components/_util/browser.js +9 -0
  147. package/dist/components/_util/browser.js.map +1 -0
  148. package/dist/components/_util/classNames.js +20 -27
  149. package/dist/components/_util/classNames.js.map +1 -0
  150. package/dist/components/_util/dom/aria.d.ts +30 -0
  151. package/dist/components/_util/dom/aria.js +46 -0
  152. package/dist/components/_util/dom/aria.js.map +1 -0
  153. package/dist/components/_util/dom/element.d.ts +3 -0
  154. package/dist/components/_util/dom/element.js +18 -0
  155. package/dist/components/_util/dom/element.js.map +1 -0
  156. package/dist/components/_util/dom/event.d.ts +6 -0
  157. package/dist/components/_util/dom/event.js +10 -0
  158. package/dist/components/_util/dom/event.js.map +1 -0
  159. package/dist/components/_util/dom/index.d.ts +6 -0
  160. package/dist/components/_util/dom/index.js +39 -0
  161. package/dist/components/_util/dom/index.js.map +1 -0
  162. package/dist/components/_util/dom/position.d.ts +7 -0
  163. package/dist/components/_util/dom/position.js +30 -0
  164. package/dist/components/_util/dom/position.js.map +1 -0
  165. package/dist/components/_util/dom/scroll.d.ts +11 -0
  166. package/dist/components/_util/dom/scroll.js +78 -0
  167. package/dist/components/_util/dom/scroll.js.map +1 -0
  168. package/dist/components/_util/dom/style.d.ts +9 -0
  169. package/dist/components/_util/dom/style.js +58 -0
  170. package/dist/components/_util/dom/style.js.map +1 -0
  171. package/dist/components/_util/easings.d.ts +1 -0
  172. package/dist/components/_util/easings.js +8 -0
  173. package/dist/components/_util/easings.js.map +1 -0
  174. package/dist/components/_util/error.d.ts +3 -0
  175. package/dist/components/_util/error.js +22 -0
  176. package/dist/components/_util/error.js.map +1 -0
  177. package/dist/components/_util/functions.d.ts +1 -0
  178. package/dist/components/_util/functions.js +6 -0
  179. package/dist/components/_util/functions.js.map +1 -0
  180. package/dist/components/_util/i18n.d.ts +1 -0
  181. package/dist/components/_util/i18n.js +5 -0
  182. package/dist/components/_util/i18n.js.map +1 -0
  183. package/dist/components/_util/index.d.ts +15 -0
  184. package/dist/components/_util/index.js +140 -0
  185. package/dist/components/_util/index.js.map +1 -0
  186. package/dist/components/_util/isValid.js +4 -4
  187. package/dist/components/_util/isValid.js.map +1 -0
  188. package/dist/components/_util/objects.d.ts +8 -0
  189. package/dist/components/_util/objects.js +17 -0
  190. package/dist/components/_util/objects.js.map +1 -0
  191. package/dist/components/_util/props-util/index.d.ts +4 -4
  192. package/dist/components/_util/props-util/index.js +23 -50
  193. package/dist/components/_util/props-util/index.js.map +1 -0
  194. package/dist/components/_util/props-util/initDefaultProps.d.ts +2 -2
  195. package/dist/components/_util/props-util/initDefaultProps.js +13 -24
  196. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -0
  197. package/dist/components/_util/raf.d.ts +2 -0
  198. package/dist/components/_util/raf.js +7 -0
  199. package/dist/components/_util/raf.js.map +1 -0
  200. package/dist/components/_util/rand.d.ts +12 -0
  201. package/dist/components/_util/rand.js +6 -0
  202. package/dist/components/_util/rand.js.map +1 -0
  203. package/dist/components/_util/strings.d.ts +6 -0
  204. package/dist/components/_util/strings.js +11 -0
  205. package/dist/components/_util/strings.js.map +1 -0
  206. package/dist/components/_util/throttleByRaf.d.ts +4 -0
  207. package/dist/components/_util/throttleByRaf.js +16 -0
  208. package/dist/components/_util/throttleByRaf.js.map +1 -0
  209. package/dist/components/_util/type.d.ts +5 -1
  210. package/dist/components/_util/type.js +52 -65
  211. package/dist/components/_util/type.js.map +1 -0
  212. package/dist/components/_util/types.d.ts +10 -0
  213. package/dist/components/_util/types.js +25 -0
  214. package/dist/components/_util/types.js.map +1 -0
  215. package/dist/components/_util/typescript.d.ts +12 -0
  216. package/dist/components/_util/typescript.js +5 -0
  217. package/dist/components/_util/typescript.js.map +1 -0
  218. package/dist/components/_util/util.d.ts +1 -1
  219. package/dist/components/_util/util.js +46 -74
  220. package/dist/components/_util/util.js.map +1 -0
  221. package/dist/components/_util/vue/global-node.d.ts +3 -0
  222. package/dist/components/_util/vue/global-node.js +21 -0
  223. package/dist/components/_util/vue/global-node.js.map +1 -0
  224. package/dist/components/_util/vue/icon.d.ts +23 -0
  225. package/dist/components/_util/vue/icon.js +154 -0
  226. package/dist/components/_util/vue/icon.js.map +1 -0
  227. package/dist/components/_util/vue/index.d.ts +9 -0
  228. package/dist/components/_util/vue/index.js +44 -0
  229. package/dist/components/_util/vue/index.js.map +1 -0
  230. package/dist/components/_util/vue/install.d.ts +6 -0
  231. package/dist/components/_util/vue/install.js +21 -0
  232. package/dist/components/_util/vue/install.js.map +1 -0
  233. package/dist/components/_util/vue/props/index.d.ts +3 -0
  234. package/dist/components/_util/vue/props/index.js +9 -0
  235. package/dist/components/_util/vue/props/index.js.map +1 -0
  236. package/dist/components/_util/vue/props/runtime.d.ts +29 -0
  237. package/dist/components/_util/vue/props/runtime.js +37 -0
  238. package/dist/components/_util/vue/props/runtime.js.map +1 -0
  239. package/dist/components/_util/vue/props/types.d.ts +120 -0
  240. package/dist/components/_util/vue/props/types.js +2 -0
  241. package/dist/components/_util/vue/props/types.js.map +1 -0
  242. package/dist/components/_util/vue/props/util.d.ts +8 -0
  243. package/dist/components/_util/vue/props/util.js +2 -0
  244. package/dist/components/_util/vue/props/util.js.map +1 -0
  245. package/dist/components/_util/vue/refs.d.ts +3 -0
  246. package/dist/components/_util/vue/refs.js +12 -0
  247. package/dist/components/_util/vue/refs.js.map +1 -0
  248. package/dist/components/_util/vue/size.d.ts +2 -0
  249. package/dist/components/_util/vue/size.js +6 -0
  250. package/dist/components/_util/vue/size.js.map +1 -0
  251. package/dist/components/_util/vue/typescript.d.ts +5 -0
  252. package/dist/components/_util/vue/typescript.js +2 -0
  253. package/dist/components/_util/vue/typescript.js.map +1 -0
  254. package/dist/components/_util/vue/validator.d.ts +3 -0
  255. package/dist/components/_util/vue/validator.js +7 -0
  256. package/dist/components/_util/vue/validator.js.map +1 -0
  257. package/dist/components/_util/vue/vnode.d.ts +50 -0
  258. package/dist/components/_util/vue/vnode.js +68 -0
  259. package/dist/components/_util/vue/vnode.js.map +1 -0
  260. package/dist/components/_util/vue-types/index.d.ts +3 -3
  261. package/dist/components/_util/vue-types/index.js +275 -417
  262. package/dist/components/_util/vue-types/index.js.map +1 -0
  263. package/dist/components/components.d.ts +4 -0
  264. package/dist/components/components.js +19 -12
  265. package/dist/components/components.js.map +1 -0
  266. package/dist/components/index.d.ts +1 -1
  267. package/dist/components/index.js +26 -24
  268. package/dist/components/index.js.map +1 -0
  269. package/dist/components-CutWiB7Q.js +68 -0
  270. package/dist/components-CutWiB7Q.js.map +1 -0
  271. package/dist/error/OrionError.js +7 -12
  272. package/dist/error/OrionError.js.map +1 -0
  273. package/dist/functions-DzLqXvGt.js +33 -0
  274. package/dist/functions-DzLqXvGt.js.map +1 -0
  275. package/dist/index-BbsXWo7C.js +44 -0
  276. package/dist/index-BbsXWo7C.js.map +1 -0
  277. package/dist/index-C8JNJPWW.js +8 -0
  278. package/dist/index-C8JNJPWW.js.map +1 -0
  279. package/dist/index.css +1 -44
  280. package/dist/index.d.ts +2 -1
  281. package/dist/index.js +27 -14
  282. package/dist/index.js.map +1 -0
  283. package/dist/print/LodopFuncs.js +48 -111
  284. package/dist/print/LodopFuncs.js.map +1 -0
  285. package/dist/print/index.d.ts +2 -2
  286. package/dist/print/index.js +111 -220
  287. package/dist/print/index.js.map +1 -0
  288. package/dist/request/ErrorHandlerChain.js +17 -15
  289. package/dist/request/ErrorHandlerChain.js.map +1 -0
  290. package/dist/request/RequestFilterChain.d.ts +1 -1
  291. package/dist/request/RequestFilterChain.js +16 -14
  292. package/dist/request/RequestFilterChain.js.map +1 -0
  293. package/dist/request/ResponseParserChain.d.ts +1 -1
  294. package/dist/request/ResponseParserChain.js +17 -15
  295. package/dist/request/ResponseParserChain.js.map +1 -0
  296. package/dist/request/disivion/DateSerializer.js +25 -46
  297. package/dist/request/disivion/DateSerializer.js.map +1 -0
  298. package/dist/request/disivion/DivisionErrorHandler.d.ts +1 -1
  299. package/dist/request/disivion/DivisionErrorHandler.js +30 -52
  300. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -0
  301. package/dist/request/disivion/DivisionResponseParser.d.ts +2 -2
  302. package/dist/request/disivion/DivisionResponseParser.js +13 -25
  303. package/dist/request/disivion/DivisionResponseParser.js.map +1 -0
  304. package/dist/request/disivion/index.d.ts +3 -3
  305. package/dist/request/disivion/index.js +230 -480
  306. package/dist/request/disivion/index.js.map +1 -0
  307. package/dist/request/error/BizExceptionResponseError.d.ts +2 -2
  308. package/dist/request/error/BizExceptionResponseError.js +8 -15
  309. package/dist/request/error/BizExceptionResponseError.js.map +1 -0
  310. package/dist/request/error/ExceptionResponseError.d.ts +2 -2
  311. package/dist/request/error/ExceptionResponseError.js +8 -15
  312. package/dist/request/error/ExceptionResponseError.js.map +1 -0
  313. package/dist/request/error/ResponseError.d.ts +1 -1
  314. package/dist/request/error/ResponseError.js +7 -14
  315. package/dist/request/error/ResponseError.js.map +1 -0
  316. package/dist/request/error/SessionExceptionResponseError.d.ts +2 -2
  317. package/dist/request/error/SessionExceptionResponseError.js +8 -15
  318. package/dist/request/error/SessionExceptionResponseError.js.map +1 -0
  319. package/dist/request/index.js +11 -17
  320. package/dist/request/index.js.map +1 -0
  321. package/dist/style/index.d.ts +0 -3
  322. package/dist/style/index.js +1 -0
  323. package/dist/style/index.js.map +1 -0
  324. package/dist/utils/DateUtil.js +36 -50
  325. package/dist/utils/DateUtil.js.map +1 -0
  326. package/dist/utils/NumberUtil.js +9 -8
  327. package/dist/utils/NumberUtil.js.map +1 -0
  328. package/dist/utils/cloneDeep.js +5 -1
  329. package/dist/utils/cloneDeep.js.map +1 -0
  330. package/dist/utils/delay.js +6 -4
  331. package/dist/utils/delay.js.map +1 -0
  332. package/dist/utils/functions.d.ts +1 -0
  333. package/dist/utils/functions.js +6 -0
  334. package/dist/utils/functions.js.map +1 -0
  335. package/dist/utils/index.js +15 -9
  336. package/dist/utils/index.js.map +1 -0
  337. package/dist/utils/md5.js +120 -245
  338. package/dist/utils/md5.js.map +1 -0
  339. package/dist/utils/uuid.js +28 -58
  340. package/dist/utils/uuid.js.map +1 -0
  341. package/dist/version/index.d.ts +1 -1
  342. package/dist/version/index.js +5 -6
  343. package/dist/version/index.js.map +1 -0
  344. package/dist/version/version.d.ts +1 -1
  345. package/dist/version/version.js +5 -3
  346. package/dist/version/version.js.map +1 -0
  347. package/dist/vite.svg +1 -0
  348. package/global.d.ts +6 -0
  349. package/package.json +53 -63
  350. package/dist/components-BTX5S_6V.js +0 -128
@@ -1,497 +1,247 @@
1
- import axios from 'axios';
2
- import { cloneDeep } from 'lodash-es';
3
- import 'dayjs';
4
- import '../../utils/md5.js';
5
- import 'decimal.js';
6
- import ResponseParserChain from '../ResponseParserChain.js';
7
- import ErrorHandlerChain from '../ErrorHandlerChain.js';
8
- import RequestFilterChain from '../RequestFilterChain.js';
9
- import DateSerializer from './DateSerializer.js';
10
- import DivisionResponseParser from './DivisionResponseParser.js';
11
- import DivisionErrorHandler from './DivisionErrorHandler.js';
12
- import { ElLoading } from 'element-plus';
13
- import ResponseError from '../error/ResponseError.js';
14
- import '../error/ExceptionResponseError.js';
15
- import '../error/BizExceptionResponseError.js';
16
- import '../error/SessionExceptionResponseError.js';
17
-
18
- /**
19
- * base64.ts
20
- *
21
- * Licensed under the BSD 3-Clause License.
22
- * http://opensource.org/licenses/BSD-3-Clause
23
- *
24
- * References:
25
- * http://en.wikipedia.org/wiki/Base64
26
- *
27
- * @author Dan Kogai (https://github.com/dankogai)
28
- */
29
- const version = '3.7.7';
30
- /**
31
- * @deprecated use lowercase `version`.
32
- */
33
- const VERSION = version;
34
- const _hasBuffer = typeof Buffer === 'function';
35
- const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
36
- const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
37
- const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
38
- const b64chs = Array.prototype.slice.call(b64ch);
39
- const b64tab = ((a) => {
40
- let tab = {};
41
- a.forEach((c, i) => tab[c] = i);
42
- return tab;
43
- })(b64chs);
44
- const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
45
- const _fromCC = String.fromCharCode.bind(String);
46
- const _U8Afrom = typeof Uint8Array.from === 'function'
47
- ? Uint8Array.from.bind(Uint8Array)
48
- : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
49
- const _mkUriSafe = (src) => src
50
- .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
51
- const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
52
- /**
53
- * polyfill version of `btoa`
54
- */
55
- const btoaPolyfill = (bin) => {
56
- // console.log('polyfilled');
57
- let u32, c0, c1, c2, asc = '';
58
- const pad = bin.length % 3;
59
- for (let i = 0; i < bin.length;) {
60
- if ((c0 = bin.charCodeAt(i++)) > 255 ||
61
- (c1 = bin.charCodeAt(i++)) > 255 ||
62
- (c2 = bin.charCodeAt(i++)) > 255)
63
- throw new TypeError('invalid character found');
64
- u32 = (c0 << 16) | (c1 << 8) | c2;
65
- asc += b64chs[u32 >> 18 & 63]
66
- + b64chs[u32 >> 12 & 63]
67
- + b64chs[u32 >> 6 & 63]
68
- + b64chs[u32 & 63];
69
- }
70
- return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
71
- };
72
- /**
73
- * does what `window.btoa` of web browsers do.
74
- * @param {String} bin binary string
75
- * @returns {string} Base64-encoded string
76
- */
77
- const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
78
- : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')
79
- : btoaPolyfill;
80
- const _fromUint8Array = _hasBuffer
81
- ? (u8a) => Buffer.from(u8a).toString('base64')
82
- : (u8a) => {
83
- // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
84
- const maxargs = 0x1000;
85
- let strs = [];
86
- for (let i = 0, l = u8a.length; i < l; i += maxargs) {
87
- strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
88
- }
89
- return _btoa(strs.join(''));
90
- };
91
- /**
92
- * converts a Uint8Array to a Base64 string.
93
- * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
94
- * @returns {string} Base64 string
95
- */
96
- const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
97
- // This trick is found broken https://github.com/dankogai/js-base64/issues/130
98
- // const utob = (src: string) => unescape(encodeURIComponent(src));
99
- // reverting good old fationed regexp
100
- const cb_utob = (c) => {
101
- if (c.length < 2) {
102
- var cc = c.charCodeAt(0);
103
- return cc < 0x80 ? c
104
- : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
105
- + _fromCC(0x80 | (cc & 0x3f)))
106
- : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
107
- + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
108
- + _fromCC(0x80 | (cc & 0x3f)));
109
- }
110
- else {
111
- var cc = 0x10000
112
- + (c.charCodeAt(0) - 0xD800) * 0x400
113
- + (c.charCodeAt(1) - 0xDC00);
114
- return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
115
- + _fromCC(0x80 | ((cc >>> 12) & 0x3f))
116
- + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
117
- + _fromCC(0x80 | (cc & 0x3f)));
1
+ import $ from "axios";
2
+ import { cloneDeep as G } from "lodash-es";
3
+ import "dayjs";
4
+ import "../../utils/md5.js";
5
+ import "decimal.js";
6
+ import K from "../ResponseParserChain.js";
7
+ import v from "../ErrorHandlerChain.js";
8
+ import W from "../RequestFilterChain.js";
9
+ import X from "./DateSerializer.js";
10
+ import ee from "./DivisionResponseParser.js";
11
+ import te from "./DivisionErrorHandler.js";
12
+ import { ElLoading as O } from "element-plus";
13
+ import re from "../error/ResponseError.js";
14
+ const T = "3.7.7", oe = T, m = typeof Buffer == "function", E = typeof TextDecoder == "function" ? new TextDecoder() : void 0, R = typeof TextEncoder == "function" ? new TextEncoder() : void 0, ne = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", p = Array.prototype.slice.call(ne), b = ((e) => {
15
+ let t = {};
16
+ return e.forEach((o, r) => t[o] = r), t;
17
+ })(p), ae = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, s = String.fromCharCode.bind(String), _ = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (e) => new Uint8Array(Array.prototype.slice.call(e, 0)), P = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (t) => t == "+" ? "-" : "_"), k = (e) => e.replace(/[^A-Za-z0-9\+\/]/g, ""), L = (e) => {
18
+ let t, o, r, n, a = "";
19
+ const i = e.length % 3;
20
+ for (let l = 0; l < e.length; ) {
21
+ if ((o = e.charCodeAt(l++)) > 255 || (r = e.charCodeAt(l++)) > 255 || (n = e.charCodeAt(l++)) > 255)
22
+ throw new TypeError("invalid character found");
23
+ t = o << 16 | r << 8 | n, a += p[t >> 18 & 63] + p[t >> 12 & 63] + p[t >> 6 & 63] + p[t & 63];
24
+ }
25
+ return i ? a.slice(0, i - 3) + "===".substring(i) : a;
26
+ }, U = typeof btoa == "function" ? (e) => btoa(e) : m ? (e) => Buffer.from(e, "binary").toString("base64") : L, A = m ? (e) => Buffer.from(e).toString("base64") : (e) => {
27
+ let o = [];
28
+ for (let r = 0, n = e.length; r < n; r += 4096)
29
+ o.push(s.apply(null, e.subarray(r, r + 4096)));
30
+ return U(o.join(""));
31
+ }, g = (e, t = !1) => t ? P(A(e)) : A(e), se = (e) => {
32
+ if (e.length < 2) {
33
+ var t = e.charCodeAt(0);
34
+ return t < 128 ? e : t < 2048 ? s(192 | t >>> 6) + s(128 | t & 63) : s(224 | t >>> 12 & 15) + s(128 | t >>> 6 & 63) + s(128 | t & 63);
35
+ } else {
36
+ var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
37
+ return s(240 | t >>> 18 & 7) + s(128 | t >>> 12 & 63) + s(128 | t >>> 6 & 63) + s(128 | t & 63);
38
+ }
39
+ }, ie = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, j = (e) => e.replace(ie, se), D = m ? (e) => Buffer.from(e, "utf8").toString("base64") : R ? (e) => A(R.encode(e)) : (e) => U(j(e)), h = (e, t = !1) => t ? P(D(e)) : D(e), S = (e) => h(e, !0), le = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, fe = (e) => {
40
+ switch (e.length) {
41
+ case 4:
42
+ var t = (7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3), o = t - 65536;
43
+ return s((o >>> 10) + 55296) + s((o & 1023) + 56320);
44
+ case 3:
45
+ return s((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
46
+ default:
47
+ return s((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1));
48
+ }
49
+ }, q = (e) => e.replace(le, fe), I = (e) => {
50
+ if (e = e.replace(/\s+/g, ""), !ae.test(e))
51
+ throw new TypeError("malformed base64.");
52
+ e += "==".slice(2 - (e.length & 3));
53
+ let t, o = "", r, n;
54
+ for (let a = 0; a < e.length; )
55
+ t = b[e.charAt(a++)] << 18 | b[e.charAt(a++)] << 12 | (r = b[e.charAt(a++)]) << 6 | (n = b[e.charAt(a++)]), o += r === 64 ? s(t >> 16 & 255) : n === 64 ? s(t >> 16 & 255, t >> 8 & 255) : s(t >> 16 & 255, t >> 8 & 255, t & 255);
56
+ return o;
57
+ }, C = typeof atob == "function" ? (e) => atob(k(e)) : m ? (e) => Buffer.from(e, "base64").toString("binary") : I, z = m ? (e) => _(Buffer.from(e, "base64")) : (e) => _(C(e).split("").map((t) => t.charCodeAt(0))), H = (e) => z(Z(e)), ue = m ? (e) => Buffer.from(e, "base64").toString("utf8") : E ? (e) => E.decode(z(e)) : (e) => q(C(e)), Z = (e) => k(e.replace(/[-_]/g, (t) => t == "-" ? "+" : "/")), w = (e) => ue(Z(e)), ce = (e) => {
58
+ if (typeof e != "string")
59
+ return !1;
60
+ const t = e.replace(/\s+/g, "").replace(/={0,2}$/, "");
61
+ return !/[^\s0-9a-zA-Z\+/]/.test(t) || !/[^\s0-9a-zA-Z\-_]/.test(t);
62
+ }, N = (e) => ({
63
+ value: e,
64
+ enumerable: !1,
65
+ writable: !0,
66
+ configurable: !0
67
+ }), V = function() {
68
+ const e = (t, o) => Object.defineProperty(String.prototype, t, N(o));
69
+ e("fromBase64", function() {
70
+ return w(this);
71
+ }), e("toBase64", function(t) {
72
+ return h(this, t);
73
+ }), e("toBase64URI", function() {
74
+ return h(this, !0);
75
+ }), e("toBase64URL", function() {
76
+ return h(this, !0);
77
+ }), e("toUint8Array", function() {
78
+ return H(this);
79
+ });
80
+ }, Y = function() {
81
+ const e = (t, o) => Object.defineProperty(Uint8Array.prototype, t, N(o));
82
+ e("toBase64", function(t) {
83
+ return g(this, t);
84
+ }), e("toBase64URI", function() {
85
+ return g(this, !0);
86
+ }), e("toBase64URL", function() {
87
+ return g(this, !0);
88
+ });
89
+ }, de = () => {
90
+ V(), Y();
91
+ }, he = {
92
+ version: T,
93
+ VERSION: oe,
94
+ atob: C,
95
+ atobPolyfill: I,
96
+ btoa: U,
97
+ btoaPolyfill: L,
98
+ fromBase64: w,
99
+ toBase64: h,
100
+ encode: h,
101
+ encodeURI: S,
102
+ encodeURL: S,
103
+ utob: j,
104
+ btou: q,
105
+ decode: w,
106
+ isValid: ce,
107
+ fromUint8Array: g,
108
+ toUint8Array: H,
109
+ extendString: V,
110
+ extendUint8Array: Y,
111
+ extendBuiltins: de
112
+ };
113
+ let M = () => ({}), J = [new ee()], F = [new te()], Q = [
114
+ {
115
+ doFilter: (e, t) => {
116
+ const o = M();
117
+ Object.keys(o).forEach(function(r) {
118
+ e.headers[r] = o[r];
119
+ }), t.doFilter(e, t);
118
120
  }
119
- };
120
- const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
121
- /**
122
- * @deprecated should have been internal use only.
123
- * @param {string} src UTF-8 string
124
- * @returns {string} UTF-16 string
125
- */
126
- const utob = (u) => u.replace(re_utob, cb_utob);
127
- //
128
- const _encode = _hasBuffer
129
- ? (s) => Buffer.from(s, 'utf8').toString('base64')
130
- : _TE
131
- ? (s) => _fromUint8Array(_TE.encode(s))
132
- : (s) => _btoa(utob(s));
133
- /**
134
- * converts a UTF-8-encoded string to a Base64 string.
135
- * @param {boolean} [urlsafe] if `true` make the result URL-safe
136
- * @returns {string} Base64 string
137
- */
138
- const encode = (src, urlsafe = false) => urlsafe
139
- ? _mkUriSafe(_encode(src))
140
- : _encode(src);
141
- /**
142
- * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
143
- * @returns {string} Base64 string
144
- */
145
- const encodeURI = (src) => encode(src, true);
146
- // This trick is found broken https://github.com/dankogai/js-base64/issues/130
147
- // const btou = (src: string) => decodeURIComponent(escape(src));
148
- // reverting good old fationed regexp
149
- const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
150
- const cb_btou = (cccc) => {
151
- switch (cccc.length) {
152
- case 4:
153
- var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
154
- | ((0x3f & cccc.charCodeAt(1)) << 12)
155
- | ((0x3f & cccc.charCodeAt(2)) << 6)
156
- | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
157
- return (_fromCC((offset >>> 10) + 0xD800)
158
- + _fromCC((offset & 0x3FF) + 0xDC00));
159
- case 3:
160
- return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
161
- | ((0x3f & cccc.charCodeAt(1)) << 6)
162
- | (0x3f & cccc.charCodeAt(2)));
163
- default:
164
- return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
165
- | (0x3f & cccc.charCodeAt(1)));
121
+ },
122
+ {
123
+ doFilter: (e) => {
124
+ new X("YYYYMMDDHHmmss").serialize(e.data);
166
125
  }
167
- };
168
- /**
169
- * @deprecated should have been internal use only.
170
- * @param {string} src UTF-16 string
171
- * @returns {string} UTF-8 string
172
- */
173
- const btou = (b) => b.replace(re_btou, cb_btou);
174
- /**
175
- * polyfill version of `atob`
176
- */
177
- const atobPolyfill = (asc) => {
178
- // console.log('polyfilled');
179
- asc = asc.replace(/\s+/g, '');
180
- if (!b64re.test(asc))
181
- throw new TypeError('malformed base64.');
182
- asc += '=='.slice(2 - (asc.length & 3));
183
- let u24, bin = '', r1, r2;
184
- for (let i = 0; i < asc.length;) {
185
- u24 = b64tab[asc.charAt(i++)] << 18
186
- | b64tab[asc.charAt(i++)] << 12
187
- | (r1 = b64tab[asc.charAt(i++)]) << 6
188
- | (r2 = b64tab[asc.charAt(i++)]);
189
- bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
190
- : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
191
- : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
192
- }
193
- return bin;
194
- };
195
- /**
196
- * does what `window.atob` of web browsers do.
197
- * @param {String} asc Base64-encoded string
198
- * @returns {string} binary string
199
- */
200
- const _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))
201
- : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')
202
- : atobPolyfill;
203
- //
204
- const _toUint8Array = _hasBuffer
205
- ? (a) => _U8Afrom(Buffer.from(a, 'base64'))
206
- : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
207
- /**
208
- * converts a Base64 string to a Uint8Array.
209
- */
210
- const toUint8Array = (a) => _toUint8Array(_unURI(a));
211
- //
212
- const _decode = _hasBuffer
213
- ? (a) => Buffer.from(a, 'base64').toString('utf8')
214
- : _TD
215
- ? (a) => _TD.decode(_toUint8Array(a))
216
- : (a) => btou(_atob(a));
217
- const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));
218
- /**
219
- * converts a Base64 string to a UTF-8 string.
220
- * @param {String} src Base64 string. Both normal and URL-safe are supported
221
- * @returns {string} UTF-8 string
222
- */
223
- const decode = (src) => _decode(_unURI(src));
224
- /**
225
- * check if a value is a valid Base64 string
226
- * @param {String} src a value to check
227
- */
228
- const isValid = (src) => {
229
- if (typeof src !== 'string')
230
- return false;
231
- const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
232
- return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
233
- };
234
- //
235
- const _noEnum = (v) => {
236
- return {
237
- value: v, enumerable: false, writable: true, configurable: true
238
- };
239
- };
240
- /**
241
- * extend String.prototype with relevant methods
242
- */
243
- const extendString = function () {
244
- const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
245
- _add('fromBase64', function () { return decode(this); });
246
- _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
247
- _add('toBase64URI', function () { return encode(this, true); });
248
- _add('toBase64URL', function () { return encode(this, true); });
249
- _add('toUint8Array', function () { return toUint8Array(this); });
250
- };
251
- /**
252
- * extend Uint8Array.prototype with relevant methods
253
- */
254
- const extendUint8Array = function () {
255
- const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
256
- _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
257
- _add('toBase64URI', function () { return fromUint8Array(this, true); });
258
- _add('toBase64URL', function () { return fromUint8Array(this, true); });
259
- };
260
- /**
261
- * extend Builtin prototypes with relevant methods
262
- */
263
- const extendBuiltins = () => {
264
- extendString();
265
- extendUint8Array();
266
- };
267
- const gBase64 = {
268
- version: version,
269
- VERSION: VERSION,
270
- atob: _atob,
271
- atobPolyfill: atobPolyfill,
272
- btoa: _btoa,
273
- btoaPolyfill: btoaPolyfill,
274
- fromBase64: decode,
275
- toBase64: encode,
276
- encode: encode,
277
- encodeURI: encodeURI,
278
- encodeURL: encodeURI,
279
- utob: utob,
280
- btou: btou,
281
- decode: decode,
282
- isValid: isValid,
283
- fromUint8Array: fromUint8Array,
284
- toUint8Array: toUint8Array,
285
- extendString: extendString,
286
- extendUint8Array: extendUint8Array,
287
- extendBuiltins: extendBuiltins
288
- };
289
-
290
- //////////////////////////////////// Chain
291
- let gRequestHeaders = () => ({});
292
- let gResponseParsers = [new DivisionResponseParser()];
293
- let gErrorHandlers = [new DivisionErrorHandler()];
294
- let gRequestFilters = [{
295
- doFilter: (request, chain) => {
296
- const headers = gRequestHeaders();
297
- Object.keys(headers).forEach(function (key) {
298
- request.headers[key] = headers[key];
299
- });
300
- chain.doFilter(request, chain);
301
126
  }
302
- }, {
303
- doFilter: request => {
304
- new DateSerializer('YYYYMMDDHHmmss').serialize(request.data);
305
- }
306
- }];
307
- //////////////////////////////////// GLOBAL VARS
308
- let BASE_URL = '/';
309
- let REQUEST_TIMEOUT = 1000 * 30;
310
- //////////////////////////////////// AXIOS
311
- const g_AxiosInstance = axios.create();
312
- g_AxiosInstance.interceptors.request.use(function (config) {
313
- const chain = new RequestFilterChain(gRequestFilters);
314
- chain.doFilter(config, chain);
315
- return config;
127
+ ], B = "/", x = 1e3 * 30;
128
+ const y = $.create();
129
+ y.interceptors.request.use(function(e) {
130
+ const t = new W(Q);
131
+ return t.doFilter(e, t), e;
316
132
  });
317
- g_AxiosInstance.interceptors.response.use(function (response) {
133
+ y.interceptors.response.use(function(e) {
318
134
  try {
319
- const chain = new ResponseParserChain(gResponseParsers);
320
- return chain.doParse(response, chain);
321
- } catch (e) {
322
- throw new ResponseError(e.message, {
323
- cause: e
324
- }, response);
135
+ const t = new K(J);
136
+ return t.doParse(e, t);
137
+ } catch (t) {
138
+ throw new re(t.message, { cause: t }, e);
325
139
  }
326
140
  });
327
- function request(url, data = {}, options = {
328
- loading: true,
329
- mask: false,
330
- timeout: REQUEST_TIMEOUT
331
- }) {
332
- let newData = data;
333
- if (!(data instanceof FormData)) {
334
- newData = cloneDeep(data);
335
- }
336
- // loading
337
- let loading;
338
- if (options.loading === true) {
339
- loading = ElLoading.service({
340
- fullscreen: true,
341
- background: 'transparent'
342
- });
343
- }
344
- return g_AxiosInstance.request({
345
- baseURL: BASE_URL,
346
- method: 'POST',
347
- timeout: REQUEST_TIMEOUT,
348
- withCredentials: true,
349
- url,
350
- data: newData,
351
- responseType: 'json',
352
- ...options
353
- }).then(data => {
354
- if (loading) {
355
- loading.close();
356
- }
357
- return data;
358
- }).catch(function (error) {
359
- if (loading) {
360
- loading.close();
361
- }
362
- const chain = new ErrorHandlerChain(gErrorHandlers);
363
- return chain.handle(error, chain);
141
+ function c(e, t = {}, o = { loading: !0, mask: !1, timeout: x }) {
142
+ let r = t;
143
+ t instanceof FormData || (r = G(t));
144
+ let n;
145
+ return o.loading === !0 && (n = O.service({ fullscreen: !0, background: "transparent" })), y.request({
146
+ baseURL: B,
147
+ method: "POST",
148
+ timeout: x,
149
+ withCredentials: !0,
150
+ url: e,
151
+ data: r,
152
+ responseType: "json",
153
+ ...o
154
+ }).then((a) => (n && n.close(), a)).catch(function(a) {
155
+ n && n.close();
156
+ const i = new v(F);
157
+ return i.handle(a, i);
364
158
  });
365
159
  }
366
- function download(url, data = {}, options = {
367
- loading: true,
368
- mask: false,
369
- timeout: REQUEST_TIMEOUT
370
- }) {
371
- let loading;
372
- if (options.loading === true) {
373
- loading = ElLoading.service({
374
- fullscreen: true,
375
- background: 'transparent'
376
- });
377
- }
378
- return g_AxiosInstance.request({
379
- baseURL: BASE_URL,
380
- method: 'POST',
381
- timeout: REQUEST_TIMEOUT,
382
- withCredentials: true,
383
- url,
384
- data,
385
- responseType: 'blob',
386
- ...options
387
- }).then(data => {
388
- if (loading) {
389
- loading.close();
390
- }
391
- return data;
392
- }).then(response => {
393
- const contentDisposition = response.headers['content-disposition'];
394
- const blob = response.data;
395
- const base64FileName = contentDisposition.match(/attachment; filename=\"(.*?)\"/)[1];
396
- const decodedFileName = gBase64.decode(base64FileName);
397
- // for IE
398
- //@ts-ignore
399
- if (window.navigator && window.navigator.msSaveOrOpenBlob) {
400
- //@ts-ignore
401
- window.navigator.msSaveOrOpenBlob(blob, decodedFileName);
402
- } else {
403
- const a = document.createElement('a');
404
- const url = URL.createObjectURL(blob);
405
- a.href = url;
406
- a.download = decodedFileName;
407
- document.body.appendChild(a);
408
- a.click();
409
- document.body.removeChild(a);
410
- URL.revokeObjectURL(url);
411
- }
412
- }).catch(function (error) {
413
- if (loading) {
414
- loading.close();
160
+ function me(e, t = {}, o = { loading: !0, mask: !1, timeout: x }) {
161
+ let r;
162
+ return o.loading === !0 && (r = O.service({ fullscreen: !0, background: "transparent" })), y.request({
163
+ baseURL: B,
164
+ method: "POST",
165
+ timeout: x,
166
+ withCredentials: !0,
167
+ url: e,
168
+ data: t,
169
+ responseType: "blob",
170
+ ...o
171
+ }).then((n) => (r && r.close(), n)).then((n) => {
172
+ const a = n.headers["content-disposition"], i = n.data, l = a.match(/attachment; filename=\"(.*?)\"/)[1], f = he.decode(l);
173
+ if (window.navigator && window.navigator.msSaveOrOpenBlob)
174
+ window.navigator.msSaveOrOpenBlob(i, f);
175
+ else {
176
+ const d = document.createElement("a"), u = URL.createObjectURL(i);
177
+ d.href = u, d.download = f, document.body.appendChild(d), d.click(), document.body.removeChild(d), URL.revokeObjectURL(u);
415
178
  }
416
- const chain = new ErrorHandlerChain(gErrorHandlers);
417
- return chain.handle(error, chain);
179
+ }).catch(function(n) {
180
+ r && r.close();
181
+ const a = new v(F);
182
+ return a.handle(n, a);
418
183
  });
419
184
  }
420
- function upload(url, params, options) {
421
- const formdata = new FormData();
422
- if (params) {
423
- const keys = Object.keys(params);
424
- const normalParams = {};
425
- for (let i = 0; i < keys.length; i++) {
426
- const key = keys[i];
427
- const itemValue = params[key];
428
- if (itemValue instanceof File) {
429
- formdata.append(key, itemValue);
430
- } else if (itemValue instanceof Array) {
431
- let isFile = false;
432
- for (let j = 0; j < itemValue.length; j++) {
433
- if (itemValue[j] instanceof File) {
434
- isFile = true;
185
+ function pe(e, t, o) {
186
+ const r = new FormData();
187
+ if (t) {
188
+ const n = Object.keys(t), a = {};
189
+ for (let i = 0; i < n.length; i++) {
190
+ const l = n[i], f = t[l];
191
+ if (f instanceof File)
192
+ r.append(l, f);
193
+ else if (f instanceof Array) {
194
+ let d = !1;
195
+ for (let u = 0; u < f.length; u++)
196
+ if (f[u] instanceof File) {
197
+ d = !0;
435
198
  break;
436
199
  }
437
- }
438
- if (isFile) {
439
- for (let j = 0; j < itemValue.length; j++) {
440
- formdata.append(key, itemValue[j]);
441
- }
442
- } else {
443
- // formdata.append(key, JSON.stringify(itemValue));
444
- normalParams[key] = itemValue;
445
- }
446
- } else {
447
- // formdata.append(key, itemValue);
448
- normalParams[key] = itemValue;
449
- }
200
+ if (d)
201
+ for (let u = 0; u < f.length; u++)
202
+ r.append(l, f[u]);
203
+ else
204
+ a[l] = f;
205
+ } else
206
+ a[l] = f;
450
207
  }
451
- formdata.append('ibayJson', JSON.stringify(normalParams));
208
+ r.append("ibayJson", JSON.stringify(a));
452
209
  }
453
- return request(url, formdata, options);
210
+ return c(e, r, o);
454
211
  }
455
- //////////////////////////////////// Exports
456
- // api
457
- request.download = download;
458
- request.upload = upload;
459
- // setters
460
- request.setBaseUrl = pBaseUrl => {
461
- if (!pBaseUrl) {
462
- throw new Error(`pBaseUrl is null!`);
463
- }
464
- BASE_URL = pBaseUrl;
465
- };
466
- request.setRequestTimeout = pTimeout => {
467
- REQUEST_TIMEOUT = pTimeout;
468
- };
469
- request.setRequestHeaders = pRequestHeaders => {
470
- if (!pRequestHeaders) {
471
- throw new Error(`pRequestHeaders is null!`);
472
- }
473
- if (!(pRequestHeaders instanceof Function)) {
474
- throw new Error(`pRequestHeaders is not a function!`);
475
- }
476
- gRequestHeaders = pRequestHeaders;
477
- };
478
- request.setRequestFilters = (...filters) => {
479
- if (filters == null) {
480
- throw new Error(`filters is null!`);
481
- }
482
- gRequestFilters = filters;
483
- };
484
- request.setResponseParsers = (...parsers) => {
485
- if (parsers == null) {
486
- throw new Error(`parsers is null!`);
487
- }
488
- gResponseParsers = parsers;
489
- };
490
- request.setErrorHandlers = (...handlers) => {
491
- if (handlers == null) {
492
- throw new Error(`handlers should not null!`);
493
- }
494
- gErrorHandlers = handlers;
495
- };
496
-
497
- export { request as default };
212
+ c.download = me;
213
+ c.upload = pe;
214
+ c.setBaseUrl = (e) => {
215
+ if (!e)
216
+ throw new Error("pBaseUrl is null!");
217
+ B = e;
218
+ };
219
+ c.setRequestTimeout = (e) => {
220
+ x = e;
221
+ };
222
+ c.setRequestHeaders = (e) => {
223
+ if (!e)
224
+ throw new Error("pRequestHeaders is null!");
225
+ if (!(e instanceof Function))
226
+ throw new Error("pRequestHeaders is not a function!");
227
+ M = e;
228
+ };
229
+ c.setRequestFilters = (...e) => {
230
+ if (e == null)
231
+ throw new Error("filters is null!");
232
+ Q = e;
233
+ };
234
+ c.setResponseParsers = (...e) => {
235
+ if (e == null)
236
+ throw new Error("parsers is null!");
237
+ J = e;
238
+ };
239
+ c.setErrorHandlers = (...e) => {
240
+ if (e == null)
241
+ throw new Error("handlers should not null!");
242
+ F = e;
243
+ };
244
+ export {
245
+ c as default
246
+ };
247
+ //# sourceMappingURL=index.js.map