@ued_fpi/data-visual 1.0.11 → 1.1.1

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 (357) hide show
  1. package/dist/es/aims/service/request.mjs +1 -1
  2. package/dist/es/aims/src/AirQualityCalendar/index.mjs +12 -7
  3. package/dist/es/aims/src/AirQualityLevelMonthRatio/index.mjs +5 -5
  4. package/dist/es/aims/src/AirQualityLevelYearRatio/index.mjs +3 -3
  5. package/dist/es/aims/src/AirQualityPresentSituation/index.mjs +10 -13
  6. package/dist/es/aims/src/AirQualityRealTime/index.mjs +13 -16
  7. package/dist/es/aims/src/AirTimeSeriesAnalysis/index.mjs +1 -1
  8. package/dist/es/aims/src/CieqContributionMonthRatio/index.mjs +3 -3
  9. package/dist/es/aims/src/CieqContributionYearRatio/index.mjs +5 -5
  10. package/dist/es/aims/src/FactorRealTimeRankChart/index.mjs +6 -7
  11. package/dist/es/aims/src/FactorRealTimeRankList/index.mjs +7 -7
  12. package/dist/es/aims/src/FactorTargetYearPeriod/index.mjs +3 -3
  13. package/dist/es/aims/src/MainPollutionMonthRatio/index.mjs +3 -3
  14. package/dist/es/aims/src/MainPollutionYearRatio/index.mjs +3 -3
  15. package/dist/es/aims/src/MulGridAirQualityLevelMonthRatio/index.mjs +3 -3
  16. package/dist/es/aims/src/MulGridCieqContributionMonthRatio/index.mjs +3 -3
  17. package/dist/es/aims/src/TbHbAnalysis/index.mjs +4 -4
  18. package/dist/es/aims/src/WeatherCondition/index.mjs +5 -5
  19. package/dist/es/aims/src/common/BasicDialog/index.mjs +3 -3
  20. package/dist/es/aims/src/common/BasicEcharts/index.mjs +2 -2
  21. package/dist/es/aims/src/common/BasicPanel/index.mjs +3 -1
  22. package/dist/es/aims/utils/tools.mjs +1 -1
  23. package/dist/es/bmp/config/index.mjs +7 -0
  24. package/dist/es/bmp/service/base-serve.d.ts +4 -0
  25. package/dist/es/bmp/service/base-serve.mjs +12 -0
  26. package/dist/es/bmp/service/request.d.ts +3 -0
  27. package/dist/es/bmp/service/request.mjs +78 -0
  28. package/dist/es/bmp/service/types.d.ts +14 -0
  29. package/dist/es/bmp/src/AlgaeMonitoring/api/index.d.ts +6 -0
  30. package/dist/es/bmp/src/AlgaeMonitoring/api/index.mjs +12 -0
  31. package/dist/es/bmp/src/AlgaeMonitoring/api/types.d.ts +21 -0
  32. package/dist/es/bmp/src/AlgaeMonitoring/images/checked.mjs +3 -0
  33. package/dist/es/bmp/src/AlgaeMonitoring/images/today-alarm.mjs +3 -0
  34. package/dist/es/bmp/src/AlgaeMonitoring/index.d.ts +97 -0
  35. package/dist/es/bmp/src/AlgaeMonitoring/index.mjs +193 -0
  36. package/dist/es/bmp/src/AlgaeMonitoring/index.vue.d.ts +6 -0
  37. package/dist/es/bmp/src/index.d.ts +1 -1
  38. package/dist/es/bmp/src/index.mjs +2 -2
  39. package/dist/es/index.mjs +58 -20
  40. package/dist/es/ipes/service/request.mjs +2 -1
  41. package/dist/es/ipes/src/AccessVehicleManage/index.d.ts +81 -7
  42. package/dist/es/ipes/src/AccessVehicleManage/index.mjs +103 -40
  43. package/dist/es/ipes/src/AccessVehicleManage/index.vue.d.ts +48 -3
  44. package/dist/es/ipes/src/AirPollutionDischarge/images/new-nodata.mjs +3 -0
  45. package/dist/es/ipes/src/AirPollutionDischarge/index.d.ts +3 -107
  46. package/dist/es/ipes/src/AirPollutionDischarge/index.mjs +184 -127
  47. package/dist/es/ipes/src/AirPollutionDischarge/index.vue.d.ts +1 -64
  48. package/dist/es/ipes/src/AirQuality/index.mjs +25 -16
  49. package/dist/es/ipes/src/AirQualityManagement/index.mjs +31 -20
  50. package/dist/es/ipes/src/AlarmManage/images/alarm.mjs +3 -0
  51. package/dist/es/ipes/src/AlarmManage/images/modeluIcon.mjs +3 -0
  52. package/dist/es/ipes/src/AlarmManage/images/new-nodata.mjs +3 -0
  53. package/dist/es/ipes/src/AlarmManage/index.d.ts +89 -0
  54. package/dist/es/ipes/src/AlarmManage/index.mjs +175 -0
  55. package/dist/es/ipes/src/AlarmManage/index.vue.d.ts +2 -0
  56. package/dist/es/ipes/src/AlarmManage/type.d.ts +5 -0
  57. package/dist/es/ipes/src/BusinessManage/images/icon-percent.mjs +3 -0
  58. package/dist/es/ipes/src/BusinessManage/index.d.ts +89 -0
  59. package/dist/es/ipes/src/BusinessManage/index.mjs +196 -0
  60. package/dist/es/ipes/src/BusinessManage/index.vue.d.ts +2 -0
  61. package/dist/es/ipes/src/BusinessManage/type.d.ts +10 -0
  62. package/dist/es/ipes/src/EmergencyDuty/index.mjs +3 -3
  63. package/dist/es/ipes/src/EnterpriseProtectionCode/index.d.ts +38 -3
  64. package/dist/es/ipes/src/EnterpriseProtectionCode/index.mjs +52 -30
  65. package/dist/es/ipes/src/EnterpriseProtectionCode/index.vue.d.ts +22 -1
  66. package/dist/es/ipes/src/EnvManage/index.mjs +17 -14
  67. package/dist/es/ipes/src/EnvironmentalProtection/images/module-title-icon.mjs +3 -0
  68. package/dist/es/ipes/src/EnvironmentalProtection/images/piebottom.mjs +3 -0
  69. package/dist/es/ipes/src/EnvironmentalProtection/images/pietop.mjs +3 -0
  70. package/dist/es/ipes/src/EnvironmentalProtection/index.d.ts +101 -0
  71. package/dist/es/ipes/src/EnvironmentalProtection/index.mjs +177 -0
  72. package/dist/es/ipes/src/EnvironmentalProtection/index.vue.d.ts +6 -0
  73. package/dist/es/ipes/src/EnvironmentalRiskManagement/.mjs +2 -2
  74. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.d.ts +23 -3
  75. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.mjs +48 -12
  76. package/dist/es/ipes/src/EnvironmentalRiskManagement/index.vue.d.ts +13 -1
  77. package/dist/es/ipes/src/GasControl/.mjs +120 -0
  78. package/dist/es/ipes/src/GasControl/components/AlarmStatistics.vue.d.ts +22 -0
  79. package/dist/es/ipes/src/GasControl/components/SingleItem.vue.d.ts +16 -0
  80. package/dist/es/{bmp/src/test-com → ipes/src/GasControl}/index.d.ts +28 -24
  81. package/dist/es/ipes/src/GasControl/index.mjs +103 -0
  82. package/dist/es/ipes/src/GasControl/index.vue.d.ts +23 -0
  83. package/dist/es/ipes/src/GeneralManagement/.mjs +14 -17
  84. package/dist/es/ipes/src/GeneralManagement/components/Tabs.vue.d.ts +10 -6
  85. package/dist/es/ipes/src/GeneralManagement/index.d.ts +18 -9
  86. package/dist/es/ipes/src/GeneralManagement/index.mjs +9 -11
  87. package/dist/es/ipes/src/GeneralManagement/index.vue.d.ts +12 -6
  88. package/dist/es/ipes/src/HazardousVehicleManage/index.d.ts +82 -14
  89. package/dist/es/ipes/src/HazardousVehicleManage/index.mjs +67 -42
  90. package/dist/es/ipes/src/HazardousVehicleManage/index.vue.d.ts +48 -5
  91. package/dist/es/ipes/src/InspectionManage/images/module-title-icon.mjs +3 -0
  92. package/dist/es/ipes/src/InspectionManage/images/new-nodata.mjs +3 -0
  93. package/dist/es/ipes/src/InspectionManage/index.d.ts +136 -0
  94. package/dist/es/ipes/src/InspectionManage/index.mjs +267 -0
  95. package/dist/es/ipes/src/InspectionManage/index.vue.d.ts +27 -0
  96. package/dist/es/ipes/src/InspectionManage/types/index.d.ts +11 -0
  97. package/dist/es/ipes/src/Level3AirDefense/.mjs +38 -12
  98. package/dist/es/ipes/src/Level3AirDefense/components/EmptyData.vue.d.ts +14 -0
  99. package/dist/es/ipes/src/Level3AirDefense/images/empty.mjs +3 -0
  100. package/dist/es/ipes/src/Level3AirDefense/index.mjs +10 -9
  101. package/dist/es/ipes/src/OdorControl/index.mjs +1 -1
  102. package/dist/es/ipes/src/PollutantSourceManage/index.d.ts +168 -0
  103. package/dist/es/ipes/src/PollutantSourceManage/index.mjs +90 -0
  104. package/dist/es/ipes/src/PollutantSourceManage/index.vue.d.ts +42 -0
  105. package/dist/es/ipes/src/PollutantSourceManage/types.d.ts +18 -0
  106. package/dist/es/ipes/src/RealTimeAirQualityManage/index.mjs +1 -1
  107. package/dist/es/ipes/src/SealingManage/index.d.ts +121 -14
  108. package/dist/es/ipes/src/SealingManage/index.mjs +221 -83
  109. package/dist/es/ipes/src/SealingManage/index.vue.d.ts +72 -5
  110. package/dist/es/ipes/src/TaskDispose/.mjs +2 -2
  111. package/dist/es/ipes/src/VocStatistics/index.mjs +2 -2
  112. package/dist/es/ipes/src/WaterNetworkManage/index.d.ts +81 -7
  113. package/dist/es/ipes/src/WaterNetworkManage/index.mjs +71 -39
  114. package/dist/es/ipes/src/WaterNetworkManage/index.vue.d.ts +48 -3
  115. package/dist/es/ipes/src/common/Echarts.mjs +2 -2
  116. package/dist/es/ipes/src/common/IpesPercentBar.mjs +38 -0
  117. package/dist/es/ipes/src/common/IpesProgressBar.mjs +38 -0
  118. package/dist/es/ipes/src/common/LottieAnimation.mjs +3 -3
  119. package/dist/es/ipes/src/index.d.ts +6 -0
  120. package/dist/es/ipes/src/index.mjs +12 -0
  121. package/dist/es/style.css +1514 -909
  122. package/dist/es/wgms/service/request.mjs +1 -1
  123. package/dist/es/wgms/src/AuxiliaryJudgment/index.mjs +3 -3
  124. package/dist/es/wgms/src/ChangesAlongTheProcess/index.mjs +3 -3
  125. package/dist/es/wgms/src/ChlorophyllAchangeRate/index.mjs +5 -5
  126. package/dist/es/wgms/src/CrossSectionCorrelation/index.mjs +4 -4
  127. package/dist/es/wgms/src/DistributionPoints/index.mjs +4 -4
  128. package/dist/es/wgms/src/DrinkingWaterComplianceRate/index.mjs +2 -2
  129. package/dist/es/wgms/src/EnvironmentalAnalysis/index.mjs +7 -5
  130. package/dist/es/wgms/src/FactorTopThreeRanking/index.mjs +4 -4
  131. package/dist/es/wgms/src/FactorTrendComparison/index.mjs +2 -2
  132. package/dist/es/wgms/src/KeyRiverWaterQualityEvaluation/index.mjs +3 -3
  133. package/dist/es/wgms/src/LakeRiverIndex/index.mjs +4 -4
  134. package/dist/es/wgms/src/NPTrendChange/index.mjs +2 -2
  135. package/dist/es/wgms/src/SevenDayKline/index.mjs +4 -4
  136. package/dist/es/wgms/src/SewageOutletsOnlineMonitor/index.mjs +4 -4
  137. package/dist/es/wgms/src/SewageOutletsOnlineMonitor/index.vue.d.ts +0 -1
  138. package/dist/es/wgms/src/SubordinateRanking/index.mjs +7 -4
  139. package/dist/es/wgms/src/SurroundingPollution/index.mjs +5 -5
  140. package/dist/es/wgms/src/UpstreamImpact/index.mjs +3 -3
  141. package/dist/es/wgms/src/UpstreamSection/index.mjs +3 -3
  142. package/dist/es/wgms/src/WaterEnvironmentOnlineMonitor/index.mjs +2 -2
  143. package/dist/es/wgms/src/WaterQualityClassification/index.mjs +3 -3
  144. package/dist/es/wgms/src/WaterQualityRainfall/index.mjs +3 -3
  145. package/dist/es/wgms/src/WaterQualityStatus/index.mjs +3 -3
  146. package/dist/es/wgms/src/common/select-panel.mjs +3 -1
  147. package/dist/es/wgms/utils/echarts/index.mjs +14 -2
  148. package/dist/es/wgms/utils/tools.mjs +1 -1
  149. package/dist/lib/aims/service/request.js +3 -3
  150. package/dist/lib/aims/src/AirQualityCalendar/index.js +20 -15
  151. package/dist/lib/aims/src/AirQualityLevelMonthRatio/index.js +6 -6
  152. package/dist/lib/aims/src/AirQualityLevelYearRatio/index.js +4 -4
  153. package/dist/lib/aims/src/AirQualityPresentSituation/index.js +9 -12
  154. package/dist/lib/aims/src/AirQualityRealTime/index.js +12 -15
  155. package/dist/lib/aims/src/AirTimeSeriesAnalysis/index.js +5 -5
  156. package/dist/lib/aims/src/CieqContributionMonthRatio/index.js +4 -4
  157. package/dist/lib/aims/src/CieqContributionYearRatio/index.js +6 -6
  158. package/dist/lib/aims/src/FactorRealTimeRankChart/index.js +7 -8
  159. package/dist/lib/aims/src/FactorRealTimeRankList/index.js +8 -8
  160. package/dist/lib/aims/src/FactorTargetYearPeriod/index.js +4 -4
  161. package/dist/lib/aims/src/MainPollutionMonthRatio/index.js +4 -4
  162. package/dist/lib/aims/src/MainPollutionYearRatio/index.js +4 -4
  163. package/dist/lib/aims/src/MulGridAirQualityLevelMonthRatio/index.js +4 -4
  164. package/dist/lib/aims/src/MulGridCieqContributionMonthRatio/index.js +4 -4
  165. package/dist/lib/aims/src/TbHbAnalysis/index.js +6 -6
  166. package/dist/lib/aims/src/WeatherCondition/index.js +5 -5
  167. package/dist/lib/aims/src/common/BasicDialog/index.js +3 -3
  168. package/dist/lib/aims/src/common/BasicEcharts/index.js +21 -2
  169. package/dist/lib/aims/src/common/BasicPanel/index.js +4 -2
  170. package/dist/lib/aims/utils/tools.js +2 -2
  171. package/dist/lib/bmp/config/index.js +8 -0
  172. package/dist/lib/bmp/service/base-serve.d.ts +4 -0
  173. package/dist/lib/bmp/service/base-serve.js +14 -0
  174. package/dist/lib/bmp/service/request.d.ts +3 -0
  175. package/dist/lib/bmp/service/request.js +80 -0
  176. package/dist/lib/bmp/service/types.d.ts +14 -0
  177. package/dist/lib/bmp/src/AlgaeMonitoring/api/index.d.ts +6 -0
  178. package/dist/lib/bmp/src/AlgaeMonitoring/api/index.js +14 -0
  179. package/dist/lib/bmp/src/AlgaeMonitoring/api/types.d.ts +21 -0
  180. package/dist/lib/bmp/src/AlgaeMonitoring/images/checked.js +5 -0
  181. package/dist/lib/bmp/src/AlgaeMonitoring/images/today-alarm.js +5 -0
  182. package/dist/lib/bmp/src/AlgaeMonitoring/index.d.ts +97 -0
  183. package/dist/lib/bmp/src/AlgaeMonitoring/index.js +214 -0
  184. package/dist/lib/bmp/src/AlgaeMonitoring/index.vue.d.ts +6 -0
  185. package/dist/lib/bmp/src/index.d.ts +1 -1
  186. package/dist/lib/bmp/src/index.js +2 -2
  187. package/dist/lib/index.js +65 -21
  188. package/dist/lib/ipes/service/request.js +4 -3
  189. package/dist/lib/ipes/src/AccessVehicleManage/index.d.ts +81 -7
  190. package/dist/lib/ipes/src/AccessVehicleManage/index.js +107 -44
  191. package/dist/lib/ipes/src/AccessVehicleManage/index.vue.d.ts +48 -3
  192. package/dist/lib/ipes/src/AirPollutionDischarge/images/new-nodata.js +5 -0
  193. package/dist/lib/ipes/src/AirPollutionDischarge/index.d.ts +3 -107
  194. package/dist/lib/ipes/src/AirPollutionDischarge/index.js +183 -126
  195. package/dist/lib/ipes/src/AirPollutionDischarge/index.vue.d.ts +1 -64
  196. package/dist/lib/ipes/src/AirQuality/index.js +25 -16
  197. package/dist/lib/ipes/src/AirQualityManagement/index.js +31 -20
  198. package/dist/lib/ipes/src/AlarmManage/images/alarm.js +5 -0
  199. package/dist/lib/ipes/src/AlarmManage/images/modeluIcon.js +5 -0
  200. package/dist/lib/ipes/src/AlarmManage/images/new-nodata.js +5 -0
  201. package/dist/lib/ipes/src/AlarmManage/index.d.ts +89 -0
  202. package/dist/lib/ipes/src/AlarmManage/index.js +177 -0
  203. package/dist/lib/ipes/src/AlarmManage/index.vue.d.ts +2 -0
  204. package/dist/lib/ipes/src/AlarmManage/type.d.ts +5 -0
  205. package/dist/lib/ipes/src/BusinessManage/images/icon-percent.js +5 -0
  206. package/dist/lib/ipes/src/BusinessManage/index.d.ts +89 -0
  207. package/dist/lib/ipes/src/BusinessManage/index.js +198 -0
  208. package/dist/lib/ipes/src/BusinessManage/index.vue.d.ts +2 -0
  209. package/dist/lib/ipes/src/BusinessManage/type.d.ts +10 -0
  210. package/dist/lib/ipes/src/EmergencyDuty/index.js +3 -3
  211. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.d.ts +38 -3
  212. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.js +52 -30
  213. package/dist/lib/ipes/src/EnterpriseProtectionCode/index.vue.d.ts +22 -1
  214. package/dist/lib/ipes/src/EnvManage/index.js +19 -16
  215. package/dist/lib/ipes/src/EnvironmentalProtection/images/module-title-icon.js +5 -0
  216. package/dist/lib/ipes/src/EnvironmentalProtection/images/piebottom.js +5 -0
  217. package/dist/lib/ipes/src/EnvironmentalProtection/images/pietop.js +5 -0
  218. package/dist/lib/ipes/src/EnvironmentalProtection/index.d.ts +101 -0
  219. package/dist/lib/ipes/src/EnvironmentalProtection/index.js +179 -0
  220. package/dist/lib/ipes/src/EnvironmentalProtection/index.vue.d.ts +6 -0
  221. package/dist/lib/ipes/src/EnvironmentalRiskManagement/.js +2 -2
  222. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.d.ts +23 -3
  223. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.js +47 -11
  224. package/dist/lib/ipes/src/EnvironmentalRiskManagement/index.vue.d.ts +13 -1
  225. package/dist/lib/ipes/src/GasControl/.js +123 -0
  226. package/dist/lib/ipes/src/GasControl/components/AlarmStatistics.vue.d.ts +22 -0
  227. package/dist/lib/ipes/src/GasControl/components/SingleItem.vue.d.ts +16 -0
  228. package/dist/lib/{bmp/src/test-com → ipes/src/GasControl}/index.d.ts +28 -24
  229. package/dist/lib/ipes/src/GasControl/index.js +105 -0
  230. package/dist/lib/ipes/src/GasControl/index.vue.d.ts +23 -0
  231. package/dist/lib/ipes/src/GeneralManagement/.js +13 -16
  232. package/dist/lib/ipes/src/GeneralManagement/components/Tabs.vue.d.ts +10 -6
  233. package/dist/lib/ipes/src/GeneralManagement/index.d.ts +18 -9
  234. package/dist/lib/ipes/src/GeneralManagement/index.js +8 -10
  235. package/dist/lib/ipes/src/GeneralManagement/index.vue.d.ts +12 -6
  236. package/dist/lib/ipes/src/HazardousVehicleManage/index.d.ts +82 -14
  237. package/dist/lib/ipes/src/HazardousVehicleManage/index.js +74 -49
  238. package/dist/lib/ipes/src/HazardousVehicleManage/index.vue.d.ts +48 -5
  239. package/dist/lib/ipes/src/InspectionManage/images/module-title-icon.js +5 -0
  240. package/dist/lib/ipes/src/InspectionManage/images/new-nodata.js +5 -0
  241. package/dist/lib/ipes/src/InspectionManage/index.d.ts +136 -0
  242. package/dist/lib/ipes/src/InspectionManage/index.js +269 -0
  243. package/dist/lib/ipes/src/InspectionManage/index.vue.d.ts +27 -0
  244. package/dist/lib/ipes/src/InspectionManage/types/index.d.ts +11 -0
  245. package/dist/lib/ipes/src/Level3AirDefense/.js +37 -10
  246. package/dist/lib/ipes/src/Level3AirDefense/components/EmptyData.vue.d.ts +14 -0
  247. package/dist/lib/ipes/src/Level3AirDefense/images/empty.js +5 -0
  248. package/dist/lib/ipes/src/Level3AirDefense/index.js +9 -8
  249. package/dist/lib/ipes/src/OdorControl/index.js +2 -2
  250. package/dist/lib/ipes/src/PollutantSourceManage/index.d.ts +168 -0
  251. package/dist/lib/ipes/src/PollutantSourceManage/index.js +92 -0
  252. package/dist/lib/ipes/src/PollutantSourceManage/index.vue.d.ts +42 -0
  253. package/dist/lib/ipes/src/PollutantSourceManage/types.d.ts +18 -0
  254. package/dist/lib/ipes/src/RealTimeAirQualityManage/index.js +2 -2
  255. package/dist/lib/ipes/src/SealingManage/index.d.ts +121 -14
  256. package/dist/lib/ipes/src/SealingManage/index.js +222 -84
  257. package/dist/lib/ipes/src/SealingManage/index.vue.d.ts +72 -5
  258. package/dist/lib/ipes/src/TaskDispose/.js +21 -2
  259. package/dist/lib/ipes/src/VocStatistics/index.js +2 -2
  260. package/dist/lib/ipes/src/WaterNetworkManage/index.d.ts +81 -7
  261. package/dist/lib/ipes/src/WaterNetworkManage/index.js +73 -41
  262. package/dist/lib/ipes/src/WaterNetworkManage/index.vue.d.ts +48 -3
  263. package/dist/lib/ipes/src/common/Echarts.js +21 -2
  264. package/dist/lib/ipes/src/common/IpesPercentBar.js +40 -0
  265. package/dist/lib/ipes/src/common/IpesProgressBar.js +40 -0
  266. package/dist/lib/ipes/src/common/LottieAnimation.js +2 -2
  267. package/dist/lib/ipes/src/index.d.ts +6 -0
  268. package/dist/lib/ipes/src/index.js +12 -0
  269. package/dist/lib/style.css +1514 -909
  270. package/dist/lib/wgms/service/request.js +3 -3
  271. package/dist/lib/wgms/src/AuxiliaryJudgment/index.js +5 -5
  272. package/dist/lib/wgms/src/ChangesAlongTheProcess/index.js +4 -4
  273. package/dist/lib/wgms/src/ChlorophyllAchangeRate/index.js +4 -4
  274. package/dist/lib/wgms/src/CrossSectionCorrelation/index.js +6 -6
  275. package/dist/lib/wgms/src/DistributionPoints/index.js +3 -3
  276. package/dist/lib/wgms/src/DrinkingWaterComplianceRate/index.js +2 -2
  277. package/dist/lib/wgms/src/EnvironmentalAnalysis/index.js +10 -8
  278. package/dist/lib/wgms/src/FactorTopThreeRanking/index.js +3 -3
  279. package/dist/lib/wgms/src/FactorTrendComparison/index.js +2 -2
  280. package/dist/lib/wgms/src/KeyRiverWaterQualityEvaluation/index.js +3 -3
  281. package/dist/lib/wgms/src/LakeRiverIndex/index.js +6 -6
  282. package/dist/lib/wgms/src/NPTrendChange/index.js +2 -2
  283. package/dist/lib/wgms/src/SevenDayKline/index.js +9 -9
  284. package/dist/lib/wgms/src/SewageOutletsOnlineMonitor/index.js +4 -4
  285. package/dist/lib/wgms/src/SewageOutletsOnlineMonitor/index.vue.d.ts +0 -1
  286. package/dist/lib/wgms/src/SubordinateRanking/index.js +12 -9
  287. package/dist/lib/wgms/src/SurroundingPollution/index.js +8 -8
  288. package/dist/lib/wgms/src/UpstreamImpact/index.js +4 -4
  289. package/dist/lib/wgms/src/UpstreamSection/index.js +3 -3
  290. package/dist/lib/wgms/src/WaterEnvironmentOnlineMonitor/index.js +2 -2
  291. package/dist/lib/wgms/src/WaterQualityClassification/index.js +3 -3
  292. package/dist/lib/wgms/src/WaterQualityRainfall/index.js +5 -5
  293. package/dist/lib/wgms/src/WaterQualityStatus/index.js +3 -3
  294. package/dist/lib/wgms/src/common/select-panel.js +4 -2
  295. package/dist/lib/wgms/utils/echarts/index.js +34 -3
  296. package/dist/lib/wgms/utils/tools.js +2 -2
  297. package/package.json +2 -2
  298. package/dist/es/bmp/src/test-com/index.mjs +0 -33
  299. package/dist/es/bmp/src/test-com/index.vue.d.ts +0 -23
  300. package/dist/es/bmp/src/test-com/types.d.ts +0 -16
  301. package/dist/es/vendor/@ctrl_tinycolor@3.6.0.mjs +0 -1136
  302. package/dist/es/vendor/@element-plus_icons-vue@2.0.10_vue@3.3.4.mjs +0 -376
  303. package/dist/es/vendor/@floating-ui_core@1.3.1.mjs +0 -1
  304. package/dist/es/vendor/@floating-ui_dom@1.4.4.mjs +0 -1
  305. package/dist/es/vendor/@sxzz_popperjs-es@2.11.7.mjs +0 -3
  306. package/dist/es/vendor/@ued_fpi_element-plus-expand@0.7.19.mjs +0 -243
  307. package/dist/es/vendor/@vue_reactivity@3.3.4.mjs +0 -1
  308. package/dist/es/vendor/@vue_shared@3.3.4.mjs +0 -29
  309. package/dist/es/vendor/@vueuse_core@9.13.0_vue@3.3.4.mjs +0 -214
  310. package/dist/es/vendor/@vueuse_shared@9.13.0_vue@3.3.4.mjs +0 -72
  311. package/dist/es/vendor/async-validator@4.2.5.mjs +0 -1
  312. package/dist/es/vendor/axios@1.4.0.mjs +0 -3209
  313. package/dist/es/vendor/claygl@1.3.0.mjs +0 -24199
  314. package/dist/es/vendor/dayjs@1.11.9.mjs +0 -88
  315. package/dist/es/vendor/echarts-gl@2.0.9_echarts@5.4.2.mjs +0 -20973
  316. package/dist/es/vendor/echarts@5.4.2.mjs +0 -79359
  317. package/dist/es/vendor/element-plus@2.3.7_vue@3.3.4.mjs +0 -11032
  318. package/dist/es/vendor/escape-html@1.0.3.mjs +0 -1
  319. package/dist/es/vendor/fpi-tg-factor-tools@1.0.4.mjs +0 -195
  320. package/dist/es/vendor/lodash-es@4.17.21.mjs +0 -3255
  321. package/dist/es/vendor/lodash-unified@1.0.3_tknf7errc3xdqocd3ryzzla7vq.mjs +0 -1
  322. package/dist/es/vendor/memoize-one@6.0.0.mjs +0 -1
  323. package/dist/es/vendor/normalize-wheel-es@1.2.0.mjs +0 -1
  324. package/dist/es/vendor/tslib@2.3.0.mjs +0 -32
  325. package/dist/es/vendor/vue-demi@0.14.5_vue@3.3.4.mjs +0 -1
  326. package/dist/es/vendor/vue3-seamless-scroll@2.0.1.mjs +0 -562
  327. package/dist/es/vendor/zrender@5.4.3.mjs +0 -16894
  328. package/dist/lib/bmp/src/test-com/index.js +0 -35
  329. package/dist/lib/bmp/src/test-com/index.vue.d.ts +0 -23
  330. package/dist/lib/bmp/src/test-com/types.d.ts +0 -16
  331. package/dist/lib/vendor/@ctrl_tinycolor@3.6.0.js +0 -1138
  332. package/dist/lib/vendor/@element-plus_icons-vue@2.0.10_vue@3.3.4.js +0 -396
  333. package/dist/lib/vendor/@floating-ui_core@1.3.1.js +0 -2
  334. package/dist/lib/vendor/@floating-ui_dom@1.4.4.js +0 -2
  335. package/dist/lib/vendor/@sxzz_popperjs-es@2.11.7.js +0 -6
  336. package/dist/lib/vendor/@ued_fpi_element-plus-expand@0.7.19.js +0 -245
  337. package/dist/lib/vendor/@vue_reactivity@3.3.4.js +0 -2
  338. package/dist/lib/vendor/@vue_shared@3.3.4.js +0 -39
  339. package/dist/lib/vendor/@vueuse_core@9.13.0_vue@3.3.4.js +0 -219
  340. package/dist/lib/vendor/@vueuse_shared@9.13.0_vue@3.3.4.js +0 -82
  341. package/dist/lib/vendor/async-validator@4.2.5.js +0 -2
  342. package/dist/lib/vendor/axios@1.4.0.js +0 -3211
  343. package/dist/lib/vendor/claygl@1.3.0.js +0 -24255
  344. package/dist/lib/vendor/dayjs@1.11.9.js +0 -98
  345. package/dist/lib/vendor/echarts-gl@2.0.9_echarts@5.4.2.js +0 -20975
  346. package/dist/lib/vendor/echarts@5.4.2.js +0 -79400
  347. package/dist/lib/vendor/element-plus@2.3.7_vue@3.3.4.js +0 -11041
  348. package/dist/lib/vendor/escape-html@1.0.3.js +0 -2
  349. package/dist/lib/vendor/fpi-tg-factor-tools@1.0.4.js +0 -201
  350. package/dist/lib/vendor/lodash-es@4.17.21.js +0 -3265
  351. package/dist/lib/vendor/lodash-unified@1.0.3_tknf7errc3xdqocd3ryzzla7vq.js +0 -2
  352. package/dist/lib/vendor/memoize-one@6.0.0.js +0 -2
  353. package/dist/lib/vendor/normalize-wheel-es@1.2.0.js +0 -2
  354. package/dist/lib/vendor/tslib@2.3.0.js +0 -34
  355. package/dist/lib/vendor/vue-demi@0.14.5_vue@3.3.4.js +0 -4
  356. package/dist/lib/vendor/vue3-seamless-scroll@2.0.1.js +0 -564
  357. package/dist/lib/vendor/zrender@5.4.3.js +0 -17049
