orion-design 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. package/README.md +5 -5
  2. package/dist/Throne/index.js +14 -30
  3. package/dist/Throne/index.js.map +1 -1
  4. package/dist/components/Button/index.js +33 -40
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Flex/index.js +89 -122
  7. package/dist/components/Flex/index.js.map +1 -1
  8. package/dist/components/Form/Form.js +2 -2
  9. package/dist/components/Form/Form.js.map +1 -1
  10. package/dist/components/Form/LovInput/LovInput.js +2 -2
  11. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  12. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  13. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  14. package/dist/components/Form/LovInput/index.js +4 -4
  15. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  16. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  17. package/dist/components/Form/hooks/index.js +68 -127
  18. package/dist/components/Form/hooks/index.js.map +1 -1
  19. package/dist/components/Form/index.js +656 -836
  20. package/dist/components/Form/index.js.map +1 -1
  21. package/dist/components/Form/utils/index.js +18 -30
  22. package/dist/components/Form/utils/index.js.map +1 -1
  23. package/dist/components/LovTable/LovPagetable.vue.d.ts +492 -0
  24. package/dist/components/LovTable/index.d.ts +246 -0
  25. package/dist/components/LovTable/index.js +106 -179
  26. package/dist/components/LovTable/index.js.map +1 -1
  27. package/dist/components/Modal/index.js +56 -111
  28. package/dist/components/Modal/index.js.map +1 -1
  29. package/dist/components/Modal/types.d.ts +1 -1
  30. package/dist/components/Modal/types.js +3 -4
  31. package/dist/components/Modal/types.js.map +1 -1
  32. package/dist/components/Modal/useModal.js +5 -5
  33. package/dist/components/Modal/useModal.js.map +1 -1
  34. package/dist/components/Pagetable/Pagetable.d.ts +92 -1
  35. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
  36. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
  37. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
  38. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
  39. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
  40. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
  41. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
  42. package/dist/components/Pagetable/hooks/useColumns.js +85 -88
  43. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  44. package/dist/components/Pagetable/index.d.ts +155 -0
  45. package/dist/components/Pagetable/index.js +596 -683
  46. package/dist/components/Pagetable/index.js.map +1 -1
  47. package/dist/components/Pagetable/utils/index.js +54 -92
  48. package/dist/components/Pagetable/utils/index.js.map +1 -1
  49. package/dist/components/Querytable/hooks/useColumns.js +74 -82
  50. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  51. package/dist/components/Querytable/index.js +469 -579
  52. package/dist/components/Querytable/index.js.map +1 -1
  53. package/dist/components/Querytable/utils/index.js +54 -92
  54. package/dist/components/Querytable/utils/index.js.map +1 -1
  55. package/dist/components/RichTextEditor/index.js +74 -100
  56. package/dist/components/RichTextEditor/index.js.map +1 -1
  57. package/dist/components/Tabs/constants.js +2 -2
  58. package/dist/components/Tabs/constants.js.map +1 -1
  59. package/dist/components/Tabs/index.js +358 -603
  60. package/dist/components/Tabs/index.js.map +1 -1
  61. package/dist/components/Tabs/tab-bar.js +6 -6
  62. package/dist/components/Tabs/tab-bar.js.map +1 -1
  63. package/dist/components/Tabs/tab-pane.js +3 -3
  64. package/dist/components/Tabs/tab-pane.js.map +1 -1
  65. package/dist/components/_constants/aria.js +2 -2
  66. package/dist/components/_constants/aria.js.map +1 -1
  67. package/dist/components/_constants/event.js +4 -6
  68. package/dist/components/_constants/event.js.map +1 -1
  69. package/dist/components/_constants/index.js +6 -6
  70. package/dist/components/_hooks/index.js +7 -7
  71. package/dist/components/_hooks/use-namespace/index.js +39 -74
  72. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  73. package/dist/components/_hooks/use-ordered-children/index.js +19 -29
  74. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  75. package/dist/components/_util/arrays.js +5 -9
  76. package/dist/components/_util/arrays.js.map +1 -1
  77. package/dist/components/_util/browser.js +6 -6
  78. package/dist/components/_util/browser.js.map +1 -1
  79. package/dist/components/_util/classNames.js +17 -22
  80. package/dist/components/_util/classNames.js.map +1 -1
  81. package/dist/components/_util/dom/aria.js +39 -74
  82. package/dist/components/_util/dom/aria.js.map +1 -1
  83. package/dist/components/_util/dom/element.js +8 -9
  84. package/dist/components/_util/dom/element.js.map +1 -1
  85. package/dist/components/_util/dom/event.js +7 -14
  86. package/dist/components/_util/dom/event.js.map +1 -1
  87. package/dist/components/_util/dom/index.js +36 -36
  88. package/dist/components/_util/dom/position.js +25 -49
  89. package/dist/components/_util/dom/position.js.map +1 -1
  90. package/dist/components/_util/dom/scroll.js +61 -103
  91. package/dist/components/_util/dom/scroll.js.map +1 -1
  92. package/dist/components/_util/dom/style.js +50 -65
  93. package/dist/components/_util/dom/style.js.map +1 -1
  94. package/dist/components/_util/easings.js +4 -8
  95. package/dist/components/_util/easings.js.map +1 -1
  96. package/dist/components/_util/error.js +11 -12
  97. package/dist/components/_util/error.js.map +1 -1
  98. package/dist/components/_util/functions.js +3 -3
  99. package/dist/components/_util/i18n.js +2 -2
  100. package/dist/components/_util/i18n.js.map +1 -1
  101. package/dist/components/_util/index.js +137 -137
  102. package/dist/components/_util/isValid.js +2 -4
  103. package/dist/components/_util/isValid.js.map +1 -1
  104. package/dist/components/_util/objects.js +14 -18
  105. package/dist/components/_util/objects.js.map +1 -1
  106. package/dist/components/_util/props-util/index.js +20 -46
  107. package/dist/components/_util/props-util/index.js.map +1 -1
  108. package/dist/components/_util/props-util/initDefaultProps.js +10 -18
  109. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  110. package/dist/components/_util/raf.js +4 -5
  111. package/dist/components/_util/raf.js.map +1 -1
  112. package/dist/components/_util/rand.js +3 -4
  113. package/dist/components/_util/rand.js.map +1 -1
  114. package/dist/components/_util/strings.js +8 -9
  115. package/dist/components/_util/strings.js.map +1 -1
  116. package/dist/components/_util/throttleByRaf.js +10 -16
  117. package/dist/components/_util/throttleByRaf.js.map +1 -1
  118. package/dist/components/_util/type.js +38 -41
  119. package/dist/components/_util/type.js.map +1 -1
  120. package/dist/components/_util/types.js +22 -41
  121. package/dist/components/_util/types.js.map +1 -1
  122. package/dist/components/_util/typescript.js +2 -2
  123. package/dist/components/_util/typescript.js.map +1 -1
  124. package/dist/components/_util/util.js +43 -85
  125. package/dist/components/_util/util.js.map +1 -1
  126. package/dist/components/_util/vue/global-node.js +15 -27
  127. package/dist/components/_util/vue/global-node.js.map +1 -1
  128. package/dist/components/_util/vue/icon.js +25 -29
  129. package/dist/components/_util/vue/icon.js.map +1 -1
  130. package/dist/components/_util/vue/index.js +41 -41
  131. package/dist/components/_util/vue/install.js +18 -35
  132. package/dist/components/_util/vue/install.js.map +1 -1
  133. package/dist/components/_util/vue/props/index.js +6 -6
  134. package/dist/components/_util/vue/props/runtime.js +30 -46
  135. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  136. package/dist/components/_util/vue/refs.js +6 -12
  137. package/dist/components/_util/vue/refs.js.map +1 -1
  138. package/dist/components/_util/vue/size.js +3 -5
  139. package/dist/components/_util/vue/size.js.map +1 -1
  140. package/dist/components/_util/vue/validator.js +4 -5
  141. package/dist/components/_util/vue/validator.js.map +1 -1
  142. package/dist/components/_util/vue/vnode.js +54 -100
  143. package/dist/components/_util/vue/vnode.js.map +1 -1
  144. package/dist/components/_util/vue-types/index.js +220 -231
  145. package/dist/components/_util/vue-types/index.js.map +1 -1
  146. package/dist/components/components.js +20 -20
  147. package/dist/components/index.js +35 -38
  148. package/dist/components/index.js.map +1 -1
  149. package/dist/error/OrionError.js +4 -8
  150. package/dist/error/OrionError.js.map +1 -1
  151. package/dist/index.css +1 -797
  152. package/dist/index.js +36 -36
  153. package/dist/print/LodopFuncs.js +43 -101
  154. package/dist/print/LodopFuncs.js.map +1 -1
  155. package/dist/print/index.js +108 -200
  156. package/dist/print/index.js.map +1 -1
  157. package/dist/request/ErrorHandlerChain.js +14 -17
  158. package/dist/request/ErrorHandlerChain.js.map +1 -1
  159. package/dist/request/RequestFilterChain.js +13 -16
  160. package/dist/request/RequestFilterChain.js.map +1 -1
  161. package/dist/request/ResponseParserChain.js +14 -17
  162. package/dist/request/ResponseParserChain.js.map +1 -1
  163. package/dist/request/disivion/DateSerializer.js +22 -47
  164. package/dist/request/disivion/DateSerializer.js.map +1 -1
  165. package/dist/request/disivion/DivisionErrorHandler.js +25 -40
  166. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  167. package/dist/request/disivion/DivisionResponseParser.js +10 -16
  168. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  169. package/dist/request/disivion/index.js +201 -305
  170. package/dist/request/disivion/index.js.map +1 -1
  171. package/dist/request/error/BizExceptionResponseError.js +5 -11
  172. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  173. package/dist/request/error/ExceptionResponseError.js +5 -11
  174. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  175. package/dist/request/error/ResponseError.js +4 -9
  176. package/dist/request/error/ResponseError.js.map +1 -1
  177. package/dist/request/error/SessionExceptionResponseError.js +5 -11
  178. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  179. package/dist/request/index.js +11 -11
  180. package/dist/utils/DateUtil.js +33 -48
  181. package/dist/utils/DateUtil.js.map +1 -1
  182. package/dist/utils/NumberUtil.js +6 -6
  183. package/dist/utils/NumberUtil.js.map +1 -1
  184. package/dist/utils/cloneDeep.js +2 -2
  185. package/dist/utils/delay.js +3 -3
  186. package/dist/utils/delay.js.map +1 -1
  187. package/dist/utils/functions.js +3 -3
  188. package/dist/utils/index.js +12 -12
  189. package/dist/utils/md5.js +93 -191
  190. package/dist/utils/md5.js.map +1 -1
  191. package/dist/utils/uuid.js +25 -35
  192. package/dist/utils/uuid.js.map +1 -1
  193. package/dist/version/index.js +2 -2
  194. package/dist/version/version.d.ts +1 -1
  195. package/dist/version/version.js +2 -2
  196. package/dist/version/version.js.map +1 -1
  197. package/package.json +1 -1
  198. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
  199. package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
  200. package/dist/components-B3d9m_tn.js +0 -27
  201. package/dist/components-B3d9m_tn.js.map +0 -1
  202. package/dist/functions-BeMkokbY.js +0 -63
  203. package/dist/functions-BeMkokbY.js.map +0 -1
  204. package/dist/index-BOKLZnqH.js +0 -54
  205. package/dist/index-BOKLZnqH.js.map +0 -1
  206. package/dist/index-D1m0KTpK.js +0 -69
  207. package/dist/index-D1m0KTpK.js.map +0 -1
  208. package/dist/index-DR5ZP7mD.js +0 -160
  209. package/dist/index-DR5ZP7mD.js.map +0 -1
  210. package/dist/index-DkwIULcN.js +0 -200
  211. package/dist/index-DkwIULcN.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DateSerializer.js","sources":["../../../src/request/disivion/DateSerializer.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\n\r\nexport default class DateSerializer {\r\n private format: string \r\n\r\n constructor(format = 'YYYY-MM-DD HH:mm:ss.SSS') {\r\n this.format = format\r\n }\r\n\r\n serialize(data: Record<string, unknown>) {\r\n const format = this.format\r\n\r\n function objTransfer(data: any): Record<any, unknown> {\r\n const result: Record<any, unknown> = {}\r\n Object.keys(data).forEach((key) => {\r\n const value = data[key]\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n result[key] = dayjs(value).format(format)\r\n } else if (value && value instanceof Object && !Array.isArray(value)) {\r\n result[key] = objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n result[key] = arrayTransfer(value)\r\n } else {\r\n result[key] = value\r\n }\r\n })\r\n return result\r\n }\r\n function arrayTransfer(data: Array<unknown>): Array<unknown> {\r\n return data.map((value) => {\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n return dayjs(value).format(format)\r\n } else if (value && value instanceof Object && !Array.isArray(value)) {\r\n return objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n return arrayTransfer(value)\r\n } else {\r\n return value\r\n }\r\n })\r\n }\r\n\r\n Object.keys(data).forEach((key) => {\r\n const value = data[key]\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n data[key] = dayjs(value).format(this.format)\r\n } else if (value && typeof value == 'object' && !Array.isArray(value)) {\r\n data[key] = objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n data[key] = arrayTransfer(value)\r\n }\r\n })\r\n }\r\n}\r\n"],"names":["data"],"mappings":";;;;AAEA,MAAqB,eAAe;AAAA,EAGlC,YAAY,SAAS,2BAA2B;AAFxC;AAGN,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,UAAU,MAA+B;AACvC,UAAM,SAAS,KAAK;AAEpB,aAAS,YAAYA,OAAiC;AACpD,YAAM,SAA+B,CAAA;AACrC,aAAO,KAAKA,KAAI,EAAE,QAAQ,CAAC,QAAQ;AAC3B,cAAA,QAAQA,MAAK,GAAG;AACtB,YAAI,iBAAiB,QAAQ,MAAM,QAAQ,KAAK,GAAG;AACjD,iBAAO,GAAG,IAAI,MAAM,KAAK,EAAE,OAAO,MAAM;AAAA,QAAA,WAC/B,SAAS,iBAAiB,UAAU,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC7D,iBAAA,GAAG,IAAI,YAAY,KAAK;AAAA,QACtB,WAAA,SAAS,MAAM,QAAQ,KAAK,GAAG;AACjC,iBAAA,GAAG,IAAI,cAAc,KAAK;AAAA,QAAA,OAC5B;AACL,iBAAO,GAAG,IAAI;AAAA,QAChB;AAAA,MAAA,CACD;AACM,aAAA;AAAA,IACT;AACA,aAAS,cAAcA,OAAsC;AACpDA,aAAAA,MAAK,IAAI,CAAC,UAAU;AACzB,YAAI,iBAAiB,QAAQ,MAAM,QAAQ,KAAK,GAAG;AACjD,iBAAO,MAAM,KAAK,EAAE,OAAO,MAAM;AAAA,QAAA,WACxB,SAAS,iBAAiB,UAAU,CAAC,MAAM,QAAQ,KAAK,GAAG;AACpE,iBAAO,YAAY,KAAK;AAAA,QACf,WAAA,SAAS,MAAM,QAAQ,KAAK,GAAG;AACxC,iBAAO,cAAc,KAAK;AAAA,QAAA,OACrB;AACE,iBAAA;AAAA,QACT;AAAA,MAAA,CACD;AAAA,IACH;AAEA,WAAO,KAAK,IAAI,EAAE,QAAQ,CAAC,QAAQ;AAC3B,YAAA,QAAQ,KAAK,GAAG;AACtB,UAAI,iBAAiB,QAAQ,MAAM,QAAQ,KAAK,GAAG;AACjD,aAAK,GAAG,IAAI,MAAM,KAAK,EAAE,OAAO,KAAK,MAAM;AAAA,MAAA,WAClC,SAAS,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG;AAChE,aAAA,GAAG,IAAI,YAAY,KAAK;AAAA,MACpB,WAAA,SAAS,MAAM,QAAQ,KAAK,GAAG;AACnC,aAAA,GAAG,IAAI,cAAc,KAAK;AAAA,MACjC;AAAA,IAAA,CACD;AAAA,EACH;AACF;"}