@@ -1,1138 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Take input from [0, n] and return it as [0, 1]
5
- * @hidden
6
- */
7
- function bound01(n, max) {
8
- if (isOnePointZero(n)) {
9
- n = '100%';
10
- }
11
- var isPercent = isPercentage(n);
12
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
13
- // Automatically convert percentage into number
14
- if (isPercent) {
15
- n = parseInt(String(n * max), 10) / 100;
16
- }
17
- // Handle floating point rounding errors
18
- if (Math.abs(n - max) < 0.000001) {
19
- return 1;
20
- }
21
- // Convert into [0, 1] range if it isn't already
22
- if (max === 360) {
23
- // If n is a hue given in degrees,
24
- // wrap around out-of-range values into [0, 360] range
25
- // then convert into [0, 1].
26
- n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
27
- }
28
- else {
29
- // If n not a hue given in degrees
30
- // Convert into [0, 1] range if it isn't already.
31
- n = (n % max) / parseFloat(String(max));
32
- }
33
- return n;
34
- }
35
- /**
36
- * Force a number between 0 and 1
37
- * @hidden
38
- */
39
- function clamp01(val) {
40
- return Math.min(1, Math.max(0, val));
41
- }
42
- /**
43
- * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
44
- * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
45
- * @hidden
46
- */
47
- function isOnePointZero(n) {
48
- return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
49
- }
50
- /**
51
- * Check to see if string passed in is a percentage
52
- * @hidden
53
- */
54
- function isPercentage(n) {
55
- return typeof n === 'string' && n.indexOf('%') !== -1;
56
- }
57
- /**
58
- * Return a valid alpha value [0,1] with all invalid values being set to 1
59
- * @hidden
60
- */
61
- function boundAlpha(a) {
62
- a = parseFloat(a);
63
- if (isNaN(a) || a < 0 || a > 1) {
64
- a = 1;
65
- }
66
- return a;
67
- }
68
- /**
69
- * Replace a decimal with it's percentage value
70
- * @hidden
71
- */
72
- function convertToPercentage(n) {
73
- if (n <= 1) {
74
- return "".concat(Number(n) * 100, "%");
75
- }
76
- return n;
77
- }
78
- /**
79
- * Force a hex value to have 2 characters
80
- * @hidden
81
- */
82
- function pad2(c) {
83
- return c.length === 1 ? '0' + c : String(c);
84
- }
85
-
86
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
87
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
88
- /**
89
- * Handle bounds / percentage checking to conform to CSS color spec
90
- * <http://www.w3.org/TR/css3-color/>
91
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
92
- * *Returns:* { r, g, b } in [0, 255]
93
- */
94
- function rgbToRgb(r, g, b) {
95
- return {
96
- r: bound01(r, 255) * 255,
97
- g: bound01(g, 255) * 255,
98
- b: bound01(b, 255) * 255,
99
- };
100
- }
101
- /**
102
- * Converts an RGB color value to HSL.
103
- * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
104
- * *Returns:* { h, s, l } in [0,1]
105
- */
106
- function rgbToHsl(r, g, b) {
107
- r = bound01(r, 255);
108
- g = bound01(g, 255);
109
- b = bound01(b, 255);
110
- var max = Math.max(r, g, b);
111
- var min = Math.min(r, g, b);
112
- var h = 0;
113
- var s = 0;
114
- var l = (max + min) / 2;
115
- if (max === min) {
116
- s = 0;
117
- h = 0; // achromatic
118
- }
119
- else {
120
- var d = max - min;
121
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
122
- switch (max) {
123
- case r:
124
- h = (g - b) / d + (g < b ? 6 : 0);
125
- break;
126
- case g:
127
- h = (b - r) / d + 2;
128
- break;
129
- case b:
130
- h = (r - g) / d + 4;
131
- break;
132
- }
133
- h /= 6;
134
- }
135
- return { h: h, s: s, l: l };
136
- }
137
- function hue2rgb(p, q, t) {
138
- if (t < 0) {
139
- t += 1;
140
- }
141
- if (t > 1) {
142
- t -= 1;
143
- }
144
- if (t < 1 / 6) {
145
- return p + (q - p) * (6 * t);
146
- }
147
- if (t < 1 / 2) {
148
- return q;
149
- }
150
- if (t < 2 / 3) {
151
- return p + (q - p) * (2 / 3 - t) * 6;
152
- }
153
- return p;
154
- }
155
- /**
156
- * Converts an HSL color value to RGB.
157
- *
158
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
159
- * *Returns:* { r, g, b } in the set [0, 255]
160
- */
161
- function hslToRgb(h, s, l) {
162
- var r;
163
- var g;
164
- var b;
165
- h = bound01(h, 360);
166
- s = bound01(s, 100);
167
- l = bound01(l, 100);
168
- if (s === 0) {
169
- // achromatic
170
- g = l;
171
- b = l;
172
- r = l;
173
- }
174
- else {
175
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
176
- var p = 2 * l - q;
177
- r = hue2rgb(p, q, h + 1 / 3);
178
- g = hue2rgb(p, q, h);
179
- b = hue2rgb(p, q, h - 1 / 3);
180
- }
181
- return { r: r * 255, g: g * 255, b: b * 255 };
182
- }
183
- /**
184
- * Converts an RGB color value to HSV
185
- *
186
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
187
- * *Returns:* { h, s, v } in [0,1]
188
- */
189
- function rgbToHsv(r, g, b) {
190
- r = bound01(r, 255);
191
- g = bound01(g, 255);
192
- b = bound01(b, 255);
193
- var max = Math.max(r, g, b);
194
- var min = Math.min(r, g, b);
195
- var h = 0;
196
- var v = max;
197
- var d = max - min;
198
- var s = max === 0 ? 0 : d / max;
199
- if (max === min) {
200
- h = 0; // achromatic
201
- }
202
- else {
203
- switch (max) {
204
- case r:
205
- h = (g - b) / d + (g < b ? 6 : 0);
206
- break;
207
- case g:
208
- h = (b - r) / d + 2;
209
- break;
210
- case b:
211
- h = (r - g) / d + 4;
212
- break;
213
- }
214
- h /= 6;
215
- }
216
- return { h: h, s: s, v: v };
217
- }
218
- /**
219
- * Converts an HSV color value to RGB.
220
- *
221
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
222
- * *Returns:* { r, g, b } in the set [0, 255]
223
- */
224
- function hsvToRgb(h, s, v) {
225
- h = bound01(h, 360) * 6;
226
- s = bound01(s, 100);
227
- v = bound01(v, 100);
228
- var i = Math.floor(h);
229
- var f = h - i;
230
- var p = v * (1 - s);
231
- var q = v * (1 - f * s);
232
- var t = v * (1 - (1 - f) * s);
233
- var mod = i % 6;
234
- var r = [v, q, p, p, t, v][mod];
235
- var g = [t, v, v, q, p, p][mod];
236
- var b = [p, p, t, v, v, q][mod];
237
- return { r: r * 255, g: g * 255, b: b * 255 };
238
- }
239
- /**
240
- * Converts an RGB color to hex
241
- *
242
- * Assumes r, g, and b are contained in the set [0, 255]
243
- * Returns a 3 or 6 character hex
244
- */
245
- function rgbToHex(r, g, b, allow3Char) {
246
- var hex = [
247
- pad2(Math.round(r).toString(16)),
248
- pad2(Math.round(g).toString(16)),
249
- pad2(Math.round(b).toString(16)),
250
- ];
251
- // Return a 3 character hex if possible
252
- if (allow3Char &&
253
- hex[0].startsWith(hex[0].charAt(1)) &&
254
- hex[1].startsWith(hex[1].charAt(1)) &&
255
- hex[2].startsWith(hex[2].charAt(1))) {
256
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
257
- }
258
- return hex.join('');
259
- }
260
- /**
261
- * Converts an RGBA color plus alpha transparency to hex
262
- *
263
- * Assumes r, g, b are contained in the set [0, 255] and
264
- * a in [0, 1]. Returns a 4 or 8 character rgba hex
265
- */
266
- // eslint-disable-next-line max-params
267
- function rgbaToHex(r, g, b, a, allow4Char) {
268
- var hex = [
269
- pad2(Math.round(r).toString(16)),
270
- pad2(Math.round(g).toString(16)),
271
- pad2(Math.round(b).toString(16)),
272
- pad2(convertDecimalToHex(a)),
273
- ];
274
- // Return a 4 character hex if possible
275
- if (allow4Char &&
276
- hex[0].startsWith(hex[0].charAt(1)) &&
277
- hex[1].startsWith(hex[1].charAt(1)) &&
278
- hex[2].startsWith(hex[2].charAt(1)) &&
279
- hex[3].startsWith(hex[3].charAt(1))) {
280
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
281
- }
282
- return hex.join('');
283
- }
284
- /** Converts a decimal to a hex value */
285
- function convertDecimalToHex(d) {
286
- return Math.round(parseFloat(d) * 255).toString(16);
287
- }
288
- /** Converts a hex value to a decimal */
289
- function convertHexToDecimal(h) {
290
- return parseIntFromHex(h) / 255;
291
- }
292
- /** Parse a base-16 hex value into a base-10 integer */
293
- function parseIntFromHex(val) {
294
- return parseInt(val, 16);
295
- }
296
- function numberInputToObject(color) {
297
- return {
298
- r: color >> 16,
299
- g: (color & 0xff00) >> 8,
300
- b: color & 0xff,
301
- };
302
- }
303
-
304
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
305
- /**
306
- * @hidden
307
- */
308
- var names = {
309
- aliceblue: '#f0f8ff',
310
- antiquewhite: '#faebd7',
311
- aqua: '#00ffff',
312
- aquamarine: '#7fffd4',
313
- azure: '#f0ffff',
314
- beige: '#f5f5dc',
315
- bisque: '#ffe4c4',
316
- black: '#000000',
317
- blanchedalmond: '#ffebcd',
318
- blue: '#0000ff',
319
- blueviolet: '#8a2be2',
320
- brown: '#a52a2a',
321
- burlywood: '#deb887',
322
- cadetblue: '#5f9ea0',
323
- chartreuse: '#7fff00',
324
- chocolate: '#d2691e',
325
- coral: '#ff7f50',
326
- cornflowerblue: '#6495ed',
327
- cornsilk: '#fff8dc',
328
- crimson: '#dc143c',
329
- cyan: '#00ffff',
330
- darkblue: '#00008b',
331
- darkcyan: '#008b8b',
332
- darkgoldenrod: '#b8860b',
333
- darkgray: '#a9a9a9',
334
- darkgreen: '#006400',
335
- darkgrey: '#a9a9a9',
336
- darkkhaki: '#bdb76b',
337
- darkmagenta: '#8b008b',
338
- darkolivegreen: '#556b2f',
339
- darkorange: '#ff8c00',
340
- darkorchid: '#9932cc',
341
- darkred: '#8b0000',
342
- darksalmon: '#e9967a',
343
- darkseagreen: '#8fbc8f',
344
- darkslateblue: '#483d8b',
345
- darkslategray: '#2f4f4f',
346
- darkslategrey: '#2f4f4f',
347
- darkturquoise: '#00ced1',
348
- darkviolet: '#9400d3',
349
- deeppink: '#ff1493',
350
- deepskyblue: '#00bfff',
351
- dimgray: '#696969',
352
- dimgrey: '#696969',
353
- dodgerblue: '#1e90ff',
354
- firebrick: '#b22222',
355
- floralwhite: '#fffaf0',
356
- forestgreen: '#228b22',
357
- fuchsia: '#ff00ff',
358
- gainsboro: '#dcdcdc',
359
- ghostwhite: '#f8f8ff',
360
- goldenrod: '#daa520',
361
- gold: '#ffd700',
362
- gray: '#808080',
363
- green: '#008000',
364
- greenyellow: '#adff2f',
365
- grey: '#808080',
366
- honeydew: '#f0fff0',
367
- hotpink: '#ff69b4',
368
- indianred: '#cd5c5c',
369
- indigo: '#4b0082',
370
- ivory: '#fffff0',
371
- khaki: '#f0e68c',
372
- lavenderblush: '#fff0f5',
373
- lavender: '#e6e6fa',
374
- lawngreen: '#7cfc00',
375
- lemonchiffon: '#fffacd',
376
- lightblue: '#add8e6',
377
- lightcoral: '#f08080',
378
- lightcyan: '#e0ffff',
379
- lightgoldenrodyellow: '#fafad2',
380
- lightgray: '#d3d3d3',
381
- lightgreen: '#90ee90',
382
- lightgrey: '#d3d3d3',
383
- lightpink: '#ffb6c1',
384
- lightsalmon: '#ffa07a',
385
- lightseagreen: '#20b2aa',
386
- lightskyblue: '#87cefa',
387
- lightslategray: '#778899',
388
- lightslategrey: '#778899',
389
- lightsteelblue: '#b0c4de',
390
- lightyellow: '#ffffe0',
391
- lime: '#00ff00',
392
- limegreen: '#32cd32',
393
- linen: '#faf0e6',
394
- magenta: '#ff00ff',
395
- maroon: '#800000',
396
- mediumaquamarine: '#66cdaa',
397
- mediumblue: '#0000cd',
398
- mediumorchid: '#ba55d3',
399
- mediumpurple: '#9370db',
400
- mediumseagreen: '#3cb371',
401
- mediumslateblue: '#7b68ee',
402
- mediumspringgreen: '#00fa9a',
403
- mediumturquoise: '#48d1cc',
404
- mediumvioletred: '#c71585',
405
- midnightblue: '#191970',
406
- mintcream: '#f5fffa',
407
- mistyrose: '#ffe4e1',
408
- moccasin: '#ffe4b5',
409
- navajowhite: '#ffdead',
410
- navy: '#000080',
411
- oldlace: '#fdf5e6',
412
- olive: '#808000',
413
- olivedrab: '#6b8e23',
414
- orange: '#ffa500',
415
- orangered: '#ff4500',
416
- orchid: '#da70d6',
417
- palegoldenrod: '#eee8aa',
418
- palegreen: '#98fb98',
419
- paleturquoise: '#afeeee',
420
- palevioletred: '#db7093',
421
- papayawhip: '#ffefd5',
422
- peachpuff: '#ffdab9',
423
- peru: '#cd853f',
424
- pink: '#ffc0cb',
425
- plum: '#dda0dd',
426
- powderblue: '#b0e0e6',
427
- purple: '#800080',
428
- rebeccapurple: '#663399',
429
- red: '#ff0000',
430
- rosybrown: '#bc8f8f',
431
- royalblue: '#4169e1',
432
- saddlebrown: '#8b4513',
433
- salmon: '#fa8072',
434
- sandybrown: '#f4a460',
435
- seagreen: '#2e8b57',
436
- seashell: '#fff5ee',
437
- sienna: '#a0522d',
438
- silver: '#c0c0c0',
439
- skyblue: '#87ceeb',
440
- slateblue: '#6a5acd',
441
- slategray: '#708090',
442
- slategrey: '#708090',
443
- snow: '#fffafa',
444
- springgreen: '#00ff7f',
445
- steelblue: '#4682b4',
446
- tan: '#d2b48c',
447
- teal: '#008080',
448
- thistle: '#d8bfd8',
449
- tomato: '#ff6347',
450
- turquoise: '#40e0d0',
451
- violet: '#ee82ee',
452
- wheat: '#f5deb3',
453
- white: '#ffffff',
454
- whitesmoke: '#f5f5f5',
455
- yellow: '#ffff00',
456
- yellowgreen: '#9acd32',
457
- };
458
-
459
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
460
- /**
461
- * Given a string or object, convert that input to RGB
462
- *
463
- * Possible string inputs:
464
- * ```
465
- * "red"
466
- * "#f00" or "f00"
467
- * "#ff0000" or "ff0000"
468
- * "#ff000000" or "ff000000"
469
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
470
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
471
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
472
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
473
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
474
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
475
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
476
- * ```
477
- */
478
- function inputToRGB(color) {
479
- var rgb = { r: 0, g: 0, b: 0 };
480
- var a = 1;
481
- var s = null;
482
- var v = null;
483
- var l = null;
484
- var ok = false;
485
- var format = false;
486
- if (typeof color === 'string') {
487
- color = stringInputToObject(color);
488
- }
489
- if (typeof color === 'object') {
490
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
491
- rgb = rgbToRgb(color.r, color.g, color.b);
492
- ok = true;
493
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
494
- }
495
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
496
- s = convertToPercentage(color.s);
497
- v = convertToPercentage(color.v);
498
- rgb = hsvToRgb(color.h, s, v);
499
- ok = true;
500
- format = 'hsv';
501
- }
502
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
503
- s = convertToPercentage(color.s);
504
- l = convertToPercentage(color.l);
505
- rgb = hslToRgb(color.h, s, l);
506
- ok = true;
507
- format = 'hsl';
508
- }
509
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
510
- a = color.a;
511
- }
512
- }
513
- a = boundAlpha(a);
514
- return {
515
- ok: ok,
516
- format: color.format || format,
517
- r: Math.min(255, Math.max(rgb.r, 0)),
518
- g: Math.min(255, Math.max(rgb.g, 0)),
519
- b: Math.min(255, Math.max(rgb.b, 0)),
520
- a: a,
521
- };
522
- }
523
- // <http://www.w3.org/TR/css3-values/#integers>
524
- var CSS_INTEGER = '[-\\+]?\\d+%?';
525
- // <http://www.w3.org/TR/css3-values/#number-value>
526
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
527
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
528
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
529
- // Actual matching.
530
- // Parentheses and commas are optional, but not required.
531
- // Whitespace can take the place of commas or opening paren
532
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
533
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
534
- var matchers = {
535
- CSS_UNIT: new RegExp(CSS_UNIT),
536
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
537
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
538
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
539
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
540
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
541
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
542
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
543
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
544
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
545
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
546
- };
547
- /**
548
- * Permissive string parsing. Take in a number of formats, and output an object
549
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
550
- */
551
- function stringInputToObject(color) {
552
- color = color.trim().toLowerCase();
553
- if (color.length === 0) {
554
- return false;
555
- }
556
- var named = false;
557
- if (names[color]) {
558
- color = names[color];
559
- named = true;
560
- }
561
- else if (color === 'transparent') {
562
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
563
- }
564
- // Try to match string input using regular expressions.
565
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
566
- // Just return an object and let the conversion functions handle that.
567
- // This way the result will be the same whether the tinycolor is initialized with string or object.
568
- var match = matchers.rgb.exec(color);
569
- if (match) {
570
- return { r: match[1], g: match[2], b: match[3] };
571
- }
572
- match = matchers.rgba.exec(color);
573
- if (match) {
574
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
575
- }
576
- match = matchers.hsl.exec(color);
577
- if (match) {
578
- return { h: match[1], s: match[2], l: match[3] };
579
- }
580
- match = matchers.hsla.exec(color);
581
- if (match) {
582
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
583
- }
584
- match = matchers.hsv.exec(color);
585
- if (match) {
586
- return { h: match[1], s: match[2], v: match[3] };
587
- }
588
- match = matchers.hsva.exec(color);
589
- if (match) {
590
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
591
- }
592
- match = matchers.hex8.exec(color);
593
- if (match) {
594
- return {
595
- r: parseIntFromHex(match[1]),
596
- g: parseIntFromHex(match[2]),
597
- b: parseIntFromHex(match[3]),
598
- a: convertHexToDecimal(match[4]),
599
- format: named ? 'name' : 'hex8',
600
- };
601
- }
602
- match = matchers.hex6.exec(color);
603
- if (match) {
604
- return {
605
- r: parseIntFromHex(match[1]),
606
- g: parseIntFromHex(match[2]),
607
- b: parseIntFromHex(match[3]),
608
- format: named ? 'name' : 'hex',
609
- };
610
- }
611
- match = matchers.hex4.exec(color);
612
- if (match) {
613
- return {
614
- r: parseIntFromHex(match[1] + match[1]),
615
- g: parseIntFromHex(match[2] + match[2]),
616
- b: parseIntFromHex(match[3] + match[3]),
617
- a: convertHexToDecimal(match[4] + match[4]),
618
- format: named ? 'name' : 'hex8',
619
- };
620
- }
621
- match = matchers.hex3.exec(color);
622
- if (match) {
623
- return {
624
- r: parseIntFromHex(match[1] + match[1]),
625
- g: parseIntFromHex(match[2] + match[2]),
626
- b: parseIntFromHex(match[3] + match[3]),
627
- format: named ? 'name' : 'hex',
628
- };
629
- }
630
- return false;
631
- }
632
- /**
633
- * Check to see if it looks like a CSS unit
634
- * (see `matchers` above for definition).
635
- */
636
- function isValidCSSUnit(color) {
637
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
638
- }
639
-
640
- var TinyColor = /** @class */ (function () {
641
- function TinyColor(color, opts) {
642
- if (color === void 0) { color = ''; }
643
- if (opts === void 0) { opts = {}; }
644
- var _a;
645
- // If input is already a tinycolor, return itself
646
- if (color instanceof TinyColor) {
647
- // eslint-disable-next-line no-constructor-return
648
- return color;
649
- }
650
- if (typeof color === 'number') {
651
- color = numberInputToObject(color);
652
- }
653
- this.originalInput = color;
654
- var rgb = inputToRGB(color);
655
- this.originalInput = color;
656
- this.r = rgb.r;
657
- this.g = rgb.g;
658
- this.b = rgb.b;
659
- this.a = rgb.a;
660
- this.roundA = Math.round(100 * this.a) / 100;
661
- this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
662
- this.gradientType = opts.gradientType;
663
- // Don't let the range of [0,255] come back in [0,1].
664
- // Potentially lose a little bit of precision here, but will fix issues where
665
- // .5 gets interpreted as half of the total, instead of half of 1
666
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
667
- if (this.r < 1) {
668
- this.r = Math.round(this.r);
669
- }
670
- if (this.g < 1) {
671
- this.g = Math.round(this.g);
672
- }
673
- if (this.b < 1) {
674
- this.b = Math.round(this.b);
675
- }
676
- this.isValid = rgb.ok;
677
- }
678
- TinyColor.prototype.isDark = function () {
679
- return this.getBrightness() < 128;
680
- };
681
- TinyColor.prototype.isLight = function () {
682
- return !this.isDark();
683
- };
684
- /**
685
- * Returns the perceived brightness of the color, from 0-255.
686
- */
687
- TinyColor.prototype.getBrightness = function () {
688
- // http://www.w3.org/TR/AERT#color-contrast
689
- var rgb = this.toRgb();
690
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
691
- };
692
- /**
693
- * Returns the perceived luminance of a color, from 0-1.
694
- */
695
- TinyColor.prototype.getLuminance = function () {
696
- // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
697
- var rgb = this.toRgb();
698
- var R;
699
- var G;
700
- var B;
701
- var RsRGB = rgb.r / 255;
702
- var GsRGB = rgb.g / 255;
703
- var BsRGB = rgb.b / 255;
704
- if (RsRGB <= 0.03928) {
705
- R = RsRGB / 12.92;
706
- }
707
- else {
708
- // eslint-disable-next-line prefer-exponentiation-operator
709
- R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
710
- }
711
- if (GsRGB <= 0.03928) {
712
- G = GsRGB / 12.92;
713
- }
714
- else {
715
- // eslint-disable-next-line prefer-exponentiation-operator
716
- G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
717
- }
718
- if (BsRGB <= 0.03928) {
719
- B = BsRGB / 12.92;
720
- }
721
- else {
722
- // eslint-disable-next-line prefer-exponentiation-operator
723
- B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
724
- }
725
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
726
- };
727
- /**
728
- * Returns the alpha value of a color, from 0-1.
729
- */
730
- TinyColor.prototype.getAlpha = function () {
731
- return this.a;
732
- };
733
- /**
734
- * Sets the alpha value on the current color.
735
- *
736
- * @param alpha - The new alpha value. The accepted range is 0-1.
737
- */
738
- TinyColor.prototype.setAlpha = function (alpha) {
739
- this.a = boundAlpha(alpha);
740
- this.roundA = Math.round(100 * this.a) / 100;
741
- return this;
742
- };
743
- /**
744
- * Returns whether the color is monochrome.
745
- */
746
- TinyColor.prototype.isMonochrome = function () {
747
- var s = this.toHsl().s;
748
- return s === 0;
749
- };
750
- /**
751
- * Returns the object as a HSVA object.
752
- */
753
- TinyColor.prototype.toHsv = function () {
754
- var hsv = rgbToHsv(this.r, this.g, this.b);
755
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
756
- };
757
- /**
758
- * Returns the hsva values interpolated into a string with the following format:
759
- * "hsva(xxx, xxx, xxx, xx)".
760
- */
761
- TinyColor.prototype.toHsvString = function () {
762
- var hsv = rgbToHsv(this.r, this.g, this.b);
763
- var h = Math.round(hsv.h * 360);
764
- var s = Math.round(hsv.s * 100);
765
- var v = Math.round(hsv.v * 100);
766
- return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
767
- };
768
- /**
769
- * Returns the object as a HSLA object.
770
- */
771
- TinyColor.prototype.toHsl = function () {
772
- var hsl = rgbToHsl(this.r, this.g, this.b);
773
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
774
- };
775
- /**
776
- * Returns the hsla values interpolated into a string with the following format:
777
- * "hsla(xxx, xxx, xxx, xx)".
778
- */
779
- TinyColor.prototype.toHslString = function () {
780
- var hsl = rgbToHsl(this.r, this.g, this.b);
781
- var h = Math.round(hsl.h * 360);
782
- var s = Math.round(hsl.s * 100);
783
- var l = Math.round(hsl.l * 100);
784
- return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
785
- };
786
- /**
787
- * Returns the hex value of the color.
788
- * @param allow3Char will shorten hex value to 3 char if possible
789
- */
790
- TinyColor.prototype.toHex = function (allow3Char) {
791
- if (allow3Char === void 0) { allow3Char = false; }
792
- return rgbToHex(this.r, this.g, this.b, allow3Char);
793
- };
794
- /**
795
- * Returns the hex value of the color -with a # prefixed.
796
- * @param allow3Char will shorten hex value to 3 char if possible
797
- */
798
- TinyColor.prototype.toHexString = function (allow3Char) {
799
- if (allow3Char === void 0) { allow3Char = false; }
800
- return '#' + this.toHex(allow3Char);
801
- };
802
- /**
803
- * Returns the hex 8 value of the color.
804
- * @param allow4Char will shorten hex value to 4 char if possible
805
- */
806
- TinyColor.prototype.toHex8 = function (allow4Char) {
807
- if (allow4Char === void 0) { allow4Char = false; }
808
- return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
809
- };
810
- /**
811
- * Returns the hex 8 value of the color -with a # prefixed.
812
- * @param allow4Char will shorten hex value to 4 char if possible
813
- */
814
- TinyColor.prototype.toHex8String = function (allow4Char) {
815
- if (allow4Char === void 0) { allow4Char = false; }
816
- return '#' + this.toHex8(allow4Char);
817
- };
818
- /**
819
- * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
820
- * @param allowShortChar will shorten hex value to 3 or 4 char if possible
821
- */
822
- TinyColor.prototype.toHexShortString = function (allowShortChar) {
823
- if (allowShortChar === void 0) { allowShortChar = false; }
824
- return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
825
- };
826
- /**
827
- * Returns the object as a RGBA object.
828
- */
829
- TinyColor.prototype.toRgb = function () {
830
- return {
831
- r: Math.round(this.r),
832
- g: Math.round(this.g),
833
- b: Math.round(this.b),
834
- a: this.a,
835
- };
836
- };
837
- /**
838
- * Returns the RGBA values interpolated into a string with the following format:
839
- * "RGBA(xxx, xxx, xxx, xx)".
840
- */
841
- TinyColor.prototype.toRgbString = function () {
842
- var r = Math.round(this.r);
843
- var g = Math.round(this.g);
844
- var b = Math.round(this.b);
845
- return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
846
- };
847
- /**
848
- * Returns the object as a RGBA object.
849
- */
850
- TinyColor.prototype.toPercentageRgb = function () {
851
- var fmt = function (x) { return "".concat(Math.round(bound01(x, 255) * 100), "%"); };
852
- return {
853
- r: fmt(this.r),
854
- g: fmt(this.g),
855
- b: fmt(this.b),
856
- a: this.a,
857
- };
858
- };
859
- /**
860
- * Returns the RGBA relative values interpolated into a string
861
- */
862
- TinyColor.prototype.toPercentageRgbString = function () {
863
- var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };
864
- return this.a === 1
865
- ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)")
866
- : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
867
- };
868
- /**
869
- * The 'real' name of the color -if there is one.
870
- */
871
- TinyColor.prototype.toName = function () {
872
- if (this.a === 0) {
873
- return 'transparent';
874
- }
875
- if (this.a < 1) {
876
- return false;
877
- }
878
- var hex = '#' + rgbToHex(this.r, this.g, this.b, false);
879
- for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
880
- var _b = _a[_i], key = _b[0], value = _b[1];
881
- if (hex === value) {
882
- return key;
883
- }
884
- }
885
- return false;
886
- };
887
- TinyColor.prototype.toString = function (format) {
888
- var formatSet = Boolean(format);
889
- format = format !== null && format !== void 0 ? format : this.format;
890
- var formattedString = false;
891
- var hasAlpha = this.a < 1 && this.a >= 0;
892
- var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');
893
- if (needsAlphaFormat) {
894
- // Special case for "transparent", all other non-alpha formats
895
- // will return rgba when there is transparency.
896
- if (format === 'name' && this.a === 0) {
897
- return this.toName();
898
- }
899
- return this.toRgbString();
900
- }
901
- if (format === 'rgb') {
902
- formattedString = this.toRgbString();
903
- }
904
- if (format === 'prgb') {
905
- formattedString = this.toPercentageRgbString();
906
- }
907
- if (format === 'hex' || format === 'hex6') {
908
- formattedString = this.toHexString();
909
- }
910
- if (format === 'hex3') {
911
- formattedString = this.toHexString(true);
912
- }
913
- if (format === 'hex4') {
914
- formattedString = this.toHex8String(true);
915
- }
916
- if (format === 'hex8') {
917
- formattedString = this.toHex8String();
918
- }
919
- if (format === 'name') {
920
- formattedString = this.toName();
921
- }
922
- if (format === 'hsl') {
923
- formattedString = this.toHslString();
924
- }
925
- if (format === 'hsv') {
926
- formattedString = this.toHsvString();
927
- }
928
- return formattedString || this.toHexString();
929
- };
930
- TinyColor.prototype.toNumber = function () {
931
- return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
932
- };
933
- TinyColor.prototype.clone = function () {
934
- return new TinyColor(this.toString());
935
- };
936
- /**
937
- * Lighten the color a given amount. Providing 100 will always return white.
938
- * @param amount - valid between 1-100
939
- */
940
- TinyColor.prototype.lighten = function (amount) {
941
- if (amount === void 0) { amount = 10; }
942
- var hsl = this.toHsl();
943
- hsl.l += amount / 100;
944
- hsl.l = clamp01(hsl.l);
945
- return new TinyColor(hsl);
946
- };
947
- /**
948
- * Brighten the color a given amount, from 0 to 100.
949
- * @param amount - valid between 1-100
950
- */
951
- TinyColor.prototype.brighten = function (amount) {
952
- if (amount === void 0) { amount = 10; }
953
- var rgb = this.toRgb();
954
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
955
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
956
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
957
- return new TinyColor(rgb);
958
- };
959
- /**
960
- * Darken the color a given amount, from 0 to 100.
961
- * Providing 100 will always return black.
962
- * @param amount - valid between 1-100
963
- */
964
- TinyColor.prototype.darken = function (amount) {
965
- if (amount === void 0) { amount = 10; }
966
- var hsl = this.toHsl();
967
- hsl.l -= amount / 100;
968
- hsl.l = clamp01(hsl.l);
969
- return new TinyColor(hsl);
970
- };
971
- /**
972
- * Mix the color with pure white, from 0 to 100.
973
- * Providing 0 will do nothing, providing 100 will always return white.
974
- * @param amount - valid between 1-100
975
- */
976
- TinyColor.prototype.tint = function (amount) {
977
- if (amount === void 0) { amount = 10; }
978
- return this.mix('white', amount);
979
- };
980
- /**
981
- * Mix the color with pure black, from 0 to 100.
982
- * Providing 0 will do nothing, providing 100 will always return black.
983
- * @param amount - valid between 1-100
984
- */
985
- TinyColor.prototype.shade = function (amount) {
986
- if (amount === void 0) { amount = 10; }
987
- return this.mix('black', amount);
988
- };
989
- /**
990
- * Desaturate the color a given amount, from 0 to 100.
991
- * Providing 100 will is the same as calling greyscale
992
- * @param amount - valid between 1-100
993
- */
994
- TinyColor.prototype.desaturate = function (amount) {
995
- if (amount === void 0) { amount = 10; }
996
- var hsl = this.toHsl();
997
- hsl.s -= amount / 100;
998
- hsl.s = clamp01(hsl.s);
999
- return new TinyColor(hsl);
1000
- };
1001
- /**
1002
- * Saturate the color a given amount, from 0 to 100.
1003
- * @param amount - valid between 1-100
1004
- */
1005
- TinyColor.prototype.saturate = function (amount) {
1006
- if (amount === void 0) { amount = 10; }
1007
- var hsl = this.toHsl();
1008
- hsl.s += amount / 100;
1009
- hsl.s = clamp01(hsl.s);
1010
- return new TinyColor(hsl);
1011
- };
1012
- /**
1013
- * Completely desaturates a color into greyscale.
1014
- * Same as calling `desaturate(100)`
1015
- */
1016
- TinyColor.prototype.greyscale = function () {
1017
- return this.desaturate(100);
1018
- };
1019
- /**
1020
- * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
1021
- * Values outside of this range will be wrapped into this range.
1022
- */
1023
- TinyColor.prototype.spin = function (amount) {
1024
- var hsl = this.toHsl();
1025
- var hue = (hsl.h + amount) % 360;
1026
- hsl.h = hue < 0 ? 360 + hue : hue;
1027
- return new TinyColor(hsl);
1028
- };
1029
- /**
1030
- * Mix the current color a given amount with another color, from 0 to 100.
1031
- * 0 means no mixing (return current color).
1032
- */
1033
- TinyColor.prototype.mix = function (color, amount) {
1034
- if (amount === void 0) { amount = 50; }
1035
- var rgb1 = this.toRgb();
1036
- var rgb2 = new TinyColor(color).toRgb();
1037
- var p = amount / 100;
1038
- var rgba = {
1039
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
1040
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
1041
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
1042
- a: (rgb2.a - rgb1.a) * p + rgb1.a,
1043
- };
1044
- return new TinyColor(rgba);
1045
- };
1046
- TinyColor.prototype.analogous = function (results, slices) {
1047
- if (results === void 0) { results = 6; }
1048
- if (slices === void 0) { slices = 30; }
1049
- var hsl = this.toHsl();
1050
- var part = 360 / slices;
1051
- var ret = [this];
1052
- for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {
1053
- hsl.h = (hsl.h + part) % 360;
1054
- ret.push(new TinyColor(hsl));
1055
- }
1056
- return ret;
1057
- };
1058
- /**
1059
- * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
1060
- */
1061
- TinyColor.prototype.complement = function () {
1062
- var hsl = this.toHsl();
1063
- hsl.h = (hsl.h + 180) % 360;
1064
- return new TinyColor(hsl);
1065
- };
1066
- TinyColor.prototype.monochromatic = function (results) {
1067
- if (results === void 0) { results = 6; }
1068
- var hsv = this.toHsv();
1069
- var h = hsv.h;
1070
- var s = hsv.s;
1071
- var v = hsv.v;
1072
- var res = [];
1073
- var modification = 1 / results;
1074
- while (results--) {
1075
- res.push(new TinyColor({ h: h, s: s, v: v }));
1076
- v = (v + modification) % 1;
1077
- }
1078
- return res;
1079
- };
1080
- TinyColor.prototype.splitcomplement = function () {
1081
- var hsl = this.toHsl();
1082
- var h = hsl.h;
1083
- return [
1084
- this,
1085
- new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
1086
- new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),
1087
- ];
1088
- };
1089
- /**
1090
- * Compute how the color would appear on a background
1091
- */
1092
- TinyColor.prototype.onBackground = function (background) {
1093
- var fg = this.toRgb();
1094
- var bg = new TinyColor(background).toRgb();
1095
- var alpha = fg.a + bg.a * (1 - fg.a);
1096
- return new TinyColor({
1097
- r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
1098
- g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
1099
- b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
1100
- a: alpha,
1101
- });
1102
- };
1103
- /**
1104
- * Alias for `polyad(3)`
1105
- */
1106
- TinyColor.prototype.triad = function () {
1107
- return this.polyad(3);
1108
- };
1109
- /**
1110
- * Alias for `polyad(4)`
1111
- */
1112
- TinyColor.prototype.tetrad = function () {
1113
- return this.polyad(4);
1114
- };
1115
- /**
1116
- * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
1117
- * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
1118
- */
1119
- TinyColor.prototype.polyad = function (n) {
1120
- var hsl = this.toHsl();
1121
- var h = hsl.h;
1122
- var result = [this];
1123
- var increment = 360 / n;
1124
- for (var i = 1; i < n; i++) {
1125
- result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
1126
- }
1127
- return result;
1128
- };
1129
- /**
1130
- * compare color vs current color
1131
- */
1132
- TinyColor.prototype.equals = function (color) {
1133
- return this.toRgbString() === new TinyColor(color).toRgbString();
1134
- };
1135
- return TinyColor;
1136
- }());
1137
-
1138
- exports.TinyColor = TinyColor;