1
+ {"version":3,"file":"DateSerializer.js","sources":["../../../src/request/disivion/DateSerializer.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\n\r\nexport default class DateSerializer {\r\n private format: string \r\n\r\n constructor(format = 'YYYY-MM-DD HH:mm:ss.SSS') {\r\n this.format = format\r\n }\r\n\r\n serialize(data: Record<string, unknown>) {\r\n const format = this.format\r\n\r\n function objTransfer(data: any): Record<any, unknown> {\r\n const result: Record<any, unknown> = {}\r\n Object.keys(data).forEach((key) => {\r\n const value = data[key]\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n result[key] = dayjs(value).format(format)\r\n } else if (value && value instanceof Object && !Array.isArray(value)) {\r\n result[key] = objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n result[key] = arrayTransfer(value)\r\n } else {\r\n result[key] = value\r\n }\r\n })\r\n return result\r\n }\r\n function arrayTransfer(data: Array<unknown>): Array<unknown> {\r\n return data.map((value) => {\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n return dayjs(value).format(format)\r\n } else if (value && value instanceof Object && !Array.isArray(value)) {\r\n return objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n return arrayTransfer(value)\r\n } else {\r\n return value\r\n }\r\n })\r\n }\r\n\r\n Object.keys(data).forEach((key) => {\r\n const value = data[key]\r\n if (value instanceof Date || dayjs.isDayjs(value)) {\r\n data[key] = dayjs(value).format(this.format)\r\n } else if (value && typeof value == 'object' && !Array.isArray(value)) {\r\n data[key] = objTransfer(value)\r\n } else if (value && Array.isArray(value)) {\r\n data[key] = arrayTransfer(value)\r\n }\r\n })\r\n }\r\n}\r\n"],"names":["DateSerializer","format","__publicField","data","objTransfer","result","key","value","dayjs","arrayTransfer"],"mappings":";;;;AAEA,MAAqBA,EAAe;AAAA,EAGlC,YAAYC,IAAS,2BAA2B;AAFxC,IAAAC,EAAA;AAGN,SAAK,SAASD;AAAA,EAChB;AAAA,EAEA,UAAUE,GAA+B;AACvC,UAAMF,IAAS,KAAK;AAEpB,aAASG,EAAYD,GAAiC;AACpD,YAAME,IAA+B,CAAA;AACrC,oBAAO,KAAKF,CAAI,EAAE,QAAQ,CAACG,MAAQ;AAC3B,cAAAC,IAAQJ,EAAKG,CAAG;AACtB,QAAIC,aAAiB,QAAQC,EAAM,QAAQD,CAAK,IAC9CF,EAAOC,CAAG,IAAIE,EAAMD,CAAK,EAAE,OAAON,CAAM,IAC/BM,KAASA,aAAiB,UAAU,CAAC,MAAM,QAAQA,CAAK,IAC1DF,EAAAC,CAAG,IAAIF,EAAYG,CAAK,IACtBA,KAAS,MAAM,QAAQA,CAAK,IAC9BF,EAAAC,CAAG,IAAIG,EAAcF,CAAK,IAEjCF,EAAOC,CAAG,IAAIC;AAAA,MAChB,CACD,GACMF;AAAA,IACT;AACA,aAASI,EAAcN,GAAsC;AACpDA,aAAAA,EAAK,IAAI,CAACI,MACXA,aAAiB,QAAQC,EAAM,QAAQD,CAAK,IACvCC,EAAMD,CAAK,EAAE,OAAON,CAAM,IACxBM,KAASA,aAAiB,UAAU,CAAC,MAAM,QAAQA,CAAK,IAC1DH,EAAYG,CAAK,IACfA,KAAS,MAAM,QAAQA,CAAK,IAC9BE,EAAcF,CAAK,IAEnBA,CAEV;AAAA,IACH;AAEA,WAAO,KAAKJ,CAAI,EAAE,QAAQ,CAACG,MAAQ;AAC3B,YAAAC,IAAQJ,EAAKG,CAAG;AACtB,MAAIC,aAAiB,QAAQC,EAAM,QAAQD,CAAK,IAC9CJ,EAAKG,CAAG,IAAIE,EAAMD,CAAK,EAAE,OAAO,KAAK,MAAM,IAClCA,KAAS,OAAOA,KAAS,YAAY,CAAC,MAAM,QAAQA,CAAK,IAC7DJ,EAAAG,CAAG,IAAIF,EAAYG,CAAK,IACpBA,KAAS,MAAM,QAAQA,CAAK,MAChCJ,EAAAG,CAAG,IAAIG,EAAcF,CAAK;AAAA,IACjC,CACD;AAAA,EACH;AACF;"}
@@ -1,52 +1,37 @@
1
- import ResponseError from "../error/ResponseError.js";
2
- import ExceptionResponseError from "../error/ExceptionResponseError.js";
3
- import BizExceptionResponseError from "../error/BizExceptionResponseError.js";
4
- import SessionExceptionResponseError from "../error/SessionExceptionResponseError.js";
5
- function readBlob(blob) {
6
- return new Promise((resolve) => {
7
- const reader = new FileReader();
8
- reader.addEventListener("loadend", () => {
9
- resolve(reader.result);
10
- });
11
- reader.readAsText(blob);
1
+ import l from "../error/ResponseError.js";
2
+ import i from "../error/ExceptionResponseError.js";
3
+ import p from "../error/BizExceptionResponseError.js";
4
+ import f from "../error/SessionExceptionResponseError.js";
5
+ function w(c) {
6
+ return new Promise((s) => {
7
+ const n = new FileReader();
8
+ n.addEventListener("loadend", () => {
9
+ s(n.result);
10
+ }), n.readAsText(c);
12
11
  });
13
12
  }
14
- class DivisionErrorHandler {
13
+ class R {
15
14
  constructor() {
16
15
  }
17
- async handle(error, chain) {
18
- if (error instanceof ResponseError) {
19
- const response = error.response;
20
- if (response.status == 200) {
21
- const rawData = response.data;
22
- let jsonData;
23
- if (rawData instanceof Blob) {
24
- jsonData = await readBlob(rawData);
25
- jsonData = JSON.parse(jsonData);
26
- jsonData = JSON.parse(jsonData);
27
- } else {
28
- jsonData = rawData;
29
- }
30
- const { success, errorcode, data, errortext } = jsonData;
31
- if (errorcode === "-1") {
32
- throw new ExceptionResponseError(errortext, error, response, jsonData);
33
- } else if (errorcode === "-2") {
34
- throw new BizExceptionResponseError(errortext, error, response, jsonData);
35
- } else if (errorcode === "-3") {
36
- throw new SessionExceptionResponseError(errortext, error, response, jsonData);
37
- } else {
38
- throw new ExceptionResponseError(errortext, error, response, jsonData);
39
- }
16
+ async handle(s, n) {
17
+ if (s instanceof l) {
18
+ const t = s.response;
19
+ if (t.status == 200) {
20
+ const o = t.data;
21
+ let e;
22
+ o instanceof Blob ? (e = await w(o), e = JSON.parse(e), e = JSON.parse(e)) : e = o;
23
+ const { success: d, errorcode: a, data: u, errortext: r } = e;
24
+ throw a === "-1" ? new i(r, s, t, e) : a === "-2" ? new p(r, s, t, e) : a === "-3" ? new f(r, s, t, e) : new i(r, s, t, e);
40
25
  } else {
41
- let errortext = "'" + response.config.url + "' " + response.status + " " + response.statusText;
42
- throw new ExceptionResponseError(errortext, error, response, null);
26
+ let o = "'" + t.config.url + "' " + t.status + " " + t.statusText;
27
+ throw new i(o, s, t, null);
43
28
  }
44
29
  }
45
- throw error;
30
+ throw s;
46
31
  }
47
32
  }
48
33
  export {
49
- DivisionErrorHandler as default,
50
- readBlob
34
+ R as default,
35
+ w as readBlob
51
36
  };
52
37
  //# sourceMappingURL=DivisionErrorHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DivisionErrorHandler.js","sources":["../../../src/request/disivion/DivisionErrorHandler.ts"],"sourcesContent":["// import { Modal } from 'dw-neit-antd'\r\n// import SobekThrone from '../../throne/SobekThrone'\r\n// import SobekMsgBox from '../../msgbox/SobekMsgBox'\r\n\r\nimport type ErrorHandlerChain from '../ErrorHandlerChain'\r\n\r\nimport ResponseError from '../error/ResponseError'\r\nimport ExceptionResponseError from '../error/ExceptionResponseError'\r\nimport BizExceptionResponseError from '../error/BizExceptionResponseError'\r\nimport SessionExceptionResponseError from '../error/SessionExceptionResponseError'\r\n\r\nexport function readBlob(blob: Blob): Promise<string> {\r\n return new Promise((resolve) => {\r\n const reader = new FileReader()\r\n reader.addEventListener('loadend', () => {\r\n resolve(reader.result as string)\r\n })\r\n reader.readAsText(blob)\r\n })\r\n}\r\n\r\nexport default class DivisionErrorHandler {\r\n constructor() {}\r\n\r\n async handle(error: Error, chain: ErrorHandlerChain) {\r\n if (error instanceof ResponseError) {\r\n const response = error.response\r\n if (response.status == 200) {\r\n const rawData = response.data\r\n let jsonData\r\n\r\n if (rawData instanceof Blob) {\r\n // 文件下载抛异常JSON,在Blob里面\r\n jsonData = await readBlob(rawData)\r\n jsonData = JSON.parse(jsonData)\r\n jsonData = JSON.parse(jsonData)\r\n } else {\r\n // 普通请求的异常JSON\r\n jsonData = rawData\r\n }\r\n\r\n const { success, errorcode, data, errortext } = jsonData\r\n if (errorcode === '-1') {\r\n throw new ExceptionResponseError(errortext, error, response, jsonData)\r\n } else if (errorcode === '-2') {\r\n throw new BizExceptionResponseError(errortext, error, response, jsonData)\r\n } else if (errorcode === '-3') {\r\n throw new SessionExceptionResponseError(errortext, error, response, jsonData)\r\n } else {\r\n throw new ExceptionResponseError(errortext, error, response, jsonData)\r\n }\r\n } else {\r\n let errortext = \"'\" + response.config.url + \"' \" + response.status + ' ' + response.statusText\r\n throw new ExceptionResponseError(errortext, error, response, null)\r\n }\r\n }\r\n\r\n throw error\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAWO,SAAS,SAAS,MAA6B;AAC7C,SAAA,IAAI,QAAQ,CAAC,YAAY;AACxB,UAAA,SAAS,IAAI;AACZ,WAAA,iBAAiB,WAAW,MAAM;AACvC,cAAQ,OAAO,MAAgB;AAAA,IAAA,CAChC;AACD,WAAO,WAAW,IAAI;AAAA,EAAA,CACvB;AACH;AAEA,MAAqB,qBAAqB;AAAA,EACxC,cAAc;AAAA,EAAC;AAAA,EAEf,MAAM,OAAO,OAAc,OAA0B;AACnD,QAAI,iBAAiB,eAAe;AAClC,YAAM,WAAW,MAAM;AACnB,UAAA,SAAS,UAAU,KAAK;AAC1B,cAAM,UAAU,SAAS;AACrB,YAAA;AAEJ,YAAI,mBAAmB,MAAM;AAEhB,qBAAA,MAAM,SAAS,OAAO;AACtB,qBAAA,KAAK,MAAM,QAAQ;AACnB,qBAAA,KAAK,MAAM,QAAQ;AAAA,QAAA,OACzB;AAEM,qBAAA;AAAA,QACb;AAEA,cAAM,EAAE,SAAS,WAAW,MAAM,cAAc;AAChD,YAAI,cAAc,MAAM;AACtB,gBAAM,IAAI,uBAAuB,WAAW,OAAO,UAAU,QAAQ;AAAA,QAAA,WAC5D,cAAc,MAAM;AAC7B,gBAAM,IAAI,0BAA0B,WAAW,OAAO,UAAU,QAAQ;AAAA,QAAA,WAC/D,cAAc,MAAM;AAC7B,gBAAM,IAAI,8BAA8B,WAAW,OAAO,UAAU,QAAQ;AAAA,QAAA,OACvE;AACL,gBAAM,IAAI,uBAAuB,WAAW,OAAO,UAAU,QAAQ;AAAA,QACvE;AAAA,MAAA,OACK;AACD,YAAA,YAAY,MAAM,SAAS,OAAO,MAAM,OAAO,SAAS,SAAS,MAAM,SAAS;AACpF,cAAM,IAAI,uBAAuB,WAAW,OAAO,UAAU,IAAI;AAAA,MACnE;AAAA,IACF;AAEM,UAAA;AAAA,EACR;AACF;"}
1
+ {"version":3,"file":"DivisionErrorHandler.js","sources":["../../../src/request/disivion/DivisionErrorHandler.ts"],"sourcesContent":["// import { Modal } from 'dw-neit-antd'\r\n// import SobekThrone from '../../throne/SobekThrone'\r\n// import SobekMsgBox from '../../msgbox/SobekMsgBox'\r\n\r\nimport type ErrorHandlerChain from '../ErrorHandlerChain'\r\n\r\nimport ResponseError from '../error/ResponseError'\r\nimport ExceptionResponseError from '../error/ExceptionResponseError'\r\nimport BizExceptionResponseError from '../error/BizExceptionResponseError'\r\nimport SessionExceptionResponseError from '../error/SessionExceptionResponseError'\r\n\r\nexport function readBlob(blob: Blob): Promise<string> {\r\n return new Promise((resolve) => {\r\n const reader = new FileReader()\r\n reader.addEventListener('loadend', () => {\r\n resolve(reader.result as string)\r\n })\r\n reader.readAsText(blob)\r\n })\r\n}\r\n\r\nexport default class DivisionErrorHandler {\r\n constructor() {}\r\n\r\n async handle(error: Error, chain: ErrorHandlerChain) {\r\n if (error instanceof ResponseError) {\r\n const response = error.response\r\n if (response.status == 200) {\r\n const rawData = response.data\r\n let jsonData\r\n\r\n if (rawData instanceof Blob) {\r\n // 文件下载抛异常JSON,在Blob里面\r\n jsonData = await readBlob(rawData)\r\n jsonData = JSON.parse(jsonData)\r\n jsonData = JSON.parse(jsonData)\r\n } else {\r\n // 普通请求的异常JSON\r\n jsonData = rawData\r\n }\r\n\r\n const { success, errorcode, data, errortext } = jsonData\r\n if (errorcode === '-1') {\r\n throw new ExceptionResponseError(errortext, error, response, jsonData)\r\n } else if (errorcode === '-2') {\r\n throw new BizExceptionResponseError(errortext, error, response, jsonData)\r\n } else if (errorcode === '-3') {\r\n throw new SessionExceptionResponseError(errortext, error, response, jsonData)\r\n } else {\r\n throw new ExceptionResponseError(errortext, error, response, jsonData)\r\n }\r\n } else {\r\n let errortext = \"'\" + response.config.url + \"' \" + response.status + ' ' + response.statusText\r\n throw new ExceptionResponseError(errortext, error, response, null)\r\n }\r\n }\r\n\r\n throw error\r\n }\r\n}\r\n"],"names":["readBlob","blob","resolve","reader","DivisionErrorHandler","error","chain","ResponseError","response","rawData","jsonData","success","errorcode","data","errortext","ExceptionResponseError","BizExceptionResponseError","SessionExceptionResponseError"],"mappings":";;;;AAWO,SAASA,EAASC,GAA6B;AAC7C,SAAA,IAAI,QAAQ,CAACC,MAAY;AACxB,UAAAC,IAAS,IAAI;AACZ,IAAAA,EAAA,iBAAiB,WAAW,MAAM;AACvC,MAAAD,EAAQC,EAAO,MAAgB;AAAA,IAAA,CAChC,GACDA,EAAO,WAAWF,CAAI;AAAA,EAAA,CACvB;AACH;AAEA,MAAqBG,EAAqB;AAAA,EACxC,cAAc;AAAA,EAAC;AAAA,EAEf,MAAM,OAAOC,GAAcC,GAA0B;AACnD,QAAID,aAAiBE,GAAe;AAClC,YAAMC,IAAWH,EAAM;AACnB,UAAAG,EAAS,UAAU,KAAK;AAC1B,cAAMC,IAAUD,EAAS;AACrB,YAAAE;AAEJ,QAAID,aAAmB,QAEVC,IAAA,MAAMV,EAASS,CAAO,GACtBC,IAAA,KAAK,MAAMA,CAAQ,GACnBA,IAAA,KAAK,MAAMA,CAAQ,KAGnBA,IAAAD;AAGb,cAAM,EAAE,SAAAE,GAAS,WAAAC,GAAW,MAAAC,GAAM,WAAAC,MAAcJ;AAChD,cAAIE,MAAc,OACV,IAAIG,EAAuBD,GAAWT,GAAOG,GAAUE,CAAQ,IAC5DE,MAAc,OACjB,IAAII,EAA0BF,GAAWT,GAAOG,GAAUE,CAAQ,IAC/DE,MAAc,OACjB,IAAIK,EAA8BH,GAAWT,GAAOG,GAAUE,CAAQ,IAEtE,IAAIK,EAAuBD,GAAWT,GAAOG,GAAUE,CAAQ;AAAA,MACvE,OACK;AACD,YAAAI,IAAY,MAAMN,EAAS,OAAO,MAAM,OAAOA,EAAS,SAAS,MAAMA,EAAS;AACpF,cAAM,IAAIO,EAAuBD,GAAWT,GAAOG,GAAU,IAAI;AAAA,MACnE;AAAA,IACF;AAEM,UAAAH;AAAA,EACR;AACF;"}
@@ -1,21 +1,15 @@
1
- class DivisionResponseParser {
2
- parse(response, chain) {
3
- const contentType = response.headers["content-type"];
4
- if (!contentType) {
5
- return chain.doParse(response, chain);
6
- }
7
- if (contentType.indexOf("application/json") === -1) {
8
- return chain.doParse(response, chain);
9
- }
10
- const { success, errorcode, data, errortext } = typeof response.data === "string" ? JSON.parse(response.data) : response.data;
11
- if (success === true) {
12
- return chain.doParse(data, chain);
13
- } else {
14
- throw new Error(errortext);
15
- }
1
+ class n {
2
+ parse(t, r) {
3
+ const e = t.headers["content-type"];
4
+ if (!e || e.indexOf("application/json") === -1)
5
+ return r.doParse(t, r);
6
+ const { success: a, errorcode: f, data: o, errortext: d } = typeof t.data == "string" ? JSON.parse(t.data) : t.data;
7
+ if (a === !0)
8
+ return r.doParse(o, r);
9
+ throw new Error(d);
16
10
  }
17
11
  }
18
12
  export {
19
- DivisionResponseParser as default
13
+ n as default
20
14
  };
21
15
  //# sourceMappingURL=DivisionResponseParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DivisionResponseParser.js","sources":["../../../src/request/disivion/DivisionResponseParser.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport type ResponseParserChain from '../ResponseParserChain'\r\n\r\nexport default class DivisionResponseParser {\r\n parse(response: AxiosResponse, chain: ResponseParserChain) {\r\n // server 端不响应内容\r\n const contentType = response.headers['content-type']\r\n if (!contentType) {\r\n return chain.doParse(response, chain)\r\n }\r\n\r\n // server 端响应的不是 application/json 协议\r\n if (contentType.indexOf('application/json') === -1) {\r\n return chain.doParse(response, chain)\r\n }\r\n\r\n // data为string时,兼容ie\r\n const { success, errorcode, data, errortext } = typeof response.data === 'string' ? JSON.parse(response.data) : response.data\r\n if (success === true) {\r\n return chain.doParse(data, chain)\r\n } else {\r\n throw new Error(errortext)\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":"AAGA,MAAqB,uBAAuB;AAAA,EAC1C,MAAM,UAAyB,OAA4B;AAEnD,UAAA,cAAc,SAAS,QAAQ,cAAc;AACnD,QAAI,CAAC,aAAa;AACT,aAAA,MAAM,QAAQ,UAAU,KAAK;AAAA,IACtC;AAGA,QAAI,YAAY,QAAQ,kBAAkB,MAAM,IAAI;AAC3C,aAAA,MAAM,QAAQ,UAAU,KAAK;AAAA,IACtC;AAGA,UAAM,EAAE,SAAS,WAAW,MAAM,cAAc,OAAO,SAAS,SAAS,WAAW,KAAK,MAAM,SAAS,IAAI,IAAI,SAAS;AACzH,QAAI,YAAY,MAAM;AACb,aAAA,MAAM,QAAQ,MAAM,KAAK;AAAA,IAAA,OAC3B;AACC,YAAA,IAAI,MAAM,SAAS;AAAA,IAC3B;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"DivisionResponseParser.js","sources":["../../../src/request/disivion/DivisionResponseParser.ts"],"sourcesContent":["import type { AxiosResponse } from 'axios'\r\nimport type ResponseParserChain from '../ResponseParserChain'\r\n\r\nexport default class DivisionResponseParser {\r\n parse(response: AxiosResponse, chain: ResponseParserChain) {\r\n // server 端不响应内容\r\n const contentType = response.headers['content-type']\r\n if (!contentType) {\r\n return chain.doParse(response, chain)\r\n }\r\n\r\n // server 端响应的不是 application/json 协议\r\n if (contentType.indexOf('application/json') === -1) {\r\n return chain.doParse(response, chain)\r\n }\r\n\r\n // data为string时,兼容ie\r\n const { success, errorcode, data, errortext } = typeof response.data === 'string' ? JSON.parse(response.data) : response.data\r\n if (success === true) {\r\n return chain.doParse(data, chain)\r\n } else {\r\n throw new Error(errortext)\r\n }\r\n }\r\n}\r\n"],"names":["DivisionResponseParser","response","chain","contentType","success","errorcode","data","errortext"],"mappings":"AAGA,MAAqBA,EAAuB;AAAA,EAC1C,MAAMC,GAAyBC,GAA4B;AAEnD,UAAAC,IAAcF,EAAS,QAAQ,cAAc;AAMnD,QALI,CAACE,KAKDA,EAAY,QAAQ,kBAAkB,MAAM;AACvC,aAAAD,EAAM,QAAQD,GAAUC,CAAK;AAItC,UAAM,EAAE,SAAAE,GAAS,WAAAC,GAAW,MAAAC,GAAM,WAAAC,MAAc,OAAON,EAAS,QAAS,WAAW,KAAK,MAAMA,EAAS,IAAI,IAAIA,EAAS;AACzH,QAAIG,MAAY;AACP,aAAAF,EAAM,QAAQI,GAAMJ,CAAK;AAE1B,UAAA,IAAI,MAAMK,CAAS;AAAA,EAE7B;AACF;"}