inl-ui 0.0.37 → 0.0.39

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 (852) hide show
  1. package/.babelrc +3 -3
  2. package/README.md +27 -27
  3. package/conf/cp1.js +85 -85
  4. package/conf/rollup.config.ts +37 -37
  5. package/dist/index.js +1803 -2849
  6. package/dist/index.js.map +1 -1
  7. package/dist/src/api/alarm/alarmRecord.d.ts +95 -95
  8. package/dist/src/api/alarm/warningConfigure.d.ts +61 -61
  9. package/dist/src/api/auth/menuManager.d.ts +36 -36
  10. package/dist/src/api/auth/roleManager.d.ts +31 -31
  11. package/dist/src/api/auth/userManager.d.ts +48 -48
  12. package/dist/src/api/axios.d.ts +10 -10
  13. package/dist/src/api/boardScreen/powersupply.d.ts +8 -8
  14. package/dist/src/api/cardCenter.d.ts +43 -43
  15. package/dist/src/api/dataAnalysis.d.ts +4 -4
  16. package/dist/src/api/dataCenter.d.ts +32 -32
  17. package/dist/src/api/enumList.d.ts +7 -7
  18. package/dist/src/api/event.d.ts +4 -4
  19. package/dist/src/api/faceName.d.ts +7 -7
  20. package/dist/src/api/factory.d.ts +36 -36
  21. package/dist/src/api/fileManager.d.ts +4 -4
  22. package/dist/src/api/index.d.ts +2 -2
  23. package/dist/src/api/linkage.d.ts +30 -30
  24. package/dist/src/api/logManager.d.ts +15 -15
  25. package/dist/src/api/noticeCenter.d.ts +27 -27
  26. package/dist/src/api/noticeManager.d.ts +39 -39
  27. package/dist/src/api/org/depManager.d.ts +93 -93
  28. package/dist/src/api/org/postManager.d.ts +43 -43
  29. package/dist/src/api/org/teamManager.d.ts +51 -51
  30. package/dist/src/api/param.d.ts +36 -36
  31. package/dist/src/api/personalSetting.d.ts +20 -20
  32. package/dist/src/api/pressureFiltration/filterPressConfiguration.d.ts +23 -23
  33. package/dist/src/api/pressureFiltration/flowChart.d.ts +11 -11
  34. package/dist/src/api/pressureFiltration/pressureFiltrationHome.d.ts +31 -31
  35. package/dist/src/api/pressureFiltration/pressureFiltrationRecord.d.ts +23 -23
  36. package/dist/src/api/processDrawing.d.ts +35 -35
  37. package/dist/src/api/product.d.ts +29 -29
  38. package/dist/src/api/productionPlan.d.ts +4 -4
  39. package/dist/src/api/productionPlan_old.d.ts +4 -4
  40. package/dist/src/api/project.d.ts +21 -21
  41. package/dist/src/api/pss.d.ts +4 -4
  42. package/dist/src/api/rotation.d.ts +4 -4
  43. package/dist/src/api/setting.d.ts +4 -4
  44. package/dist/src/api/systemSetting.d.ts +24 -24
  45. package/dist/src/api/thingInstance.d.ts +42 -42
  46. package/dist/src/api/thingModel.d.ts +38 -38
  47. package/dist/src/api/tupu.d.ts +6 -6
  48. package/dist/src/api/video.d.ts +4 -4
  49. package/dist/src/api/workforceManager.d.ts +4 -4
  50. package/dist/src/components/changeTheme/index.d.ts +4 -4
  51. package/dist/src/components/headerMenu/index.d.ts +2 -2
  52. package/dist/src/components/headerMenuItem/index.d.ts +2 -2
  53. package/dist/src/components/headerMenuTitle/index.d.ts +2 -2
  54. package/dist/src/components/index.d.ts +2 -2
  55. package/dist/src/components/inputText.d.ts +22 -22
  56. package/dist/src/components/layoutContent/index.d.ts +10 -10
  57. package/dist/src/components/layoutNav/index.d.ts +2 -2
  58. package/dist/src/components/layoutSidebar/index.d.ts +2 -2
  59. package/dist/src/components/videoPlayer/index.d.ts +2 -2
  60. package/dist/src/components/videoPlayer/util/interface.d.ts +3 -3
  61. package/dist/src/components/videoPlayer/util/video.d.ts +64 -64
  62. package/dist/src/directives/focus.d.ts +6 -6
  63. package/dist/src/hooks/global.d.ts +5 -5
  64. package/dist/src/hooks/useMenuCode.d.ts +4 -4
  65. package/dist/src/hooks/userVModel.d.ts +1 -1
  66. package/dist/src/index.d.ts +27 -27
  67. package/dist/src/pageComponent/components/CommonTree.d.ts +73 -73
  68. package/dist/src/pageComponent/components/DynamicIcon.d.ts +14 -14
  69. package/dist/src/pageComponent/components/EditPasswordForm.d.ts +20 -20
  70. package/dist/src/pageComponent/components/IconSelect.d.ts +12 -12
  71. package/dist/src/pageComponent/components/Navbar.d.ts +14 -14
  72. package/dist/src/pageComponent/components/ProFormItem.d.ts +21 -21
  73. package/dist/src/pageComponent/components/SearchSelect.d.ts +62 -62
  74. package/dist/src/pageComponent/components/Sidebar.d.ts +23 -23
  75. package/dist/src/pageComponent/components/boardScreen/Card1Outer.d.ts +8 -8
  76. package/dist/src/pageComponent/components/boardScreen/Card2Outer.d.ts +8 -8
  77. package/dist/src/pageComponent/components/boardScreen/PopBox.d.ts +33 -33
  78. package/dist/src/pageComponent/components/boardScreen/PowerCut.d.ts +15 -15
  79. package/dist/src/pageComponent/components/boardScreen/PowerSupply.d.ts +15 -15
  80. package/dist/src/pageComponent/components/boardScreen/card2OuterTable.d.ts +6 -6
  81. package/dist/src/pageComponent/components/check-people.d.ts +31 -31
  82. package/dist/src/pageComponent/components/elcRoomHt/index.d.ts +8 -8
  83. package/dist/src/pageComponent/components/htModal/control.d.ts +8 -8
  84. package/dist/src/pageComponent/components/htModal/index.d.ts +14 -14
  85. package/dist/src/pageComponent/components/htModal/task.d.ts +2 -2
  86. package/dist/src/pageComponent/components/loginBox/index.d.ts +45 -45
  87. package/dist/src/pageComponent/components/noticeManager/addChannel.d.ts +8 -8
  88. package/dist/src/pageComponent/components/noticeManager/addNotice.d.ts +8 -8
  89. package/dist/src/pageComponent/components/noticeManager/addTemplate.d.ts +19 -19
  90. package/dist/src/pageComponent/components/noticeManager/noticeGrade.d.ts +6 -6
  91. package/dist/src/pageComponent/components/noticeManager/noticeMaintain.d.ts +6 -6
  92. package/dist/src/pageComponent/components/noticeManager/noticeTemplate.d.ts +6 -6
  93. package/dist/src/pageComponent/components/noticeManager/notificationDetails.d.ts +6 -6
  94. package/dist/src/pageComponent/components/noticeManager/sendDetails.d.ts +23 -23
  95. package/dist/src/pageComponent/components/pressureFiltration/alarmList.d.ts +21 -21
  96. package/dist/src/pageComponent/components/pressureFiltration/configuration.d.ts +31 -31
  97. package/dist/src/pageComponent/components/pressureFiltration/numberOfPlates.d.ts +21 -21
  98. package/dist/src/pageComponent/components/pressureFiltration/shiftChange.d.ts +23 -23
  99. package/dist/src/pageComponent/components/pss-cabinet/cabinetRender.d.ts +61 -61
  100. package/dist/src/pageComponent/components/user/userTable.d.ts +13 -13
  101. package/dist/src/pageComponent/components/user/userTree.d.ts +21 -21
  102. package/dist/src/pageComponent/components/video-play.d.ts +34 -34
  103. package/dist/src/pageComponent/config/systemConfig.d.ts +32 -32
  104. package/dist/src/pageComponent/hooks/cardTable.d.ts +26 -26
  105. package/dist/src/pageComponent/hooks/filters.d.ts +18 -18
  106. package/dist/src/pageComponent/hooks/global.d.ts +5 -5
  107. package/dist/src/pageComponent/hooks/manage-module/useModalForm.d.ts +5 -5
  108. package/dist/src/pageComponent/hooks/manage-module/useModalTitle.d.ts +6 -6
  109. package/dist/src/pageComponent/hooks/manage-module/useModalVisibleControl.d.ts +5 -5
  110. package/dist/src/pageComponent/hooks/screen.d.ts +5 -5
  111. package/dist/src/pageComponent/hooks/tabListConfig.d.ts +2 -2
  112. package/dist/src/pageComponent/hooks/toPreviewData.d.ts +4 -4
  113. package/dist/src/pageComponent/hooks/treeSearch.d.ts +2 -2
  114. package/dist/src/pageComponent/hooks/useBus.d.ts +6 -6
  115. package/dist/src/pageComponent/hooks/useMouse.d.ts +7 -7
  116. package/dist/src/pageComponent/hooks/useProxy.d.ts +4 -4
  117. package/dist/src/pageComponent/hooks/useTableList.d.ts +26 -26
  118. package/dist/src/pageComponent/hooks/useVModel.d.ts +1 -1
  119. package/dist/src/pageComponent/hooks/useWatchOnce.d.ts +2 -2
  120. package/dist/src/pageComponent/index.d.ts +2 -2
  121. package/dist/src/pageComponent/store/index.d.ts +32 -32
  122. package/dist/src/pageComponent/utils/base64.d.ts +14 -14
  123. package/dist/src/pageComponent/utils/filter.d.ts +18 -18
  124. package/dist/src/pageComponent/utils/format.d.ts +21 -21
  125. package/dist/src/pageComponent/utils/index.d.ts +5 -5
  126. package/dist/src/pageComponent/utils/is.d.ts +10 -10
  127. package/dist/src/pageComponent/utils/transform.d.ts +10 -10
  128. package/dist/src/pageComponent/utils/tree.d.ts +17 -17
  129. package/dist/src/pageComponent/utils/upload.d.ts +1 -1
  130. package/dist/src/pageComponent/utils/validation.d.ts +20 -20
  131. package/dist/src/pageComponent/views/alarms/add-warning-configure/form/basic-form.d.ts +18 -18
  132. package/dist/src/pageComponent/views/alarms/add-warning-configure/form/linkage-form.d.ts +18 -18
  133. package/dist/src/pageComponent/views/alarms/add-warning-configure/form/rule-form.d.ts +28 -28
  134. package/dist/src/pageComponent/views/alarms/add-warning-configure/index.d.ts +16 -16
  135. package/dist/src/pageComponent/views/alarms/alarmDetail/index.d.ts +2 -2
  136. package/dist/src/pageComponent/views/alarms/index.d.ts +2 -2
  137. package/dist/src/pageComponent/views/alarms/warning-configure/batch-import-dialog.d.ts +22 -22
  138. package/dist/src/pageComponent/views/alarms/warning-configure/configure-table.d.ts +12 -12
  139. package/dist/src/pageComponent/views/alarms/warning-configure/index.d.ts +15 -15
  140. package/dist/src/pageComponent/views/alarms/warning-configure/table-tool.d.ts +26 -26
  141. package/dist/src/pageComponent/views/alarms/warning-record/index.d.ts +15 -15
  142. package/dist/src/pageComponent/views/alarms/warning-record/query-filter.d.ts +24 -24
  143. package/dist/src/pageComponent/views/alarms/warning-record/record-table.d.ts +13 -13
  144. package/dist/src/pageComponent/views/boardScreen/index.d.ts +2 -2
  145. package/dist/src/pageComponent/views/boardScreen/room.d.ts +21 -21
  146. package/dist/src/pageComponent/views/boardScreen/tupu.d.ts +17 -17
  147. package/dist/src/pageComponent/views/card-center/cardWarehouse.d.ts +23 -23
  148. package/dist/src/pageComponent/views/card-center/components/cardDetail.d.ts +49 -49
  149. package/dist/src/pageComponent/views/card-center/components/editPage.d.ts +20 -20
  150. package/dist/src/pageComponent/views/card-center/components/pageDetail.d.ts +49 -49
  151. package/dist/src/pageComponent/views/card-center/components/selectCard.d.ts +3 -3
  152. package/dist/src/pageComponent/views/card-center/pageConfiguration.d.ts +25 -25
  153. package/dist/src/pageComponent/views/data-center/cardModal.d.ts +22 -22
  154. package/dist/src/pageComponent/views/data-center/cardSubscription.d.ts +14 -14
  155. package/dist/src/pageComponent/views/data-center/components/chart.d.ts +4 -4
  156. package/dist/src/pageComponent/views/data-center/components/groupModal.d.ts +53 -53
  157. package/dist/src/pageComponent/views/data-center/components/leftTree.d.ts +27 -27
  158. package/dist/src/pageComponent/views/data-center/components/searchHeader.d.ts +11 -11
  159. package/dist/src/pageComponent/views/data-center/components/table.d.ts +31 -31
  160. package/dist/src/pageComponent/views/data-center/dataAnalysis.d.ts +6 -6
  161. package/dist/src/pageComponent/views/data-center/userModal.d.ts +28 -28
  162. package/dist/src/pageComponent/views/elcRoom/index.d.ts +2 -2
  163. package/dist/src/pageComponent/views/factoryManage/index.d.ts +20 -20
  164. package/dist/src/pageComponent/views/fileManager/components/CreateFolder.d.ts +26 -26
  165. package/dist/src/pageComponent/views/fileManager/components/MoveToFolder.d.ts +37 -37
  166. package/dist/src/pageComponent/views/fileManager/components/Rename.d.ts +26 -26
  167. package/dist/src/pageComponent/views/fileManager/components/UploadFiles.d.ts +35 -35
  168. package/dist/src/pageComponent/views/fileManager/fileManager.d.ts +2 -2
  169. package/dist/src/pageComponent/views/fileManager/index.d.ts +3 -3
  170. package/dist/src/pageComponent/views/index.d.ts +2 -2
  171. package/dist/src/pageComponent/views/login/box.d.ts +72 -72
  172. package/dist/src/pageComponent/views/login/index.d.ts +2 -2
  173. package/dist/src/pageComponent/views/login/leftImg.d.ts +10 -10
  174. package/dist/src/pageComponent/views/login/top-title.d.ts +2 -2
  175. package/dist/src/pageComponent/views/pressureFiltration/feeding.d.ts +2 -2
  176. package/dist/src/pageComponent/views/pressureFiltration/pressureFiltrationHome.d.ts +2 -2
  177. package/dist/src/pageComponent/views/pressureFiltration/productionShiftReport.d.ts +2 -2
  178. package/dist/src/pageComponent/views/pressureFiltration/record.d.ts +2 -2
  179. package/dist/src/pageComponent/views/pressureFiltration/unloading.d.ts +2 -2
  180. package/dist/src/pageComponent/views/processDrawingConfiguration/components/EventForm.d.ts +20 -20
  181. package/dist/src/pageComponent/views/processDrawingConfiguration/components/addonAfter.d.ts +18 -18
  182. package/dist/src/pageComponent/views/processDrawingConfiguration/components/cardItem.d.ts +29 -29
  183. package/dist/src/pageComponent/views/processDrawingConfiguration/components/colorPicker.d.ts +16 -16
  184. package/dist/src/pageComponent/views/processDrawingConfiguration/components/flowList.d.ts +32 -32
  185. package/dist/src/pageComponent/views/processDrawingConfiguration/components/propertyForm.d.ts +30 -30
  186. package/dist/src/pageComponent/views/processDrawingConfiguration/components/propertyModal.d.ts +60 -60
  187. package/dist/src/pageComponent/views/processDrawingConfiguration/components/state.d.ts +50 -50
  188. package/dist/src/pageComponent/views/processDrawingConfiguration/components/styleForm.d.ts +26 -26
  189. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/components/data.d.ts +15 -15
  190. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/components/textarea.d.ts +10 -10
  191. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/config.d.ts +38 -38
  192. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/index.d.ts +27 -27
  193. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/instanceSelector.d.ts +27 -27
  194. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/mainContent.d.ts +25 -25
  195. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/operationArea.d.ts +7 -7
  196. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/previewModal.d.ts +25 -25
  197. package/dist/src/pageComponent/views/processDrawingConfiguration/editor/utils.d.ts +11 -11
  198. package/dist/src/pageComponent/views/processDrawingConfiguration/hooks/index.d.ts +3 -3
  199. package/dist/src/pageComponent/views/processDrawingConfiguration/hooks/useActiveWidget.d.ts +5367 -5367
  200. package/dist/src/pageComponent/views/processDrawingConfiguration/index.d.ts +14 -14
  201. package/dist/src/pageComponent/views/processDrawingConfiguration/previewModal.d.ts +2 -2
  202. package/dist/src/pageComponent/views/productManager/index.d.ts +18 -18
  203. package/dist/src/pageComponent/views/productManager/update.d.ts +20 -20
  204. package/dist/src/pageComponent/views/productManager/utils/emuns.d.ts +31 -31
  205. package/dist/src/pageComponent/views/productManager/utils/formRules.d.ts +5 -5
  206. package/dist/src/pageComponent/views/productManager/versionEdit/index.d.ts +12 -12
  207. package/dist/src/pageComponent/views/productManager/versionEdit/param.d.ts +10 -10
  208. package/dist/src/pageComponent/views/productionPlanManager/components/Plan.d.ts +46 -46
  209. package/dist/src/pageComponent/views/productionPlanManager/components/Plan_back.d.ts +27 -27
  210. package/dist/src/pageComponent/views/productionPlanManager/dayPCPlan.d.ts +3 -3
  211. package/dist/src/pageComponent/views/productionPlanManager/daySCPlan.d.ts +3 -3
  212. package/dist/src/pageComponent/views/productionPlanManager/dayWYPlan.d.ts +2 -2
  213. package/dist/src/pageComponent/views/productionPlanManager/monthPCPlan.d.ts +3 -3
  214. package/dist/src/pageComponent/views/productionPlanManager/productionPlanConfig.d.ts +3 -3
  215. package/dist/src/pageComponent/views/productionPlanManager/productionPlan_old.d.ts +3 -3
  216. package/dist/src/pageComponent/views/productionPlanManager/yearPCPlan.d.ts +3 -3
  217. package/dist/src/pageComponent/views/projectManager/components/commonForm.d.ts +99 -99
  218. package/dist/src/pageComponent/views/projectManager/detail.d.ts +16 -16
  219. package/dist/src/pageComponent/views/projectManager/hooks/useTable.d.ts +27 -27
  220. package/dist/src/pageComponent/views/projectManager/index.d.ts +28 -28
  221. package/dist/src/pageComponent/views/projectManager/utils/emuns.d.ts +31 -31
  222. package/dist/src/pageComponent/views/projectManager/utils/formRules.d.ts +20 -20
  223. package/dist/src/pageComponent/views/projectManager/utils/index.d.ts +11 -11
  224. package/dist/src/pageComponent/views/pss/components/ApproveOpinion.d.ts +57 -57
  225. package/dist/src/pageComponent/views/pss/components/Info.d.ts +52 -52
  226. package/dist/src/pageComponent/views/pss/components/NewOrder.d.ts +17 -17
  227. package/dist/src/pageComponent/views/pss/components/PerformOperation.d.ts +27 -27
  228. package/dist/src/pageComponent/views/pss/components/table.d.ts +14 -14
  229. package/dist/src/pageComponent/views/pss/index.d.ts +3 -3
  230. package/dist/src/pageComponent/views/pss/list.d.ts +3 -3
  231. package/dist/src/pageComponent/views/pss/utils/index.d.ts +4 -4
  232. package/dist/src/pageComponent/views/pssRecord/components/Info.d.ts +25 -25
  233. package/dist/src/pageComponent/views/pssRecord/index.d.ts +3 -3
  234. package/dist/src/pageComponent/views/systemManager/about/index.d.ts +6 -6
  235. package/dist/src/pageComponent/views/systemManager/aboutNew/index.d.ts +2 -2
  236. package/dist/src/pageComponent/views/systemManager/authManager/RoleManager/index.d.ts +10 -10
  237. package/dist/src/pageComponent/views/systemManager/authManager/RoleManager/updateRoleDialog.d.ts +38 -38
  238. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/index.d.ts +14 -14
  239. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.d.ts +10 -10
  240. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/menuForm.d.ts +19 -19
  241. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.d.ts +19 -19
  242. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.d.ts +30 -30
  243. package/dist/src/pageComponent/views/systemManager/authManager/menuManager/uploadJSONDialog.d.ts +27 -27
  244. package/dist/src/pageComponent/views/systemManager/authManager/userManager/index.d.ts +13 -13
  245. package/dist/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.d.ts +41 -41
  246. package/dist/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.d.ts +24 -24
  247. package/dist/src/pageComponent/views/systemManager/logManager/index.d.ts +6 -6
  248. package/dist/src/pageComponent/views/systemManager/noticeManager/noticeCenter.d.ts +3 -3
  249. package/dist/src/pageComponent/views/systemManager/noticeManager/noticeManager.d.ts +2 -2
  250. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/batchImportModal.d.ts +20 -20
  251. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/depTree.d.ts +10 -10
  252. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.d.ts +20 -20
  253. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/index.d.ts +18 -18
  254. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.d.ts +49 -49
  255. package/dist/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.d.ts +46 -46
  256. package/dist/src/pageComponent/views/systemManager/orgManager/depManagerCorp/depTree.d.ts +10 -10
  257. package/dist/src/pageComponent/views/systemManager/orgManager/depManagerCorp/employeeTable.d.ts +20 -20
  258. package/dist/src/pageComponent/views/systemManager/orgManager/depManagerCorp/index.d.ts +18 -18
  259. package/dist/src/pageComponent/views/systemManager/orgManager/depManagerCorp/updateDepDialog.d.ts +49 -49
  260. package/dist/src/pageComponent/views/systemManager/orgManager/depManagerCorp/updateEmployeeDialog.d.ts +46 -46
  261. package/dist/src/pageComponent/views/systemManager/orgManager/empManager.d.ts +2 -2
  262. package/dist/src/pageComponent/views/systemManager/orgManager/postManager/index.d.ts +10 -10
  263. package/dist/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.d.ts +49 -49
  264. package/dist/src/pageComponent/views/systemManager/orgManager/teamManager/index.d.ts +11 -11
  265. package/dist/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.d.ts +49 -49
  266. package/dist/src/pageComponent/views/systemManager/paramManager/collapseContainer.d.ts +23 -23
  267. package/dist/src/pageComponent/views/systemManager/paramManager/dynamicForm.d.ts +20 -20
  268. package/dist/src/pageComponent/views/systemManager/paramManager/index.d.ts +7 -7
  269. package/dist/src/pageComponent/views/systemManager/paramManager/tabItem.d.ts +20 -20
  270. package/dist/src/pageComponent/views/systemManager/personalSetting/index.d.ts +7 -7
  271. package/dist/src/pageComponent/views/systemManager/systemSetting/data.d.ts +87 -87
  272. package/dist/src/pageComponent/views/systemManager/systemSetting/index.d.ts +2 -2
  273. package/dist/src/pageComponent/views/thingInstance/component/addThing.d.ts +24 -24
  274. package/dist/src/pageComponent/views/thingInstance/component/baseItem.d.ts +2 -2
  275. package/dist/src/pageComponent/views/thingInstance/component/dynamicForm.d.ts +36 -36
  276. package/dist/src/pageComponent/views/thingInstance/component/editRelation.d.ts +6 -6
  277. package/dist/src/pageComponent/views/thingInstance/component/editThing.d.ts +33 -24
  278. package/dist/src/pageComponent/views/thingInstance/component/logicForm.d.ts +54 -54
  279. package/dist/src/pageComponent/views/thingInstance/component/thingDetail.d.ts +37 -28
  280. package/dist/src/pageComponent/views/thingInstance/data.d.ts +7 -7
  281. package/dist/src/pageComponent/views/thingInstance/hooks/filters.d.ts +17 -17
  282. package/dist/src/pageComponent/views/thingInstance/hooks/useTableList.d.ts +27 -27
  283. package/dist/src/pageComponent/views/thingInstance/hooks/useTreeSearch.d.ts +20 -20
  284. package/dist/src/pageComponent/views/thingInstance/index.d.ts +3 -3
  285. package/dist/src/pageComponent/views/thingInstance/modal.d.ts +2 -2
  286. package/dist/src/pageComponent/views/thingModel/component/detail.d.ts +15 -15
  287. package/dist/src/pageComponent/views/thingModel/component/tabAttr/index.d.ts +12 -12
  288. package/dist/src/pageComponent/views/thingModel/component/tabAttr/update.d.ts +3 -3
  289. package/dist/src/pageComponent/views/thingModel/component/tabRelation/index.d.ts +12 -12
  290. package/dist/src/pageComponent/views/thingModel/component/tabRelation/update.d.ts +22 -22
  291. package/dist/src/pageComponent/views/thingModel/component/update.d.ts +6 -6
  292. package/dist/src/pageComponent/views/thingModel/config.d.ts +104 -104
  293. package/dist/src/pageComponent/views/thingModel/hooks/useTableList.d.ts +27 -27
  294. package/dist/src/pageComponent/views/thingModel/hooks/useTreeSearch.d.ts +20 -20
  295. package/dist/src/pageComponent/views/thingModel/index.d.ts +3 -3
  296. package/dist/src/pageComponent/views/video/components/checkCamera.d.ts +40 -40
  297. package/dist/src/pageComponent/views/video/components/transfer.d.ts +22 -22
  298. package/dist/src/pageComponent/views/video/components/videoPlayer/index.d.ts +14 -14
  299. package/dist/src/pageComponent/views/video/components/videoPlayer/util/axios.d.ts +4 -4
  300. package/dist/src/pageComponent/views/video/components/videoPlayer/util/byUuid.d.ts +66 -66
  301. package/dist/src/pageComponent/views/video/components/videoPlayer/util/video.d.ts +64 -64
  302. package/dist/src/pageComponent/views/video/event/algorithmType.d.ts +3 -3
  303. package/dist/src/pageComponent/views/video/event/eventConfig.d.ts +3 -3
  304. package/dist/src/pageComponent/views/video/event/eventType.d.ts +3 -3
  305. package/dist/src/pageComponent/views/video/event/events.d.ts +3 -3
  306. package/dist/src/pageComponent/views/video/linkage/linkage.d.ts +3 -3
  307. package/dist/src/pageComponent/views/video/linkage/updateMode.d.ts +43 -43
  308. package/dist/src/pageComponent/views/video/play.d.ts +3 -3
  309. package/dist/src/pageComponent/views/video/preview/components/alarmLinkageModal.d.ts +26 -26
  310. package/dist/src/pageComponent/views/video/preview/components/followItem.d.ts +17 -17
  311. package/dist/src/pageComponent/views/video/preview/components/fullScreen.d.ts +4 -4
  312. package/dist/src/pageComponent/views/video/preview/components/treeItem.d.ts +20 -20
  313. package/dist/src/pageComponent/views/video/preview/preview.d.ts +3 -3
  314. package/dist/src/pageComponent/views/video/rotation/PlayVideos.d.ts +12 -12
  315. package/dist/src/pageComponent/views/video/rotation/rotation.d.ts +3 -3
  316. package/dist/src/pageComponent/views/video/sbgl/components/CheckDialog.d.ts +3 -3
  317. package/dist/src/pageComponent/views/video/sbgl/components/addGrouping.d.ts +17 -17
  318. package/dist/src/pageComponent/views/video/sbgl/group.d.ts +3 -3
  319. package/dist/src/pageComponent/views/video/sbgl/index.d.ts +2 -2
  320. package/dist/src/pageComponent/views/video/sbgl/nvr.d.ts +3 -3
  321. package/dist/src/pageComponent/views/video/sbgl/photo.d.ts +3 -3
  322. package/dist/src/pageComponent/views/video/setting/cameraPermission.d.ts +2 -2
  323. package/dist/src/pageComponent/views/video/setting/index.d.ts +2 -2
  324. package/dist/src/pageComponent/views/video/setting/system.d.ts +3 -3
  325. package/dist/src/pageComponent/views/video/utils/index.d.ts +3 -3
  326. package/dist/src/pageComponent/views/video/utils/validation.d.ts +3 -3
  327. package/dist/src/pageComponent/views/video/utils/video.d.ts +64 -64
  328. package/dist/src/pageComponent/views/video/utils/webSocket.d.ts +5 -5
  329. package/dist/src/pageComponent/views/workforceManager/workforcePlan/dayContent.d.ts +24 -24
  330. package/dist/src/pageComponent/views/workforceManager/workforcePlan/index.d.ts +3 -3
  331. package/dist/src/pageComponent/views/workforceManager/workforcePlan/mainTable.d.ts +38 -38
  332. package/dist/src/pageComponent/views/workforceManager/workforceRule/components/classManager.d.ts +3 -3
  333. package/dist/src/pageComponent/views/workforceManager/workforceRule/components/rule.d.ts +35 -35
  334. package/dist/src/pageComponent/views/workforceManager/workforceRule/components/{workforceRule.d.ts → workforceRuleComp.d.ts} +3 -2
  335. package/dist/src/pageComponent/views/workforceManager/workforceRule/index.d.ts +3 -2
  336. package/dist/src/tpInit/index.d.ts +7 -7
  337. package/dist/src/utils/className.d.ts +2 -2
  338. package/dist/src/utils/config.d.ts +4 -4
  339. package/dist/src/utils/getSlots.d.ts +3 -3
  340. package/dist/src/utils/index.d.ts +11 -11
  341. package/dist/src/utils/installComponent.d.ts +3 -3
  342. package/dist/src/utils/publicUtil/changeTheme.d.ts +5 -5
  343. package/dist/src/utils/publicUtil/index.d.ts +34 -34
  344. package/dist/src/utils/publicUtil/login/index.d.ts +21 -21
  345. package/dist/src/utils/publicUtil/message.d.ts +2 -2
  346. package/dist/src/utils/publicUtil/systemConfig.d.ts +5 -5
  347. package/dist/src/utils/route.d.ts +31 -31
  348. package/dist/style.css +10 -9
  349. package/dist/theme/index.js +70 -70
  350. package/dist/theme/scripts/dark-vars.js +21 -21
  351. package/dist/theme/scripts/default-vars.js +25 -25
  352. package/dist/theme/scripts/light-vars.js +22 -22
  353. package/dist/theme/style/color/bezierEasing.less +110 -110
  354. package/dist/theme/style/color/colorPalette.less +81 -81
  355. package/dist/theme/style/color/colors.less +162 -162
  356. package/dist/theme/style/color/tinyColor.less +1184 -1184
  357. package/dist/theme/style/compact.less +4 -4
  358. package/dist/theme/style/dark.less +4 -4
  359. package/dist/theme/style/default.less +4 -4
  360. package/dist/theme/style/index.less +2 -2
  361. package/dist/theme/style/index.tsx +2 -2
  362. package/dist/theme/style/themes/compact.less +295 -295
  363. package/dist/theme/style/themes/dark.less +790 -790
  364. package/dist/theme/style/themes/default.less +1067 -1067
  365. package/dist/theme/style/themes/index.less +7 -7
  366. package/dist/theme/style/themes/var-dark.less +313 -313
  367. package/dist/theme/style/themes/var-default.less +148 -148
  368. package/dist/theme/style/themes/variable.less +1122 -1122
  369. package/dist/theme/style/variable.less +4 -4
  370. package/package.json +54 -54
  371. package/src/api/alarm/alarmRecord.ts +138 -138
  372. package/src/api/alarm/warningConfigure.ts +146 -146
  373. package/src/api/auth/menuManager.ts +71 -71
  374. package/src/api/auth/roleManager.ts +58 -58
  375. package/src/api/auth/userManager.ts +78 -78
  376. package/src/api/axios.ts +112 -112
  377. package/src/api/boardScreen/powersupply.ts +28 -28
  378. package/src/api/cardCenter.ts +74 -74
  379. package/src/api/dataAnalysis.ts +64 -64
  380. package/src/api/dataCenter.ts +66 -66
  381. package/src/api/enumList.ts +23 -23
  382. package/src/api/event.ts +143 -143
  383. package/src/api/faceName.ts +6 -6
  384. package/src/api/factory.ts +129 -129
  385. package/src/api/fileManager.ts +120 -120
  386. package/src/api/index.ts +1 -1
  387. package/src/api/linkage.ts +54 -54
  388. package/src/api/logManager.ts +28 -28
  389. package/src/api/noticeCenter.ts +55 -55
  390. package/src/api/noticeManager.ts +76 -76
  391. package/src/api/org/depManager.ts +167 -167
  392. package/src/api/org/postManager.ts +76 -76
  393. package/src/api/org/teamManager.ts +90 -90
  394. package/src/api/param.ts +46 -46
  395. package/src/api/personalSetting.ts +33 -33
  396. package/src/api/pressureFiltration/filterPressConfiguration.ts +36 -36
  397. package/src/api/pressureFiltration/flowChart.ts +27 -27
  398. package/src/api/pressureFiltration/pressureFiltrationHome.ts +62 -62
  399. package/src/api/pressureFiltration/pressureFiltrationRecord.ts +54 -54
  400. package/src/api/processDrawing.ts +77 -77
  401. package/src/api/product.ts +109 -109
  402. package/src/api/productionPlan.ts +230 -230
  403. package/src/api/productionPlan_old.ts +134 -134
  404. package/src/api/project.ts +87 -87
  405. package/src/api/pss.ts +144 -144
  406. package/src/api/rotation.ts +47 -47
  407. package/src/api/setting.ts +40 -40
  408. package/src/api/systemSetting.ts +91 -91
  409. package/src/api/thingInstance.ts +132 -132
  410. package/src/api/thingModel.ts +135 -135
  411. package/src/api/tupu.ts +23 -23
  412. package/src/api/video.ts +168 -168
  413. package/src/api/workforceManager.ts +163 -163
  414. package/src/components/changeTheme/README.md +20 -20
  415. package/src/components/changeTheme/index.less +25 -25
  416. package/src/components/changeTheme/index.tsx +57 -57
  417. package/src/components/headerMenu/README.md +67 -67
  418. package/src/components/headerMenu/index.tsx +130 -130
  419. package/src/components/headerMenuItem/index.tsx +50 -50
  420. package/src/components/headerMenuTitle/index.tsx +32 -32
  421. package/src/components/index.ts +21 -21
  422. package/src/components/inputText.tsx +49 -49
  423. package/src/components/layoutContent/README.md +36 -36
  424. package/src/components/layoutContent/index.tsx +271 -271
  425. package/src/components/layoutContent/style.less +82 -80
  426. package/src/components/layoutNav/README.md +35 -35
  427. package/src/components/layoutNav/index.tsx +129 -129
  428. package/src/components/layoutNav/style.less +27 -27
  429. package/src/components/layoutSidebar/README.md +23 -23
  430. package/src/components/layoutSidebar/index.tsx +181 -181
  431. package/src/components/layoutSidebar/style.less +31 -31
  432. package/src/components/styles/index.less +119 -119
  433. package/src/components/videoPlayer/README.md +35 -35
  434. package/src/components/videoPlayer/index.tsx +128 -128
  435. package/src/components/videoPlayer/util/ZLMRTCClient.js +6839 -6839
  436. package/src/components/videoPlayer/util/interface.ts +3 -3
  437. package/src/components/videoPlayer/util/video.ts +250 -250
  438. package/src/directives/focus.ts +14 -14
  439. package/src/hooks/global.ts +11 -11
  440. package/src/hooks/useMenuCode.ts +26 -26
  441. package/src/hooks/userVModel.ts +19 -19
  442. package/src/index.ts +31 -31
  443. package/src/pageComponent/assets/img.d.ts +1 -1
  444. package/src/pageComponent/assets/styles/alarm/add-warning-configure.less +29 -29
  445. package/src/pageComponent/assets/styles/alarm/alarmDetail.less +18 -18
  446. package/src/pageComponent/assets/styles/alarm/check-people.less +52 -52
  447. package/src/pageComponent/assets/styles/alarm/index.less +6 -6
  448. package/src/pageComponent/assets/styles/alarm/video-play.less +22 -22
  449. package/src/pageComponent/assets/styles/alarm/warning-configure.less +7 -7
  450. package/src/pageComponent/assets/styles/alarm/warning-record.less +17 -17
  451. package/src/pageComponent/assets/styles/boardScreen/components/Card1Outer.less +76 -76
  452. package/src/pageComponent/assets/styles/boardScreen/components/Card2Outer.less +139 -139
  453. package/src/pageComponent/assets/styles/boardScreen/components/PopBox.less +83 -83
  454. package/src/pageComponent/assets/styles/boardScreen/index.less +57 -57
  455. package/src/pageComponent/assets/styles/boardScreen/room/index.less +205 -205
  456. package/src/pageComponent/assets/styles/boardScreen/room/mixin.less +19 -19
  457. package/src/pageComponent/assets/styles/boardScreen/tupu/index.less +19 -19
  458. package/src/pageComponent/assets/styles/card/index.less +196 -196
  459. package/src/pageComponent/assets/styles/constant/antd.less +1 -1
  460. package/src/pageComponent/assets/styles/data/index.less +58 -58
  461. package/src/pageComponent/assets/styles/htModal/control.less +20 -20
  462. package/src/pageComponent/assets/styles/htModal/index.less +8 -8
  463. package/src/pageComponent/assets/styles/htModal/task.less +24 -24
  464. package/src/pageComponent/assets/styles/index.less +90 -90
  465. package/src/pageComponent/assets/styles/login/login.less +190 -190
  466. package/src/pageComponent/assets/styles/login/loginBox.less +233 -233
  467. package/src/pageComponent/assets/styles/pressureFiltration/filterPressConfiguration.less +13 -13
  468. package/src/pageComponent/assets/styles/pressureFiltration/index.less +4 -4
  469. package/src/pageComponent/assets/styles/pressureFiltration/pressureFiltrationHome.less +112 -112
  470. package/src/pageComponent/assets/styles/pressureFiltration/pressureFiltrationRecord.less +15 -15
  471. package/src/pageComponent/assets/styles/pressureFiltration/shiftChange.less +13 -13
  472. package/src/pageComponent/assets/styles/processFlow/addonAfter.less +2 -2
  473. package/src/pageComponent/assets/styles/processFlow/colorPicker.less +24 -24
  474. package/src/pageComponent/assets/styles/processFlow/editor.less +198 -198
  475. package/src/pageComponent/assets/styles/processFlow/index.less +151 -151
  476. package/src/pageComponent/assets/styles/processFlow/operationArea.less +58 -58
  477. package/src/pageComponent/assets/styles/processFlow/preview.less +70 -70
  478. package/src/pageComponent/assets/styles/processFlow/processDrawingPreviewModal.less +10 -10
  479. package/src/pageComponent/assets/styles/systemManager/about.less +57 -57
  480. package/src/pageComponent/assets/styles/systemManager/aboutNew.less +98 -98
  481. package/src/pageComponent/assets/styles/systemManager/index.less +111 -103
  482. package/src/pageComponent/assets/styles/systemManager/menu-manager.less +69 -69
  483. package/src/pageComponent/assets/styles/systemManager/noticeManager/noticeCenter.less +6 -6
  484. package/src/pageComponent/assets/styles/systemManager/noticeManager/noticeMaintain.less +13 -13
  485. package/src/pageComponent/assets/styles/systemManager/noticeManager/noticeManager.less +13 -13
  486. package/src/pageComponent/assets/styles/systemManager/param-manager.less +47 -47
  487. package/src/pageComponent/assets/styles/systemManager/systemSetting.less +131 -131
  488. package/src/pageComponent/assets/styles/thingModel/factory.less +125 -125
  489. package/src/pageComponent/assets/zh-cn.js +134 -134
  490. package/src/pageComponent/components/CommonTree.tsx +402 -402
  491. package/src/pageComponent/components/DynamicIcon.tsx +27 -27
  492. package/src/pageComponent/components/EditPasswordForm.tsx +110 -110
  493. package/src/pageComponent/components/IconSelect.tsx +50 -50
  494. package/src/pageComponent/components/ProFormItem.tsx +197 -197
  495. package/src/pageComponent/components/SearchSelect.tsx +142 -142
  496. package/src/pageComponent/components/boardScreen/Card1Outer.tsx +29 -29
  497. package/src/pageComponent/components/boardScreen/Card2Outer.tsx +24 -24
  498. package/src/pageComponent/components/boardScreen/PopBox.tsx +141 -141
  499. package/src/pageComponent/components/boardScreen/PowerCut.tsx +104 -104
  500. package/src/pageComponent/components/boardScreen/PowerSupply.tsx +98 -98
  501. package/src/pageComponent/components/boardScreen/card2OuterTable.tsx +96 -96
  502. package/src/pageComponent/components/check-people.tsx +256 -256
  503. package/src/pageComponent/components/elcRoomHt/index.tsx +115 -115
  504. package/src/pageComponent/components/htModal/control.tsx +190 -190
  505. package/src/pageComponent/components/htModal/index.tsx +41 -41
  506. package/src/pageComponent/components/htModal/task.tsx +42 -42
  507. package/src/pageComponent/components/loginBox/README.md +21 -21
  508. package/src/pageComponent/components/loginBox/index.tsx +174 -174
  509. package/src/pageComponent/components/noticeManager/addChannel.tsx +103 -103
  510. package/src/pageComponent/components/noticeManager/addNotice.tsx +398 -398
  511. package/src/pageComponent/components/noticeManager/addTemplate.tsx +116 -116
  512. package/src/pageComponent/components/noticeManager/noticeGrade.tsx +150 -150
  513. package/src/pageComponent/components/noticeManager/noticeMaintain.tsx +32 -32
  514. package/src/pageComponent/components/noticeManager/noticeTemplate.tsx +268 -268
  515. package/src/pageComponent/components/noticeManager/notificationDetails.tsx +133 -133
  516. package/src/pageComponent/components/noticeManager/sendDetails.tsx +207 -207
  517. package/src/pageComponent/components/pressureFiltration/alarmList.tsx +35 -35
  518. package/src/pageComponent/components/pressureFiltration/configuration.tsx +155 -155
  519. package/src/pageComponent/components/pressureFiltration/numberOfPlates.tsx +32 -32
  520. package/src/pageComponent/components/pressureFiltration/shiftChange.tsx +91 -91
  521. package/src/pageComponent/components/pss-cabinet/README.md +1 -1
  522. package/src/pageComponent/components/pss-cabinet/cabinet.d.ts +43 -43
  523. package/src/pageComponent/components/pss-cabinet/cabinetRender.ts +540 -540
  524. package/src/pageComponent/components/user/userTable.tsx +157 -157
  525. package/src/pageComponent/components/user/userTree.tsx +266 -266
  526. package/src/pageComponent/components/video-play.tsx +83 -83
  527. package/src/pageComponent/config/htconfig.ts +32 -32
  528. package/src/pageComponent/config/systemConfig.ts +159 -159
  529. package/src/pageComponent/hooks/cardTable.ts +88 -88
  530. package/src/pageComponent/hooks/filters.ts +81 -81
  531. package/src/pageComponent/hooks/global.ts +11 -11
  532. package/src/pageComponent/hooks/manage-module/useModalForm.ts +44 -44
  533. package/src/pageComponent/hooks/manage-module/useModalTitle.ts +34 -34
  534. package/src/pageComponent/hooks/manage-module/useModalVisibleControl.ts +31 -31
  535. package/src/pageComponent/hooks/screen.ts +43 -43
  536. package/src/pageComponent/hooks/tabListConfig.ts +60 -60
  537. package/src/pageComponent/hooks/toPreviewData.ts +38 -38
  538. package/src/pageComponent/hooks/treeSearch.ts +151 -151
  539. package/src/pageComponent/hooks/useBus.ts +26 -26
  540. package/src/pageComponent/hooks/useMouse.ts +26 -26
  541. package/src/pageComponent/hooks/useProxy.ts +8 -8
  542. package/src/pageComponent/hooks/useTableList.ts +92 -92
  543. package/src/pageComponent/hooks/useVModel.ts +17 -17
  544. package/src/pageComponent/hooks/useWatchOnce.ts +12 -12
  545. package/src/pageComponent/index.ts +125 -125
  546. package/src/pageComponent/store/index.ts +86 -86
  547. package/src/pageComponent/utils/base64.ts +27 -27
  548. package/src/pageComponent/utils/filter.ts +152 -152
  549. package/src/pageComponent/utils/format.ts +95 -95
  550. package/src/pageComponent/utils/index.ts +71 -71
  551. package/src/pageComponent/utils/is.ts +30 -30
  552. package/src/pageComponent/utils/transform.ts +27 -27
  553. package/src/pageComponent/utils/tree.ts +83 -83
  554. package/src/pageComponent/utils/upload.ts +24 -24
  555. package/src/pageComponent/utils/validation.ts +26 -26
  556. package/src/pageComponent/views/alarms/add-warning-configure/form/basic-form.tsx +281 -281
  557. package/src/pageComponent/views/alarms/add-warning-configure/form/linkage-form.tsx +130 -130
  558. package/src/pageComponent/views/alarms/add-warning-configure/form/rule-form.tsx +347 -347
  559. package/src/pageComponent/views/alarms/add-warning-configure/index.tsx +221 -221
  560. package/src/pageComponent/views/alarms/alarmDetail/index.tsx +250 -250
  561. package/src/pageComponent/views/alarms/index.tsx +7 -7
  562. package/src/pageComponent/views/alarms/warning-configure/README.md +53 -53
  563. package/src/pageComponent/views/alarms/warning-configure/batch-import-dialog.tsx +123 -123
  564. package/src/pageComponent/views/alarms/warning-configure/configure-table.tsx +186 -186
  565. package/src/pageComponent/views/alarms/warning-configure/index.tsx +75 -75
  566. package/src/pageComponent/views/alarms/warning-configure/table-tool.tsx +57 -57
  567. package/src/pageComponent/views/alarms/warning-record/README.md +49 -49
  568. package/src/pageComponent/views/alarms/warning-record/index.tsx +80 -80
  569. package/src/pageComponent/views/alarms/warning-record/query-filter.tsx +129 -129
  570. package/src/pageComponent/views/alarms/warning-record/record-table.tsx +449 -449
  571. package/src/pageComponent/views/boardScreen/index.tsx +261 -261
  572. package/src/pageComponent/views/boardScreen/room.tsx +180 -180
  573. package/src/pageComponent/views/boardScreen/tupu.tsx +143 -143
  574. package/src/pageComponent/views/card-center/README.md +32 -32
  575. package/src/pageComponent/views/card-center/cardWarehouse.tsx +679 -679
  576. package/src/pageComponent/views/card-center/components/cardDetail.tsx +259 -259
  577. package/src/pageComponent/views/card-center/components/editPage.tsx +158 -158
  578. package/src/pageComponent/views/card-center/components/pageDetail.tsx +172 -172
  579. package/src/pageComponent/views/card-center/components/selectCard.tsx +101 -101
  580. package/src/pageComponent/views/card-center/less/editPage.less +119 -119
  581. package/src/pageComponent/views/card-center/less/selectCard.less +23 -23
  582. package/src/pageComponent/views/card-center/pageConfiguration.tsx +573 -573
  583. package/src/pageComponent/views/data-center/README.md +32 -32
  584. package/src/pageComponent/views/data-center/assets/less/dataAnalysis.less +175 -175
  585. package/src/pageComponent/views/data-center/cardModal.tsx +199 -199
  586. package/src/pageComponent/views/data-center/cardSubscription.tsx +322 -322
  587. package/src/pageComponent/views/data-center/components/chart.ts +81 -81
  588. package/src/pageComponent/views/data-center/components/groupModal.tsx +317 -317
  589. package/src/pageComponent/views/data-center/components/leftTree.tsx +171 -171
  590. package/src/pageComponent/views/data-center/components/searchHeader.tsx +173 -173
  591. package/src/pageComponent/views/data-center/components/table.tsx +51 -51
  592. package/src/pageComponent/views/data-center/dataAnalysis.tsx +532 -532
  593. package/src/pageComponent/views/data-center/userModal.tsx +120 -120
  594. package/src/pageComponent/views/elcRoom/index.tsx +106 -106
  595. package/src/pageComponent/views/factoryManage/index.tsx +675 -675
  596. package/src/pageComponent/views/fileManager/assets/less/components.less +50 -50
  597. package/src/pageComponent/views/fileManager/assets/less/index.less +281 -281
  598. package/src/pageComponent/views/fileManager/components/CreateFolder.tsx +111 -111
  599. package/src/pageComponent/views/fileManager/components/MoveToFolder.tsx +212 -212
  600. package/src/pageComponent/views/fileManager/components/Rename.tsx +115 -115
  601. package/src/pageComponent/views/fileManager/components/UploadFiles.tsx +148 -148
  602. package/src/pageComponent/views/fileManager/fileManager.tsx +769 -769
  603. package/src/pageComponent/views/fileManager/index.tsx +12 -12
  604. package/src/pageComponent/views/index.tsx +20 -20
  605. package/src/pageComponent/views/login/README.md +57 -57
  606. package/src/pageComponent/views/login/box.tsx +300 -300
  607. package/src/pageComponent/views/login/index.tsx +120 -120
  608. package/src/pageComponent/views/login/leftImg.tsx +23 -23
  609. package/src/pageComponent/views/login/top-title.tsx +12 -12
  610. package/src/pageComponent/views/pressureFiltration/feeding.tsx +69 -69
  611. package/src/pageComponent/views/pressureFiltration/pressureFiltrationHome.tsx +265 -265
  612. package/src/pageComponent/views/pressureFiltration/productionShiftReport.tsx +163 -163
  613. package/src/pageComponent/views/pressureFiltration/record.tsx +262 -262
  614. package/src/pageComponent/views/pressureFiltration/unloading.tsx +79 -79
  615. package/src/pageComponent/views/processDrawingConfiguration/README.md +30 -30
  616. package/src/pageComponent/views/processDrawingConfiguration/components/addonAfter.tsx +20 -20
  617. package/src/pageComponent/views/processDrawingConfiguration/components/cardItem.tsx +81 -81
  618. package/src/pageComponent/views/processDrawingConfiguration/components/colorPicker.tsx +59 -59
  619. package/src/pageComponent/views/processDrawingConfiguration/components/eventForm.tsx +43 -43
  620. package/src/pageComponent/views/processDrawingConfiguration/components/flowList.tsx +56 -56
  621. package/src/pageComponent/views/processDrawingConfiguration/components/propertyForm.tsx +94 -94
  622. package/src/pageComponent/views/processDrawingConfiguration/components/propertyModal.tsx +71 -71
  623. package/src/pageComponent/views/processDrawingConfiguration/components/state.tsx +139 -139
  624. package/src/pageComponent/views/processDrawingConfiguration/components/styleForm.tsx +199 -199
  625. package/src/pageComponent/views/processDrawingConfiguration/editor/components/data.tsx +192 -192
  626. package/src/pageComponent/views/processDrawingConfiguration/editor/components/textarea.tsx +9 -9
  627. package/src/pageComponent/views/processDrawingConfiguration/editor/config.ts +310 -310
  628. package/src/pageComponent/views/processDrawingConfiguration/editor/index.tsx +116 -116
  629. package/src/pageComponent/views/processDrawingConfiguration/editor/instanceSelector.tsx +190 -190
  630. package/src/pageComponent/views/processDrawingConfiguration/editor/mainContent.tsx +319 -319
  631. package/src/pageComponent/views/processDrawingConfiguration/editor/operationArea.tsx +449 -449
  632. package/src/pageComponent/views/processDrawingConfiguration/editor/previewModal.tsx +121 -121
  633. package/src/pageComponent/views/processDrawingConfiguration/editor/utils.ts +76 -76
  634. package/src/pageComponent/views/processDrawingConfiguration/editor-util/index.d.ts +98 -98
  635. package/src/pageComponent/views/processDrawingConfiguration/editor-util/index.js +2055 -2055
  636. package/src/pageComponent/views/processDrawingConfiguration/hooks/index.ts +152 -152
  637. package/src/pageComponent/views/processDrawingConfiguration/hooks/useActiveWidget.ts +34 -34
  638. package/src/pageComponent/views/processDrawingConfiguration/index.tsx +163 -163
  639. package/src/pageComponent/views/processDrawingConfiguration/previewModal.tsx +123 -123
  640. package/src/pageComponent/views/productManager/index.tsx +349 -349
  641. package/src/pageComponent/views/productManager/update.tsx +448 -448
  642. package/src/pageComponent/views/productManager/utils/emuns.ts +111 -111
  643. package/src/pageComponent/views/productManager/utils/formRules.ts +109 -109
  644. package/src/pageComponent/views/productManager/versionEdit/index.tsx +104 -104
  645. package/src/pageComponent/views/productManager/versionEdit/param.tsx +236 -236
  646. package/src/pageComponent/views/productionPlanManager/assets/components/Plan.less +140 -140
  647. package/src/pageComponent/views/productionPlanManager/assets/dayPCPlan.less +20 -20
  648. package/src/pageComponent/views/productionPlanManager/assets/daySCPlan.less +14 -14
  649. package/src/pageComponent/views/productionPlanManager/assets/monthPCPlan.less +22 -22
  650. package/src/pageComponent/views/productionPlanManager/assets/productionPlan.less +119 -111
  651. package/src/pageComponent/views/productionPlanManager/assets/yearPCPlan.less +86 -86
  652. package/src/pageComponent/views/productionPlanManager/components/Plan.tsx +802 -802
  653. package/src/pageComponent/views/productionPlanManager/components/Plan_back.tsx +353 -353
  654. package/src/pageComponent/views/productionPlanManager/dayPCPlan.tsx +175 -175
  655. package/src/pageComponent/views/productionPlanManager/daySCPlan.tsx +156 -156
  656. package/src/pageComponent/views/productionPlanManager/dayWYPlan.tsx +19 -19
  657. package/src/pageComponent/views/productionPlanManager/monthPCPlan.tsx +242 -242
  658. package/src/pageComponent/views/productionPlanManager/productionPlanConfig.tsx +559 -559
  659. package/src/pageComponent/views/productionPlanManager/productionPlan_old.tsx +434 -434
  660. package/src/pageComponent/views/productionPlanManager/yearPCPlan.tsx +536 -536
  661. package/src/pageComponent/views/projectManager/components/commonForm.tsx +207 -207
  662. package/src/pageComponent/views/projectManager/detail.tsx +463 -463
  663. package/src/pageComponent/views/projectManager/hooks/useTable.ts +96 -96
  664. package/src/pageComponent/views/projectManager/hooks/useTreeSearch.ts +231 -231
  665. package/src/pageComponent/views/projectManager/index.tsx +464 -464
  666. package/src/pageComponent/views/projectManager/less/index.less +19 -19
  667. package/src/pageComponent/views/projectManager/utils/emuns.ts +86 -86
  668. package/src/pageComponent/views/projectManager/utils/formRules.ts +342 -342
  669. package/src/pageComponent/views/projectManager/utils/index.ts +213 -213
  670. package/src/pageComponent/views/pss/assets/less/ApproveOpinion.less +18 -18
  671. package/src/pageComponent/views/pss/assets/less/NewOrder.less +95 -95
  672. package/src/pageComponent/views/pss/assets/less/PerformOperation.less +42 -42
  673. package/src/pageComponent/views/pss/assets/less/cus-table.less +330 -330
  674. package/src/pageComponent/views/pss/assets/less/index.less +476 -475
  675. package/src/pageComponent/views/pss/components/ApproveOpinion.tsx +171 -171
  676. package/src/pageComponent/views/pss/components/Info.tsx +506 -506
  677. package/src/pageComponent/views/pss/components/NewOrder.tsx +618 -618
  678. package/src/pageComponent/views/pss/components/PerformOperation.tsx +102 -102
  679. package/src/pageComponent/views/pss/components/table.tsx +840 -840
  680. package/src/pageComponent/views/pss/index.tsx +18 -18
  681. package/src/pageComponent/views/pss/list.tsx +65 -65
  682. package/src/pageComponent/views/pss/utils/index.ts +9 -9
  683. package/src/pageComponent/views/pssRecord/assets/index.less +258 -255
  684. package/src/pageComponent/views/pssRecord/components/Info.tsx +223 -223
  685. package/src/pageComponent/views/pssRecord/index.tsx +334 -334
  686. package/src/pageComponent/views/systemManager/about/README.md +37 -37
  687. package/src/pageComponent/views/systemManager/about/index.tsx +176 -176
  688. package/src/pageComponent/views/systemManager/aboutNew/README.md +26 -26
  689. package/src/pageComponent/views/systemManager/aboutNew/index.tsx +86 -86
  690. package/src/pageComponent/views/systemManager/authManager/menuManager/README.md +45 -45
  691. package/src/pageComponent/views/systemManager/authManager/menuManager/index.tsx +106 -106
  692. package/src/pageComponent/views/systemManager/authManager/menuManager/menuDetail.tsx +185 -185
  693. package/src/pageComponent/views/systemManager/authManager/menuManager/menuForm.tsx +284 -284
  694. package/src/pageComponent/views/systemManager/authManager/menuManager/menuSelectTree.tsx +129 -129
  695. package/src/pageComponent/views/systemManager/authManager/menuManager/updateMenuDialog.tsx +87 -87
  696. package/src/pageComponent/views/systemManager/authManager/menuManager/uploadJSONDialog.tsx +79 -79
  697. package/src/pageComponent/views/systemManager/authManager/roleManager/README.md +43 -43
  698. package/src/pageComponent/views/systemManager/authManager/roleManager/index.tsx +272 -272
  699. package/src/pageComponent/views/systemManager/authManager/roleManager/updateRoleDialog.tsx +192 -192
  700. package/src/pageComponent/views/systemManager/authManager/userManager/README.md +49 -49
  701. package/src/pageComponent/views/systemManager/authManager/userManager/index.tsx +308 -308
  702. package/src/pageComponent/views/systemManager/authManager/userManager/updateUserDialog.tsx +332 -332
  703. package/src/pageComponent/views/systemManager/authManager/userManager/userProfileDialog.tsx +107 -107
  704. package/src/pageComponent/views/systemManager/logManager/README.md +37 -37
  705. package/src/pageComponent/views/systemManager/noticeManager/noticeCenter.tsx +339 -339
  706. package/src/pageComponent/views/systemManager/noticeManager/noticeManager.tsx +177 -177
  707. package/src/pageComponent/views/systemManager/orgManager/depManager/README.md +60 -60
  708. package/src/pageComponent/views/systemManager/orgManager/depManager/batchImportModal.tsx +129 -129
  709. package/src/pageComponent/views/systemManager/orgManager/depManager/depTree.tsx +129 -129
  710. package/src/pageComponent/views/systemManager/orgManager/depManager/employeeTable.tsx +264 -264
  711. package/src/pageComponent/views/systemManager/orgManager/depManager/updateDepDialog.tsx +246 -246
  712. package/src/pageComponent/views/systemManager/orgManager/depManager/updateEmployeeDialog.tsx +327 -327
  713. package/src/pageComponent/views/systemManager/orgManager/depManagerCorp/README.md +60 -60
  714. package/src/pageComponent/views/systemManager/orgManager/depManagerCorp/depTree.tsx +188 -188
  715. package/src/pageComponent/views/systemManager/orgManager/depManagerCorp/employeeTable.tsx +253 -253
  716. package/src/pageComponent/views/systemManager/orgManager/depManagerCorp/updateDepDialog.tsx +362 -362
  717. package/src/pageComponent/views/systemManager/orgManager/depManagerCorp/updateEmployeeDialog.tsx +377 -377
  718. package/src/pageComponent/views/systemManager/orgManager/empManager.tsx +7 -7
  719. package/src/pageComponent/views/systemManager/orgManager/postManager/README.md +43 -43
  720. package/src/pageComponent/views/systemManager/orgManager/postManager/index.tsx +248 -248
  721. package/src/pageComponent/views/systemManager/orgManager/postManager/updatePostDialog.tsx +184 -184
  722. package/src/pageComponent/views/systemManager/orgManager/teamManager/README.md +47 -47
  723. package/src/pageComponent/views/systemManager/orgManager/teamManager/index.tsx +256 -256
  724. package/src/pageComponent/views/systemManager/orgManager/teamManager/updateTeamDialog.tsx +287 -287
  725. package/src/pageComponent/views/systemManager/paramManager/README.md +37 -37
  726. package/src/pageComponent/views/systemManager/paramManager/collapseContainer.tsx +54 -54
  727. package/src/pageComponent/views/systemManager/paramManager/dynamicForm.tsx +138 -138
  728. package/src/pageComponent/views/systemManager/paramManager/index.tsx +127 -127
  729. package/src/pageComponent/views/systemManager/paramManager/tabItem.tsx +175 -175
  730. package/src/pageComponent/views/systemManager/personalSetting/README.md +37 -37
  731. package/src/pageComponent/views/systemManager/systemSetting/README.md +39 -39
  732. package/src/pageComponent/views/systemManager/systemSetting/data.ts +133 -133
  733. package/src/pageComponent/views/systemManager/systemSetting/index.tsx +575 -575
  734. package/src/pageComponent/views/thingInstance/component/addThing.tsx +737 -732
  735. package/src/pageComponent/views/thingInstance/component/baseItem.tsx +7 -7
  736. package/src/pageComponent/views/thingInstance/component/dynamicForm.tsx +265 -265
  737. package/src/pageComponent/views/thingInstance/component/editRelation.tsx +415 -415
  738. package/src/pageComponent/views/thingInstance/component/editThing.tsx +985 -978
  739. package/src/pageComponent/views/thingInstance/component/logicForm.tsx +166 -166
  740. package/src/pageComponent/views/thingInstance/component/thingDetail.tsx +445 -437
  741. package/src/pageComponent/views/thingInstance/data.ts +63 -63
  742. package/src/pageComponent/views/thingInstance/hooks/filters.ts +110 -110
  743. package/src/pageComponent/views/thingInstance/hooks/useTableList.ts +92 -92
  744. package/src/pageComponent/views/thingInstance/hooks/useTreeSearch.ts +93 -93
  745. package/src/pageComponent/views/thingInstance/index.tsx +1174 -1169
  746. package/src/pageComponent/views/thingInstance/less/editThing.less +150 -150
  747. package/src/pageComponent/views/thingInstance/less/thingInstance.less +142 -142
  748. package/src/pageComponent/views/thingInstance/modal.tsx +121 -121
  749. package/src/pageComponent/views/thingModel/component/detail.tsx +286 -286
  750. package/src/pageComponent/views/thingModel/component/tabAttr/index.tsx +127 -127
  751. package/src/pageComponent/views/thingModel/component/tabAttr/update.tsx +408 -408
  752. package/src/pageComponent/views/thingModel/component/tabRelation/index.tsx +203 -203
  753. package/src/pageComponent/views/thingModel/component/tabRelation/update.tsx +278 -278
  754. package/src/pageComponent/views/thingModel/component/update.tsx +216 -216
  755. package/src/pageComponent/views/thingModel/config.ts +192 -192
  756. package/src/pageComponent/views/thingModel/hooks/useTableList.ts +91 -91
  757. package/src/pageComponent/views/thingModel/hooks/useTreeSearch.ts +93 -93
  758. package/src/pageComponent/views/thingModel/index.tsx +363 -363
  759. package/src/pageComponent/views/thingModel/less/thingModel.less +105 -105
  760. package/src/pageComponent/views/thingModel/less/thingModelDetail.less +142 -142
  761. package/src/pageComponent/views/video/README.md +81 -81
  762. package/src/pageComponent/views/video/assets/iconfont/demo.css +539 -539
  763. package/src/pageComponent/views/video/assets/iconfont/demo_index.html +487 -487
  764. package/src/pageComponent/views/video/assets/iconfont/iconfont.css +67 -67
  765. package/src/pageComponent/views/video/assets/iconfont/iconfont.json +100 -100
  766. package/src/pageComponent/views/video/assets/styles/const.less +1 -1
  767. package/src/pageComponent/views/video/assets/styles/constant/antd.less +1 -1
  768. package/src/pageComponent/views/video/assets/styles/home.less +96 -96
  769. package/src/pageComponent/views/video/assets/styles/index.less +27 -27
  770. package/src/pageComponent/views/video/assets/styles/lightColour.less +108 -108
  771. package/src/pageComponent/views/video/assets/styles/login.less +56 -56
  772. package/src/pageComponent/views/video/assets/styles/loginBox.less +51 -51
  773. package/src/pageComponent/views/video/assets/styles/play.less +66 -66
  774. package/src/pageComponent/views/video/assets/styles/reset.less +17 -17
  775. package/src/pageComponent/views/video/assets/styles/video/event.less +121 -121
  776. package/src/pageComponent/views/video/assets/styles/video/group.less +179 -179
  777. package/src/pageComponent/views/video/assets/styles/video/linkage.less +79 -79
  778. package/src/pageComponent/views/video/assets/styles/video/photo.less +119 -115
  779. package/src/pageComponent/views/video/assets/styles/video/preview.less +503 -483
  780. package/src/pageComponent/views/video/assets/styles/video/replay.less +84 -84
  781. package/src/pageComponent/views/video/assets/styles/video/rotation.less +155 -144
  782. package/src/pageComponent/views/video/assets/styles/video/setting.less +48 -48
  783. package/src/pageComponent/views/video/assets/zh-cn.js +133 -133
  784. package/src/pageComponent/views/video/components/checkCamera.tsx +130 -130
  785. package/src/pageComponent/views/video/components/transfer.tsx +474 -474
  786. package/src/pageComponent/views/video/components/videoPlayer/index.tsx +93 -93
  787. package/src/pageComponent/views/video/components/videoPlayer/util/ZLMRTCClient.js +6839 -6839
  788. package/src/pageComponent/views/video/components/videoPlayer/util/axios.ts +53 -53
  789. package/src/pageComponent/views/video/components/videoPlayer/util/byUuid.ts +77 -77
  790. package/src/pageComponent/views/video/components/videoPlayer/util/video.ts +252 -252
  791. package/src/pageComponent/views/video/event/algorithmType.tsx +257 -257
  792. package/src/pageComponent/views/video/event/eventConfig.tsx +399 -399
  793. package/src/pageComponent/views/video/event/eventType.tsx +304 -304
  794. package/src/pageComponent/views/video/event/events.tsx +562 -562
  795. package/src/pageComponent/views/video/linkage/linkage.tsx +220 -220
  796. package/src/pageComponent/views/video/linkage/updateMode.tsx +179 -179
  797. package/src/pageComponent/views/video/play.tsx +107 -107
  798. package/src/pageComponent/views/video/preview/components/alarmLinkageModal.tsx +62 -62
  799. package/src/pageComponent/views/video/preview/components/followItem.tsx +198 -194
  800. package/src/pageComponent/views/video/preview/components/fullScreen.tsx +63 -63
  801. package/src/pageComponent/views/video/preview/components/treeItem.tsx +333 -333
  802. package/src/pageComponent/views/video/preview/preview.tsx +816 -816
  803. package/src/pageComponent/views/video/rotation/PlayVideos.tsx +178 -178
  804. package/src/pageComponent/views/video/rotation/rotation.tsx +562 -555
  805. package/src/pageComponent/views/video/sbgl/components/CheckDialog.tsx +128 -128
  806. package/src/pageComponent/views/video/sbgl/components/addGrouping.tsx +71 -71
  807. package/src/pageComponent/views/video/sbgl/group.tsx +532 -532
  808. package/src/pageComponent/views/video/sbgl/index.tsx +8 -8
  809. package/src/pageComponent/views/video/sbgl/nvr.tsx +275 -275
  810. package/src/pageComponent/views/video/sbgl/photo.tsx +696 -696
  811. package/src/pageComponent/views/video/setting/cameraPermission.tsx +123 -123
  812. package/src/pageComponent/views/video/setting/index.tsx +9 -9
  813. package/src/pageComponent/views/video/setting/system.tsx +146 -146
  814. package/src/pageComponent/views/video/utils/ZLMRTCClient.js +6839 -6839
  815. package/src/pageComponent/views/video/utils/index.ts +22 -22
  816. package/src/pageComponent/views/video/utils/validation.ts +2 -2
  817. package/src/pageComponent/views/video/utils/video.ts +254 -254
  818. package/src/pageComponent/views/video/utils/webSocket.ts +115 -115
  819. package/src/pageComponent/views/workforceManager/workforcePlan/assets/workforcePlan.less +118 -113
  820. package/src/pageComponent/views/workforceManager/workforcePlan/dayContent.tsx +171 -171
  821. package/src/pageComponent/views/workforceManager/workforcePlan/index.tsx +241 -241
  822. package/src/pageComponent/views/workforceManager/workforcePlan/mainTable.tsx +333 -333
  823. package/src/pageComponent/views/workforceManager/workforceRule/assets/classManagerAndWorkforceRuleComp.less +23 -0
  824. package/src/pageComponent/views/workforceManager/workforceRule/assets/index.less +10 -0
  825. package/src/pageComponent/views/workforceManager/workforceRule/assets/rule.less +34 -34
  826. package/src/pageComponent/views/workforceManager/workforceRule/components/classManager.tsx +380 -380
  827. package/src/pageComponent/views/workforceManager/workforceRule/components/rule.tsx +706 -706
  828. package/src/pageComponent/views/workforceManager/workforceRule/components/{workforceRule.tsx → workforceRuleComp.tsx} +236 -234
  829. package/src/pageComponent/views/workforceManager/workforceRule/index.tsx +33 -30
  830. package/src/styles/index.less +1 -1
  831. package/src/tpInit/utils.ts +1 -1
  832. package/src/types/gl.d.ts +25 -25
  833. package/src/types/global.d.ts +41 -41
  834. package/src/types/ht/ht-widget.d.ts +11327 -11327
  835. package/src/types/ht/ht.d.ts +11410 -11410
  836. package/src/types/ht/index.d.ts +4 -4
  837. package/src/types/shims-vue.d.ts +1 -1
  838. package/src/utils/README.md +3 -3
  839. package/src/utils/className.ts +16 -16
  840. package/src/utils/config.ts +5 -5
  841. package/src/utils/getSlots.ts +18 -18
  842. package/src/utils/index.ts +8 -8
  843. package/src/utils/installComponent.ts +12 -12
  844. package/src/utils/publicUtil/README.md +41 -41
  845. package/src/utils/publicUtil/changeTheme.ts +32 -32
  846. package/src/utils/publicUtil/index.ts +25 -25
  847. package/src/utils/publicUtil/login/index.ts +108 -108
  848. package/src/utils/publicUtil/message.tsx +14 -14
  849. package/src/utils/publicUtil/systemConfig.ts +6 -6
  850. package/src/utils/route.ts +123 -123
  851. package/tsconfig.json +27 -27
  852. package/src/pageComponent/views/workforceManager/workforceRule/assets/classManager.less +0 -14
@@ -1,1184 +1,1184 @@
1
- /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2
- .tinyColorMixin() {
3
- @functions: ~`(function() {
4
- // TinyColor v1.4.1
5
- // https://github.com/bgrins/TinyColor
6
- // 2016-07-07, Brian Grinstead, MIT License
7
- var trimLeft = /^\s+/,
8
- trimRight = /\s+$/,
9
- tinyCounter = 0,
10
- mathRound = Math.round,
11
- mathMin = Math.min,
12
- mathMax = Math.max,
13
- mathRandom = Math.random;
14
-
15
- function tinycolor (color, opts) {
16
-
17
- color = (color) ? color : '';
18
- opts = opts || { };
19
-
20
- // If input is already a tinycolor, return itself
21
- if (color instanceof tinycolor) {
22
- return color;
23
- }
24
- // If we are called as a function, call using new instead
25
- if (!(this instanceof tinycolor)) {
26
- return new tinycolor(color, opts);
27
- }
28
-
29
- var rgb = inputToRGB(color);
30
- this._originalInput = color,
31
- this._r = rgb.r,
32
- this._g = rgb.g,
33
- this._b = rgb.b,
34
- this._a = rgb.a,
35
- this._roundA = mathRound(100*this._a) / 100,
36
- this._format = opts.format || rgb.format;
37
- this._gradientType = opts.gradientType;
38
-
39
- // Don't let the range of [0,255] come back in [0,1].
40
- // Potentially lose a little bit of precision here, but will fix issues where
41
- // .5 gets interpreted as half of the total, instead of half of 1
42
- // If it was supposed to be 128, this was already taken care of by inputToRgb
43
- if (this._r < 1) { this._r = mathRound(this._r); }
44
- if (this._g < 1) { this._g = mathRound(this._g); }
45
- if (this._b < 1) { this._b = mathRound(this._b); }
46
-
47
- this._ok = rgb.ok;
48
- this._tc_id = tinyCounter++;
49
- }
50
-
51
- tinycolor.prototype = {
52
- isDark: function() {
53
- return this.getBrightness() < 128;
54
- },
55
- isLight: function() {
56
- return !this.isDark();
57
- },
58
- isValid: function() {
59
- return this._ok;
60
- },
61
- getOriginalInput: function() {
62
- return this._originalInput;
63
- },
64
- getFormat: function() {
65
- return this._format;
66
- },
67
- getAlpha: function() {
68
- return this._a;
69
- },
70
- getBrightness: function() {
71
- //http://www.w3.org/TR/AERT#color-contrast
72
- var rgb = this.toRgb();
73
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
74
- },
75
- getLuminance: function() {
76
- //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
77
- var rgb = this.toRgb();
78
- var RsRGB, GsRGB, BsRGB, R, G, B;
79
- RsRGB = rgb.r/255;
80
- GsRGB = rgb.g/255;
81
- BsRGB = rgb.b/255;
82
-
83
- if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
84
- if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
85
- if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
86
- return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
87
- },
88
- setAlpha: function(value) {
89
- this._a = boundAlpha(value);
90
- this._roundA = mathRound(100*this._a) / 100;
91
- return this;
92
- },
93
- toHsv: function() {
94
- var hsv = rgbToHsv(this._r, this._g, this._b);
95
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
96
- },
97
- toHsvString: function() {
98
- var hsv = rgbToHsv(this._r, this._g, this._b);
99
- var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
100
- return (this._a == 1) ?
101
- "hsv(" + h + ", " + s + "%, " + v + "%)" :
102
- "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
103
- },
104
- toHsl: function() {
105
- var hsl = rgbToHsl(this._r, this._g, this._b);
106
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
107
- },
108
- toHslString: function() {
109
- var hsl = rgbToHsl(this._r, this._g, this._b);
110
- var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
111
- return (this._a == 1) ?
112
- "hsl(" + h + ", " + s + "%, " + l + "%)" :
113
- "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
114
- },
115
- toHex: function(allow3Char) {
116
- return rgbToHex(this._r, this._g, this._b, allow3Char);
117
- },
118
- toHexString: function(allow3Char) {
119
- return '#' + this.toHex(allow3Char);
120
- },
121
- toHex8: function(allow4Char) {
122
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
123
- },
124
- toHex8String: function(allow4Char) {
125
- return '#' + this.toHex8(allow4Char);
126
- },
127
- toRgb: function() {
128
- return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
129
- },
130
- toRgbString: function() {
131
- return (this._a == 1) ?
132
- "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
133
- "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
134
- },
135
- toPercentageRgb: function() {
136
- return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
137
- },
138
- toPercentageRgbString: function() {
139
- return (this._a == 1) ?
140
- "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
141
- "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
142
- },
143
- toName: function() {
144
- if (this._a === 0) {
145
- return "transparent";
146
- }
147
-
148
- if (this._a < 1) {
149
- return false;
150
- }
151
-
152
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
153
- },
154
- toFilter: function(secondColor) {
155
- var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
156
- var secondHex8String = hex8String;
157
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
158
-
159
- if (secondColor) {
160
- var s = tinycolor(secondColor);
161
- secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
162
- }
163
-
164
- return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
165
- },
166
- toString: function(format) {
167
- var formatSet = !!format;
168
- format = format || this._format;
169
-
170
- var formattedString = false;
171
- var hasAlpha = this._a < 1 && this._a >= 0;
172
- var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
173
-
174
- if (needsAlphaFormat) {
175
- // Special case for "transparent", all other non-alpha formats
176
- // will return rgba when there is transparency.
177
- if (format === "name" && this._a === 0) {
178
- return this.toName();
179
- }
180
- return this.toRgbString();
181
- }
182
- if (format === "rgb") {
183
- formattedString = this.toRgbString();
184
- }
185
- if (format === "prgb") {
186
- formattedString = this.toPercentageRgbString();
187
- }
188
- if (format === "hex" || format === "hex6") {
189
- formattedString = this.toHexString();
190
- }
191
- if (format === "hex3") {
192
- formattedString = this.toHexString(true);
193
- }
194
- if (format === "hex4") {
195
- formattedString = this.toHex8String(true);
196
- }
197
- if (format === "hex8") {
198
- formattedString = this.toHex8String();
199
- }
200
- if (format === "name") {
201
- formattedString = this.toName();
202
- }
203
- if (format === "hsl") {
204
- formattedString = this.toHslString();
205
- }
206
- if (format === "hsv") {
207
- formattedString = this.toHsvString();
208
- }
209
-
210
- return formattedString || this.toHexString();
211
- },
212
- clone: function() {
213
- return tinycolor(this.toString());
214
- },
215
-
216
- _applyModification: function(fn, args) {
217
- var color = fn.apply(null, [this].concat([].slice.call(args)));
218
- this._r = color._r;
219
- this._g = color._g;
220
- this._b = color._b;
221
- this.setAlpha(color._a);
222
- return this;
223
- },
224
- lighten: function() {
225
- return this._applyModification(lighten, arguments);
226
- },
227
- brighten: function() {
228
- return this._applyModification(brighten, arguments);
229
- },
230
- darken: function() {
231
- return this._applyModification(darken, arguments);
232
- },
233
- desaturate: function() {
234
- return this._applyModification(desaturate, arguments);
235
- },
236
- saturate: function() {
237
- return this._applyModification(saturate, arguments);
238
- },
239
- greyscale: function() {
240
- return this._applyModification(greyscale, arguments);
241
- },
242
- spin: function() {
243
- return this._applyModification(spin, arguments);
244
- },
245
-
246
- _applyCombination: function(fn, args) {
247
- return fn.apply(null, [this].concat([].slice.call(args)));
248
- },
249
- analogous: function() {
250
- return this._applyCombination(analogous, arguments);
251
- },
252
- complement: function() {
253
- return this._applyCombination(complement, arguments);
254
- },
255
- monochromatic: function() {
256
- return this._applyCombination(monochromatic, arguments);
257
- },
258
- splitcomplement: function() {
259
- return this._applyCombination(splitcomplement, arguments);
260
- },
261
- triad: function() {
262
- return this._applyCombination(triad, arguments);
263
- },
264
- tetrad: function() {
265
- return this._applyCombination(tetrad, arguments);
266
- }
267
- };
268
-
269
- // If input is an object, force 1 into "1.0" to handle ratios properly
270
- // String input requires "1.0" as input, so 1 will be treated as 1
271
- tinycolor.fromRatio = function(color, opts) {
272
- if (typeof color == "object") {
273
- var newColor = {};
274
- for (var i in color) {
275
- if (color.hasOwnProperty(i)) {
276
- if (i === "a") {
277
- newColor[i] = color[i];
278
- }
279
- else {
280
- newColor[i] = convertToPercentage(color[i]);
281
- }
282
- }
283
- }
284
- color = newColor;
285
- }
286
-
287
- return tinycolor(color, opts);
288
- };
289
-
290
- // Given a string or object, convert that input to RGB
291
- // Possible string inputs:
292
- //
293
- // "red"
294
- // "#f00" or "f00"
295
- // "#ff0000" or "ff0000"
296
- // "#ff000000" or "ff000000"
297
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
298
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
299
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
300
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
301
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
302
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
303
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
304
- //
305
- function inputToRGB(color) {
306
-
307
- var rgb = { r: 0, g: 0, b: 0 };
308
- var a = 1;
309
- var s = null;
310
- var v = null;
311
- var l = null;
312
- var ok = false;
313
- var format = false;
314
-
315
- if (typeof color == "string") {
316
- color = stringInputToObject(color);
317
- }
318
-
319
- if (typeof color == "object") {
320
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
321
- rgb = rgbToRgb(color.r, color.g, color.b);
322
- ok = true;
323
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
324
- }
325
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
326
- s = convertToPercentage(color.s);
327
- v = convertToPercentage(color.v);
328
- rgb = hsvToRgb(color.h, s, v);
329
- ok = true;
330
- format = "hsv";
331
- }
332
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
333
- s = convertToPercentage(color.s);
334
- l = convertToPercentage(color.l);
335
- rgb = hslToRgb(color.h, s, l);
336
- ok = true;
337
- format = "hsl";
338
- }
339
-
340
- if (color.hasOwnProperty("a")) {
341
- a = color.a;
342
- }
343
- }
344
-
345
- a = boundAlpha(a);
346
-
347
- return {
348
- ok: ok,
349
- format: color.format || format,
350
- r: mathMin(255, mathMax(rgb.r, 0)),
351
- g: mathMin(255, mathMax(rgb.g, 0)),
352
- b: mathMin(255, mathMax(rgb.b, 0)),
353
- a: a
354
- };
355
- }
356
-
357
- // Conversion Functions
358
- // --------------------
359
-
360
- // rgbToHsl, rgbToHsv, hslToRgb, hsvToRgb modified from:
361
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
362
-
363
- // rgbToRgb
364
- // Handle bounds / percentage checking to conform to CSS color spec
365
- // <http://www.w3.org/TR/css3-color/>
366
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
367
- // *Returns:* { r, g, b } in [0, 255]
368
- function rgbToRgb(r, g, b){
369
- return {
370
- r: bound01(r, 255) * 255,
371
- g: bound01(g, 255) * 255,
372
- b: bound01(b, 255) * 255
373
- };
374
- }
375
-
376
- // rgbToHsl
377
- // Converts an RGB color value to HSL.
378
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
379
- // *Returns:* { h, s, l } in [0,1]
380
- function rgbToHsl(r, g, b) {
381
-
382
- r = bound01(r, 255);
383
- g = bound01(g, 255);
384
- b = bound01(b, 255);
385
-
386
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
387
- var h, s, l = (max + min) / 2;
388
-
389
- if(max == min) {
390
- h = s = 0; // achromatic
391
- }
392
- else {
393
- var d = max - min;
394
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
395
- switch(max) {
396
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
397
- case g: h = (b - r) / d + 2; break;
398
- case b: h = (r - g) / d + 4; break;
399
- }
400
-
401
- h /= 6;
402
- }
403
-
404
- return { h: h, s: s, l: l };
405
- }
406
-
407
- // hslToRgb
408
- // Converts an HSL color value to RGB.
409
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
410
- // *Returns:* { r, g, b } in the set [0, 255]
411
- function hslToRgb(h, s, l) {
412
- var r, g, b;
413
-
414
- h = bound01(h, 360);
415
- s = bound01(s, 100);
416
- l = bound01(l, 100);
417
-
418
- function hue2rgb(p, q, t) {
419
- if(t < 0) t += 1;
420
- if(t > 1) t -= 1;
421
- if(t < 1/6) return p + (q - p) * 6 * t;
422
- if(t < 1/2) return q;
423
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
424
- return p;
425
- }
426
-
427
- if(s === 0) {
428
- r = g = b = l; // achromatic
429
- }
430
- else {
431
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
432
- var p = 2 * l - q;
433
- r = hue2rgb(p, q, h + 1/3);
434
- g = hue2rgb(p, q, h);
435
- b = hue2rgb(p, q, h - 1/3);
436
- }
437
-
438
- return { r: r * 255, g: g * 255, b: b * 255 };
439
- }
440
-
441
- // rgbToHsv
442
- // Converts an RGB color value to HSV
443
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
444
- // *Returns:* { h, s, v } in [0,1]
445
- function rgbToHsv(r, g, b) {
446
-
447
- r = bound01(r, 255);
448
- g = bound01(g, 255);
449
- b = bound01(b, 255);
450
-
451
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
452
- var h, s, v = max;
453
-
454
- var d = max - min;
455
- s = max === 0 ? 0 : d / max;
456
-
457
- if(max == min) {
458
- h = 0; // achromatic
459
- }
460
- else {
461
- switch(max) {
462
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
463
- case g: h = (b - r) / d + 2; break;
464
- case b: h = (r - g) / d + 4; break;
465
- }
466
- h /= 6;
467
- }
468
- return { h: h, s: s, v: v };
469
- }
470
-
471
- // hsvToRgb
472
- // Converts an HSV color value to RGB.
473
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
474
- // *Returns:* { r, g, b } in the set [0, 255]
475
- function hsvToRgb(h, s, v) {
476
-
477
- h = bound01(h, 360) * 6;
478
- s = bound01(s, 100);
479
- v = bound01(v, 100);
480
-
481
- var i = Math.floor(h),
482
- f = h - i,
483
- p = v * (1 - s),
484
- q = v * (1 - f * s),
485
- t = v * (1 - (1 - f) * s),
486
- mod = i % 6,
487
- r = [v, q, p, p, t, v][mod],
488
- g = [t, v, v, q, p, p][mod],
489
- b = [p, p, t, v, v, q][mod];
490
-
491
- return { r: r * 255, g: g * 255, b: b * 255 };
492
- }
493
-
494
- // rgbToHex
495
- // Converts an RGB color to hex
496
- // Assumes r, g, and b are contained in the set [0, 255]
497
- // Returns a 3 or 6 character hex
498
- function rgbToHex(r, g, b, allow3Char) {
499
-
500
- var hex = [
501
- pad2(mathRound(r).toString(16)),
502
- pad2(mathRound(g).toString(16)),
503
- pad2(mathRound(b).toString(16))
504
- ];
505
-
506
- // Return a 3 character hex if possible
507
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
508
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
509
- }
510
-
511
- return hex.join("");
512
- }
513
-
514
- // rgbaToHex
515
- // Converts an RGBA color plus alpha transparency to hex
516
- // Assumes r, g, b are contained in the set [0, 255] and
517
- // a in [0, 1]. Returns a 4 or 8 character rgba hex
518
- function rgbaToHex(r, g, b, a, allow4Char) {
519
-
520
- var hex = [
521
- pad2(mathRound(r).toString(16)),
522
- pad2(mathRound(g).toString(16)),
523
- pad2(mathRound(b).toString(16)),
524
- pad2(convertDecimalToHex(a))
525
- ];
526
-
527
- // Return a 4 character hex if possible
528
- if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
529
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
530
- }
531
-
532
- return hex.join("");
533
- }
534
-
535
- // rgbaToArgbHex
536
- // Converts an RGBA color to an ARGB Hex8 string
537
- // Rarely used, but required for "toFilter()"
538
- function rgbaToArgbHex(r, g, b, a) {
539
-
540
- var hex = [
541
- pad2(convertDecimalToHex(a)),
542
- pad2(mathRound(r).toString(16)),
543
- pad2(mathRound(g).toString(16)),
544
- pad2(mathRound(b).toString(16))
545
- ];
546
-
547
- return hex.join("");
548
- }
549
-
550
- // equals
551
- // Can be called with any tinycolor input
552
- tinycolor.equals = function (color1, color2) {
553
- if (!color1 || !color2) { return false; }
554
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
555
- };
556
-
557
- tinycolor.random = function() {
558
- return tinycolor.fromRatio({
559
- r: mathRandom(),
560
- g: mathRandom(),
561
- b: mathRandom()
562
- });
563
- };
564
-
565
- // Modification Functions
566
- // ----------------------
567
- // Thanks to less.js for some of the basics here
568
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
569
-
570
- function desaturate(color, amount) {
571
- amount = (amount === 0) ? 0 : (amount || 10);
572
- var hsl = tinycolor(color).toHsl();
573
- hsl.s -= amount / 100;
574
- hsl.s = clamp01(hsl.s);
575
- return tinycolor(hsl);
576
- }
577
-
578
- function saturate(color, amount) {
579
- amount = (amount === 0) ? 0 : (amount || 10);
580
- var hsl = tinycolor(color).toHsl();
581
- hsl.s += amount / 100;
582
- hsl.s = clamp01(hsl.s);
583
- return tinycolor(hsl);
584
- }
585
-
586
- function greyscale(color) {
587
- return tinycolor(color).desaturate(100);
588
- }
589
-
590
- function lighten (color, amount) {
591
- amount = (amount === 0) ? 0 : (amount || 10);
592
- var hsl = tinycolor(color).toHsl();
593
- hsl.l += amount / 100;
594
- hsl.l = clamp01(hsl.l);
595
- return tinycolor(hsl);
596
- }
597
-
598
- function brighten(color, amount) {
599
- amount = (amount === 0) ? 0 : (amount || 10);
600
- var rgb = tinycolor(color).toRgb();
601
- rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
602
- rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
603
- rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
604
- return tinycolor(rgb);
605
- }
606
-
607
- function darken (color, amount) {
608
- amount = (amount === 0) ? 0 : (amount || 10);
609
- var hsl = tinycolor(color).toHsl();
610
- hsl.l -= amount / 100;
611
- hsl.l = clamp01(hsl.l);
612
- return tinycolor(hsl);
613
- }
614
-
615
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
616
- // Values outside of this range will be wrapped into this range.
617
- function spin(color, amount) {
618
- var hsl = tinycolor(color).toHsl();
619
- var hue = (hsl.h + amount) % 360;
620
- hsl.h = hue < 0 ? 360 + hue : hue;
621
- return tinycolor(hsl);
622
- }
623
-
624
- // Combination Functions
625
- // ---------------------
626
- // Thanks to jQuery xColor for some of the ideas behind these
627
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
628
-
629
- function complement(color) {
630
- var hsl = tinycolor(color).toHsl();
631
- hsl.h = (hsl.h + 180) % 360;
632
- return tinycolor(hsl);
633
- }
634
-
635
- function triad(color) {
636
- var hsl = tinycolor(color).toHsl();
637
- var h = hsl.h;
638
- return [
639
- tinycolor(color),
640
- tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
641
- tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
642
- ];
643
- }
644
-
645
- function tetrad(color) {
646
- var hsl = tinycolor(color).toHsl();
647
- var h = hsl.h;
648
- return [
649
- tinycolor(color),
650
- tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
651
- tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
652
- tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
653
- ];
654
- }
655
-
656
- function splitcomplement(color) {
657
- var hsl = tinycolor(color).toHsl();
658
- var h = hsl.h;
659
- return [
660
- tinycolor(color),
661
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
662
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
663
- ];
664
- }
665
-
666
- function analogous(color, results, slices) {
667
- results = results || 6;
668
- slices = slices || 30;
669
-
670
- var hsl = tinycolor(color).toHsl();
671
- var part = 360 / slices;
672
- var ret = [tinycolor(color)];
673
-
674
- for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
675
- hsl.h = (hsl.h + part) % 360;
676
- ret.push(tinycolor(hsl));
677
- }
678
- return ret;
679
- }
680
-
681
- function monochromatic(color, results) {
682
- results = results || 6;
683
- var hsv = tinycolor(color).toHsv();
684
- var h = hsv.h, s = hsv.s, v = hsv.v;
685
- var ret = [];
686
- var modification = 1 / results;
687
-
688
- while (results--) {
689
- ret.push(tinycolor({ h: h, s: s, v: v}));
690
- v = (v + modification) % 1;
691
- }
692
-
693
- return ret;
694
- }
695
-
696
- // Utility Functions
697
- // ---------------------
698
-
699
- tinycolor.mix = function(color1, color2, amount) {
700
- amount = (amount === 0) ? 0 : (amount || 50);
701
-
702
- var rgb1 = tinycolor(color1).toRgb();
703
- var rgb2 = tinycolor(color2).toRgb();
704
-
705
- var p = amount / 100;
706
-
707
- var rgba = {
708
- r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
709
- g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
710
- b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
711
- a: ((rgb2.a - rgb1.a) * p) + rgb1.a
712
- };
713
-
714
- return tinycolor(rgba);
715
- };
716
-
717
- // Readability Functions
718
- // ---------------------
719
- // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
720
-
721
- // contrast
722
- // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
723
- tinycolor.readability = function(color1, color2) {
724
- var c1 = tinycolor(color1);
725
- var c2 = tinycolor(color2);
726
- return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
727
- };
728
-
729
- // isReadable
730
- // Ensure that foreground and background color combinations meet WCAG2 guidelines.
731
- // The third argument is an optional Object.
732
- // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
733
- // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
734
- // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
735
-
736
- // *Example*
737
- // tinycolor.isReadable("#000", "#111") => false
738
- // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
739
- tinycolor.isReadable = function(color1, color2, wcag2) {
740
- var readability = tinycolor.readability(color1, color2);
741
- var wcag2Parms, out;
742
-
743
- out = false;
744
-
745
- wcag2Parms = validateWCAG2Parms(wcag2);
746
- switch (wcag2Parms.level + wcag2Parms.size) {
747
- case "AAsmall":
748
- case "AAAlarge":
749
- out = readability >= 4.5;
750
- break;
751
- case "AAlarge":
752
- out = readability >= 3;
753
- break;
754
- case "AAAsmall":
755
- out = readability >= 7;
756
- break;
757
- }
758
- return out;
759
-
760
- };
761
-
762
- // mostReadable
763
- // Given a base color and a list of possible foreground or background
764
- // colors for that base, returns the most readable color.
765
- // Optionally returns Black or White if the most readable color is unreadable.
766
- // *Example*
767
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
768
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
769
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
770
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
771
- tinycolor.mostReadable = function(baseColor, colorList, args) {
772
- var bestColor = null;
773
- var bestScore = 0;
774
- var readability;
775
- var includeFallbackColors, level, size ;
776
- args = args || {};
777
- includeFallbackColors = args.includeFallbackColors ;
778
- level = args.level;
779
- size = args.size;
780
-
781
- for (var i= 0; i < colorList.length ; i++) {
782
- readability = tinycolor.readability(baseColor, colorList[i]);
783
- if (readability > bestScore) {
784
- bestScore = readability;
785
- bestColor = tinycolor(colorList[i]);
786
- }
787
- }
788
-
789
- if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
790
- return bestColor;
791
- }
792
- else {
793
- args.includeFallbackColors=false;
794
- return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
795
- }
796
- };
797
-
798
- // Big List of Colors
799
- // ------------------
800
- // <http://www.w3.org/TR/css3-color/#svg-color>
801
- var names = tinycolor.names = {
802
- aliceblue: "f0f8ff",
803
- antiquewhite: "faebd7",
804
- aqua: "0ff",
805
- aquamarine: "7fffd4",
806
- azure: "f0ffff",
807
- beige: "f5f5dc",
808
- bisque: "ffe4c4",
809
- black: "000",
810
- blanchedalmond: "ffebcd",
811
- blue: "00f",
812
- blueviolet: "8a2be2",
813
- brown: "a52a2a",
814
- burlywood: "deb887",
815
- burntsienna: "ea7e5d",
816
- cadetblue: "5f9ea0",
817
- chartreuse: "7fff00",
818
- chocolate: "d2691e",
819
- coral: "ff7f50",
820
- cornflowerblue: "6495ed",
821
- cornsilk: "fff8dc",
822
- crimson: "dc143c",
823
- cyan: "0ff",
824
- darkblue: "00008b",
825
- darkcyan: "008b8b",
826
- darkgoldenrod: "b8860b",
827
- darkgray: "a9a9a9",
828
- darkgreen: "006400",
829
- darkgrey: "a9a9a9",
830
- darkkhaki: "bdb76b",
831
- darkmagenta: "8b008b",
832
- darkolivegreen: "556b2f",
833
- darkorange: "ff8c00",
834
- darkorchid: "9932cc",
835
- darkred: "8b0000",
836
- darksalmon: "e9967a",
837
- darkseagreen: "8fbc8f",
838
- darkslateblue: "483d8b",
839
- darkslategray: "2f4f4f",
840
- darkslategrey: "2f4f4f",
841
- darkturquoise: "00ced1",
842
- darkviolet: "9400d3",
843
- deeppink: "ff1493",
844
- deepskyblue: "00bfff",
845
- dimgray: "696969",
846
- dimgrey: "696969",
847
- dodgerblue: "1e90ff",
848
- firebrick: "b22222",
849
- floralwhite: "fffaf0",
850
- forestgreen: "228b22",
851
- fuchsia: "f0f",
852
- gainsboro: "dcdcdc",
853
- ghostwhite: "f8f8ff",
854
- gold: "ffd700",
855
- goldenrod: "daa520",
856
- gray: "808080",
857
- green: "008000",
858
- greenyellow: "adff2f",
859
- grey: "808080",
860
- honeydew: "f0fff0",
861
- hotpink: "ff69b4",
862
- indianred: "cd5c5c",
863
- indigo: "4b0082",
864
- ivory: "fffff0",
865
- khaki: "f0e68c",
866
- lavender: "e6e6fa",
867
- lavenderblush: "fff0f5",
868
- lawngreen: "7cfc00",
869
- lemonchiffon: "fffacd",
870
- lightblue: "add8e6",
871
- lightcoral: "f08080",
872
- lightcyan: "e0ffff",
873
- lightgoldenrodyellow: "fafad2",
874
- lightgray: "d3d3d3",
875
- lightgreen: "90ee90",
876
- lightgrey: "d3d3d3",
877
- lightpink: "ffb6c1",
878
- lightsalmon: "ffa07a",
879
- lightseagreen: "20b2aa",
880
- lightskyblue: "87cefa",
881
- lightslategray: "789",
882
- lightslategrey: "789",
883
- lightsteelblue: "b0c4de",
884
- lightyellow: "ffffe0",
885
- lime: "0f0",
886
- limegreen: "32cd32",
887
- linen: "faf0e6",
888
- magenta: "f0f",
889
- maroon: "800000",
890
- mediumaquamarine: "66cdaa",
891
- mediumblue: "0000cd",
892
- mediumorchid: "ba55d3",
893
- mediumpurple: "9370db",
894
- mediumseagreen: "3cb371",
895
- mediumslateblue: "7b68ee",
896
- mediumspringgreen: "00fa9a",
897
- mediumturquoise: "48d1cc",
898
- mediumvioletred: "c71585",
899
- midnightblue: "191970",
900
- mintcream: "f5fffa",
901
- mistyrose: "ffe4e1",
902
- moccasin: "ffe4b5",
903
- navajowhite: "ffdead",
904
- navy: "000080",
905
- oldlace: "fdf5e6",
906
- olive: "808000",
907
- olivedrab: "6b8e23",
908
- orange: "ffa500",
909
- orangered: "ff4500",
910
- orchid: "da70d6",
911
- palegoldenrod: "eee8aa",
912
- palegreen: "98fb98",
913
- paleturquoise: "afeeee",
914
- palevioletred: "db7093",
915
- papayawhip: "ffefd5",
916
- peachpuff: "ffdab9",
917
- peru: "cd853f",
918
- pink: "ffc0cb",
919
- plum: "dda0dd",
920
- powderblue: "b0e0e6",
921
- purple: "800080",
922
- rebeccapurple: "663399",
923
- red: "f00",
924
- rosybrown: "bc8f8f",
925
- royalblue: "4169e1",
926
- saddlebrown: "8b4513",
927
- salmon: "fa8072",
928
- sandybrown: "f4a460",
929
- seagreen: "2e8b57",
930
- seashell: "fff5ee",
931
- sienna: "a0522d",
932
- silver: "c0c0c0",
933
- skyblue: "87ceeb",
934
- slateblue: "6a5acd",
935
- slategray: "708090",
936
- slategrey: "708090",
937
- snow: "fffafa",
938
- springgreen: "00ff7f",
939
- steelblue: "4682b4",
940
- tan: "d2b48c",
941
- teal: "008080",
942
- thistle: "d8bfd8",
943
- tomato: "ff6347",
944
- turquoise: "40e0d0",
945
- violet: "ee82ee",
946
- wheat: "f5deb3",
947
- white: "fff",
948
- whitesmoke: "f5f5f5",
949
- yellow: "ff0",
950
- yellowgreen: "9acd32"
951
- };
952
-
953
- // Make it easy to access colors via hexNames[hex]
954
- var hexNames = tinycolor.hexNames = flip(names);
955
-
956
- // Utilities
957
- // ---------
958
-
959
- // { 'name1': 'val1' } becomes { 'val1': 'name1' }
960
- function flip(o) {
961
- var flipped = { };
962
- for (var i in o) {
963
- if (o.hasOwnProperty(i)) {
964
- flipped[o[i]] = i;
965
- }
966
- }
967
- return flipped;
968
- }
969
-
970
- // Return a valid alpha value [0,1] with all invalid values being set to 1
971
- function boundAlpha(a) {
972
- a = parseFloat(a);
973
-
974
- if (isNaN(a) || a < 0 || a > 1) {
975
- a = 1;
976
- }
977
-
978
- return a;
979
- }
980
-
981
- // Take input from [0, n] and return it as [0, 1]
982
- function bound01(n, max) {
983
- if (isOnePointZero(n)) { n = "100%"; }
984
-
985
- var processPercent = isPercentage(n);
986
- n = mathMin(max, mathMax(0, parseFloat(n)));
987
-
988
- // Automatically convert percentage into number
989
- if (processPercent) {
990
- n = parseInt(n * max, 10) / 100;
991
- }
992
-
993
- // Handle floating point rounding errors
994
- if ((Math.abs(n - max) < 0.000001)) {
995
- return 1;
996
- }
997
-
998
- // Convert into [0, 1] range if it isn't already
999
- return (n % max) / parseFloat(max);
1000
- }
1001
-
1002
- // Force a number between 0 and 1
1003
- function clamp01(val) {
1004
- return mathMin(1, mathMax(0, val));
1005
- }
1006
-
1007
- // Parse a base-16 hex value into a base-10 integer
1008
- function parseIntFromHex(val) {
1009
- return parseInt(val, 16);
1010
- }
1011
-
1012
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1013
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1014
- function isOnePointZero(n) {
1015
- return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
1016
- }
1017
-
1018
- // Check to see if string passed in is a percentage
1019
- function isPercentage(n) {
1020
- return typeof n === "string" && n.indexOf('%') != -1;
1021
- }
1022
-
1023
- // Force a hex value to have 2 characters
1024
- function pad2(c) {
1025
- return c.length == 1 ? '0' + c : '' + c;
1026
- }
1027
-
1028
- // Replace a decimal with it's percentage value
1029
- function convertToPercentage(n) {
1030
- if (n <= 1) {
1031
- n = (n * 100) + "%";
1032
- }
1033
-
1034
- return n;
1035
- }
1036
-
1037
- // Converts a decimal to a hex value
1038
- function convertDecimalToHex(d) {
1039
- return Math.round(parseFloat(d) * 255).toString(16);
1040
- }
1041
- // Converts a hex value to a decimal
1042
- function convertHexToDecimal(h) {
1043
- return (parseIntFromHex(h) / 255);
1044
- }
1045
-
1046
- var matchers = (function() {
1047
-
1048
- // <http://www.w3.org/TR/css3-values/#integers>
1049
- var CSS_INTEGER = "[-\\+]?\\d+%?";
1050
-
1051
- // <http://www.w3.org/TR/css3-values/#number-value>
1052
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1053
-
1054
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1055
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1056
-
1057
- // Actual matching.
1058
- // Parentheses and commas are optional, but not required.
1059
- // Whitespace can take the place of commas or opening paren
1060
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1061
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1062
-
1063
- return {
1064
- CSS_UNIT: new RegExp(CSS_UNIT),
1065
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1066
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1067
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1068
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1069
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1070
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1071
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1072
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1073
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1074
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
1075
- };
1076
- })();
1077
-
1078
- // isValidCSSUnit
1079
- // Take in a single string / number and check to see if it looks like a CSS unit
1080
- // (see matchers above for definition).
1081
- function isValidCSSUnit(color) {
1082
- return !!matchers.CSS_UNIT.exec(color);
1083
- }
1084
-
1085
- // stringInputToObject
1086
- // Permissive string parsing. Take in a number of formats, and output an object
1087
- // based on detected format. Returns { r, g, b } or { h, s, l } or { h, s, v}
1088
- function stringInputToObject(color) {
1089
-
1090
- color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase();
1091
- var named = false;
1092
- if (names[color]) {
1093
- color = names[color];
1094
- named = true;
1095
- }
1096
- else if (color == 'transparent') {
1097
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
1098
- }
1099
-
1100
- // Try to match string input using regular expressions.
1101
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1102
- // Just return an object and let the conversion functions handle that.
1103
- // This way the result will be the same whether the tinycolor is initialized with string or object.
1104
- var match;
1105
- if ((match = matchers.rgb.exec(color))) {
1106
- return { r: match[1], g: match[2], b: match[3] };
1107
- }
1108
- if ((match = matchers.rgba.exec(color))) {
1109
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
1110
- }
1111
- if ((match = matchers.hsl.exec(color))) {
1112
- return { h: match[1], s: match[2], l: match[3] };
1113
- }
1114
- if ((match = matchers.hsla.exec(color))) {
1115
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
1116
- }
1117
- if ((match = matchers.hsv.exec(color))) {
1118
- return { h: match[1], s: match[2], v: match[3] };
1119
- }
1120
- if ((match = matchers.hsva.exec(color))) {
1121
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
1122
- }
1123
- if ((match = matchers.hex8.exec(color))) {
1124
- return {
1125
- r: parseIntFromHex(match[1]),
1126
- g: parseIntFromHex(match[2]),
1127
- b: parseIntFromHex(match[3]),
1128
- a: convertHexToDecimal(match[4]),
1129
- format: named ? "name" : "hex8"
1130
- };
1131
- }
1132
- if ((match = matchers.hex6.exec(color))) {
1133
- return {
1134
- r: parseIntFromHex(match[1]),
1135
- g: parseIntFromHex(match[2]),
1136
- b: parseIntFromHex(match[3]),
1137
- format: named ? "name" : "hex"
1138
- };
1139
- }
1140
- if ((match = matchers.hex4.exec(color))) {
1141
- return {
1142
- r: parseIntFromHex(match[1] + '' + match[1]),
1143
- g: parseIntFromHex(match[2] + '' + match[2]),
1144
- b: parseIntFromHex(match[3] + '' + match[3]),
1145
- a: convertHexToDecimal(match[4] + '' + match[4]),
1146
- format: named ? "name" : "hex8"
1147
- };
1148
- }
1149
- if ((match = matchers.hex3.exec(color))) {
1150
- return {
1151
- r: parseIntFromHex(match[1] + '' + match[1]),
1152
- g: parseIntFromHex(match[2] + '' + match[2]),
1153
- b: parseIntFromHex(match[3] + '' + match[3]),
1154
- format: named ? "name" : "hex"
1155
- };
1156
- }
1157
-
1158
- return false;
1159
- }
1160
-
1161
- function validateWCAG2Parms(parms) {
1162
- // return valid WCAG2 parms for isReadable.
1163
- // If input parms are invalid, return {"level":"AA", "size":"small"}
1164
- var level, size;
1165
- parms = parms || {"level":"AA", "size":"small"};
1166
- level = (parms.level || "AA").toUpperCase();
1167
- size = (parms.size || "small").toLowerCase();
1168
- if (level !== "AA" && level !== "AAA") {
1169
- level = "AA";
1170
- }
1171
- if (size !== "small" && size !== "large") {
1172
- size = "small";
1173
- }
1174
- return {"level":level, "size":size};
1175
- }
1176
-
1177
- this.tinycolor = tinycolor;
1178
-
1179
- })()`;
1180
- }
1181
- // It is hacky way to make this function will be compiled preferentially by less
1182
- // resolve error: `ReferenceError: colorPalette is not defined`
1183
- // https://github.com/ant-design/ant-motion/issues/44
1184
- .tinyColorMixin();
1
+ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2
+ .tinyColorMixin() {
3
+ @functions: ~`(function() {
4
+ // TinyColor v1.4.1
5
+ // https://github.com/bgrins/TinyColor
6
+ // 2016-07-07, Brian Grinstead, MIT License
7
+ var trimLeft = /^\s+/,
8
+ trimRight = /\s+$/,
9
+ tinyCounter = 0,
10
+ mathRound = Math.round,
11
+ mathMin = Math.min,
12
+ mathMax = Math.max,
13
+ mathRandom = Math.random;
14
+
15
+ function tinycolor (color, opts) {
16
+
17
+ color = (color) ? color : '';
18
+ opts = opts || { };
19
+
20
+ // If input is already a tinycolor, return itself
21
+ if (color instanceof tinycolor) {
22
+ return color;
23
+ }
24
+ // If we are called as a function, call using new instead
25
+ if (!(this instanceof tinycolor)) {
26
+ return new tinycolor(color, opts);
27
+ }
28
+
29
+ var rgb = inputToRGB(color);
30
+ this._originalInput = color,
31
+ this._r = rgb.r,
32
+ this._g = rgb.g,
33
+ this._b = rgb.b,
34
+ this._a = rgb.a,
35
+ this._roundA = mathRound(100*this._a) / 100,
36
+ this._format = opts.format || rgb.format;
37
+ this._gradientType = opts.gradientType;
38
+
39
+ // Don't let the range of [0,255] come back in [0,1].
40
+ // Potentially lose a little bit of precision here, but will fix issues where
41
+ // .5 gets interpreted as half of the total, instead of half of 1
42
+ // If it was supposed to be 128, this was already taken care of by inputToRgb
43
+ if (this._r < 1) { this._r = mathRound(this._r); }
44
+ if (this._g < 1) { this._g = mathRound(this._g); }
45
+ if (this._b < 1) { this._b = mathRound(this._b); }
46
+
47
+ this._ok = rgb.ok;
48
+ this._tc_id = tinyCounter++;
49
+ }
50
+
51
+ tinycolor.prototype = {
52
+ isDark: function() {
53
+ return this.getBrightness() < 128;
54
+ },
55
+ isLight: function() {
56
+ return !this.isDark();
57
+ },
58
+ isValid: function() {
59
+ return this._ok;
60
+ },
61
+ getOriginalInput: function() {
62
+ return this._originalInput;
63
+ },
64
+ getFormat: function() {
65
+ return this._format;
66
+ },
67
+ getAlpha: function() {
68
+ return this._a;
69
+ },
70
+ getBrightness: function() {
71
+ //http://www.w3.org/TR/AERT#color-contrast
72
+ var rgb = this.toRgb();
73
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
74
+ },
75
+ getLuminance: function() {
76
+ //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
77
+ var rgb = this.toRgb();
78
+ var RsRGB, GsRGB, BsRGB, R, G, B;
79
+ RsRGB = rgb.r/255;
80
+ GsRGB = rgb.g/255;
81
+ BsRGB = rgb.b/255;
82
+
83
+ if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
84
+ if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
85
+ if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
86
+ return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
87
+ },
88
+ setAlpha: function(value) {
89
+ this._a = boundAlpha(value);
90
+ this._roundA = mathRound(100*this._a) / 100;
91
+ return this;
92
+ },
93
+ toHsv: function() {
94
+ var hsv = rgbToHsv(this._r, this._g, this._b);
95
+ return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
96
+ },
97
+ toHsvString: function() {
98
+ var hsv = rgbToHsv(this._r, this._g, this._b);
99
+ var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
100
+ return (this._a == 1) ?
101
+ "hsv(" + h + ", " + s + "%, " + v + "%)" :
102
+ "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
103
+ },
104
+ toHsl: function() {
105
+ var hsl = rgbToHsl(this._r, this._g, this._b);
106
+ return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
107
+ },
108
+ toHslString: function() {
109
+ var hsl = rgbToHsl(this._r, this._g, this._b);
110
+ var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
111
+ return (this._a == 1) ?
112
+ "hsl(" + h + ", " + s + "%, " + l + "%)" :
113
+ "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
114
+ },
115
+ toHex: function(allow3Char) {
116
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
117
+ },
118
+ toHexString: function(allow3Char) {
119
+ return '#' + this.toHex(allow3Char);
120
+ },
121
+ toHex8: function(allow4Char) {
122
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
123
+ },
124
+ toHex8String: function(allow4Char) {
125
+ return '#' + this.toHex8(allow4Char);
126
+ },
127
+ toRgb: function() {
128
+ return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
129
+ },
130
+ toRgbString: function() {
131
+ return (this._a == 1) ?
132
+ "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
133
+ "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
134
+ },
135
+ toPercentageRgb: function() {
136
+ return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
137
+ },
138
+ toPercentageRgbString: function() {
139
+ return (this._a == 1) ?
140
+ "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
141
+ "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
142
+ },
143
+ toName: function() {
144
+ if (this._a === 0) {
145
+ return "transparent";
146
+ }
147
+
148
+ if (this._a < 1) {
149
+ return false;
150
+ }
151
+
152
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
153
+ },
154
+ toFilter: function(secondColor) {
155
+ var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
156
+ var secondHex8String = hex8String;
157
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
158
+
159
+ if (secondColor) {
160
+ var s = tinycolor(secondColor);
161
+ secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
162
+ }
163
+
164
+ return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
165
+ },
166
+ toString: function(format) {
167
+ var formatSet = !!format;
168
+ format = format || this._format;
169
+
170
+ var formattedString = false;
171
+ var hasAlpha = this._a < 1 && this._a >= 0;
172
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
173
+
174
+ if (needsAlphaFormat) {
175
+ // Special case for "transparent", all other non-alpha formats
176
+ // will return rgba when there is transparency.
177
+ if (format === "name" && this._a === 0) {
178
+ return this.toName();
179
+ }
180
+ return this.toRgbString();
181
+ }
182
+ if (format === "rgb") {
183
+ formattedString = this.toRgbString();
184
+ }
185
+ if (format === "prgb") {
186
+ formattedString = this.toPercentageRgbString();
187
+ }
188
+ if (format === "hex" || format === "hex6") {
189
+ formattedString = this.toHexString();
190
+ }
191
+ if (format === "hex3") {
192
+ formattedString = this.toHexString(true);
193
+ }
194
+ if (format === "hex4") {
195
+ formattedString = this.toHex8String(true);
196
+ }
197
+ if (format === "hex8") {
198
+ formattedString = this.toHex8String();
199
+ }
200
+ if (format === "name") {
201
+ formattedString = this.toName();
202
+ }
203
+ if (format === "hsl") {
204
+ formattedString = this.toHslString();
205
+ }
206
+ if (format === "hsv") {
207
+ formattedString = this.toHsvString();
208
+ }
209
+
210
+ return formattedString || this.toHexString();
211
+ },
212
+ clone: function() {
213
+ return tinycolor(this.toString());
214
+ },
215
+
216
+ _applyModification: function(fn, args) {
217
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
218
+ this._r = color._r;
219
+ this._g = color._g;
220
+ this._b = color._b;
221
+ this.setAlpha(color._a);
222
+ return this;
223
+ },
224
+ lighten: function() {
225
+ return this._applyModification(lighten, arguments);
226
+ },
227
+ brighten: function() {
228
+ return this._applyModification(brighten, arguments);
229
+ },
230
+ darken: function() {
231
+ return this._applyModification(darken, arguments);
232
+ },
233
+ desaturate: function() {
234
+ return this._applyModification(desaturate, arguments);
235
+ },
236
+ saturate: function() {
237
+ return this._applyModification(saturate, arguments);
238
+ },
239
+ greyscale: function() {
240
+ return this._applyModification(greyscale, arguments);
241
+ },
242
+ spin: function() {
243
+ return this._applyModification(spin, arguments);
244
+ },
245
+
246
+ _applyCombination: function(fn, args) {
247
+ return fn.apply(null, [this].concat([].slice.call(args)));
248
+ },
249
+ analogous: function() {
250
+ return this._applyCombination(analogous, arguments);
251
+ },
252
+ complement: function() {
253
+ return this._applyCombination(complement, arguments);
254
+ },
255
+ monochromatic: function() {
256
+ return this._applyCombination(monochromatic, arguments);
257
+ },
258
+ splitcomplement: function() {
259
+ return this._applyCombination(splitcomplement, arguments);
260
+ },
261
+ triad: function() {
262
+ return this._applyCombination(triad, arguments);
263
+ },
264
+ tetrad: function() {
265
+ return this._applyCombination(tetrad, arguments);
266
+ }
267
+ };
268
+
269
+ // If input is an object, force 1 into "1.0" to handle ratios properly
270
+ // String input requires "1.0" as input, so 1 will be treated as 1
271
+ tinycolor.fromRatio = function(color, opts) {
272
+ if (typeof color == "object") {
273
+ var newColor = {};
274
+ for (var i in color) {
275
+ if (color.hasOwnProperty(i)) {
276
+ if (i === "a") {
277
+ newColor[i] = color[i];
278
+ }
279
+ else {
280
+ newColor[i] = convertToPercentage(color[i]);
281
+ }
282
+ }
283
+ }
284
+ color = newColor;
285
+ }
286
+
287
+ return tinycolor(color, opts);
288
+ };
289
+
290
+ // Given a string or object, convert that input to RGB
291
+ // Possible string inputs:
292
+ //
293
+ // "red"
294
+ // "#f00" or "f00"
295
+ // "#ff0000" or "ff0000"
296
+ // "#ff000000" or "ff000000"
297
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
298
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
299
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
300
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
301
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
302
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
303
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
304
+ //
305
+ function inputToRGB(color) {
306
+
307
+ var rgb = { r: 0, g: 0, b: 0 };
308
+ var a = 1;
309
+ var s = null;
310
+ var v = null;
311
+ var l = null;
312
+ var ok = false;
313
+ var format = false;
314
+
315
+ if (typeof color == "string") {
316
+ color = stringInputToObject(color);
317
+ }
318
+
319
+ if (typeof color == "object") {
320
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
321
+ rgb = rgbToRgb(color.r, color.g, color.b);
322
+ ok = true;
323
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
324
+ }
325
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
326
+ s = convertToPercentage(color.s);
327
+ v = convertToPercentage(color.v);
328
+ rgb = hsvToRgb(color.h, s, v);
329
+ ok = true;
330
+ format = "hsv";
331
+ }
332
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
333
+ s = convertToPercentage(color.s);
334
+ l = convertToPercentage(color.l);
335
+ rgb = hslToRgb(color.h, s, l);
336
+ ok = true;
337
+ format = "hsl";
338
+ }
339
+
340
+ if (color.hasOwnProperty("a")) {
341
+ a = color.a;
342
+ }
343
+ }
344
+
345
+ a = boundAlpha(a);
346
+
347
+ return {
348
+ ok: ok,
349
+ format: color.format || format,
350
+ r: mathMin(255, mathMax(rgb.r, 0)),
351
+ g: mathMin(255, mathMax(rgb.g, 0)),
352
+ b: mathMin(255, mathMax(rgb.b, 0)),
353
+ a: a
354
+ };
355
+ }
356
+
357
+ // Conversion Functions
358
+ // --------------------
359
+
360
+ // rgbToHsl, rgbToHsv, hslToRgb, hsvToRgb modified from:
361
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
362
+
363
+ // rgbToRgb
364
+ // Handle bounds / percentage checking to conform to CSS color spec
365
+ // <http://www.w3.org/TR/css3-color/>
366
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
367
+ // *Returns:* { r, g, b } in [0, 255]
368
+ function rgbToRgb(r, g, b){
369
+ return {
370
+ r: bound01(r, 255) * 255,
371
+ g: bound01(g, 255) * 255,
372
+ b: bound01(b, 255) * 255
373
+ };
374
+ }
375
+
376
+ // rgbToHsl
377
+ // Converts an RGB color value to HSL.
378
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
379
+ // *Returns:* { h, s, l } in [0,1]
380
+ function rgbToHsl(r, g, b) {
381
+
382
+ r = bound01(r, 255);
383
+ g = bound01(g, 255);
384
+ b = bound01(b, 255);
385
+
386
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
387
+ var h, s, l = (max + min) / 2;
388
+
389
+ if(max == min) {
390
+ h = s = 0; // achromatic
391
+ }
392
+ else {
393
+ var d = max - min;
394
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
395
+ switch(max) {
396
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
397
+ case g: h = (b - r) / d + 2; break;
398
+ case b: h = (r - g) / d + 4; break;
399
+ }
400
+
401
+ h /= 6;
402
+ }
403
+
404
+ return { h: h, s: s, l: l };
405
+ }
406
+
407
+ // hslToRgb
408
+ // Converts an HSL color value to RGB.
409
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
410
+ // *Returns:* { r, g, b } in the set [0, 255]
411
+ function hslToRgb(h, s, l) {
412
+ var r, g, b;
413
+
414
+ h = bound01(h, 360);
415
+ s = bound01(s, 100);
416
+ l = bound01(l, 100);
417
+
418
+ function hue2rgb(p, q, t) {
419
+ if(t < 0) t += 1;
420
+ if(t > 1) t -= 1;
421
+ if(t < 1/6) return p + (q - p) * 6 * t;
422
+ if(t < 1/2) return q;
423
+ if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
424
+ return p;
425
+ }
426
+
427
+ if(s === 0) {
428
+ r = g = b = l; // achromatic
429
+ }
430
+ else {
431
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
432
+ var p = 2 * l - q;
433
+ r = hue2rgb(p, q, h + 1/3);
434
+ g = hue2rgb(p, q, h);
435
+ b = hue2rgb(p, q, h - 1/3);
436
+ }
437
+
438
+ return { r: r * 255, g: g * 255, b: b * 255 };
439
+ }
440
+
441
+ // rgbToHsv
442
+ // Converts an RGB color value to HSV
443
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
444
+ // *Returns:* { h, s, v } in [0,1]
445
+ function rgbToHsv(r, g, b) {
446
+
447
+ r = bound01(r, 255);
448
+ g = bound01(g, 255);
449
+ b = bound01(b, 255);
450
+
451
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
452
+ var h, s, v = max;
453
+
454
+ var d = max - min;
455
+ s = max === 0 ? 0 : d / max;
456
+
457
+ if(max == min) {
458
+ h = 0; // achromatic
459
+ }
460
+ else {
461
+ switch(max) {
462
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
463
+ case g: h = (b - r) / d + 2; break;
464
+ case b: h = (r - g) / d + 4; break;
465
+ }
466
+ h /= 6;
467
+ }
468
+ return { h: h, s: s, v: v };
469
+ }
470
+
471
+ // hsvToRgb
472
+ // Converts an HSV color value to RGB.
473
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
474
+ // *Returns:* { r, g, b } in the set [0, 255]
475
+ function hsvToRgb(h, s, v) {
476
+
477
+ h = bound01(h, 360) * 6;
478
+ s = bound01(s, 100);
479
+ v = bound01(v, 100);
480
+
481
+ var i = Math.floor(h),
482
+ f = h - i,
483
+ p = v * (1 - s),
484
+ q = v * (1 - f * s),
485
+ t = v * (1 - (1 - f) * s),
486
+ mod = i % 6,
487
+ r = [v, q, p, p, t, v][mod],
488
+ g = [t, v, v, q, p, p][mod],
489
+ b = [p, p, t, v, v, q][mod];
490
+
491
+ return { r: r * 255, g: g * 255, b: b * 255 };
492
+ }
493
+
494
+ // rgbToHex
495
+ // Converts an RGB color to hex
496
+ // Assumes r, g, and b are contained in the set [0, 255]
497
+ // Returns a 3 or 6 character hex
498
+ function rgbToHex(r, g, b, allow3Char) {
499
+
500
+ var hex = [
501
+ pad2(mathRound(r).toString(16)),
502
+ pad2(mathRound(g).toString(16)),
503
+ pad2(mathRound(b).toString(16))
504
+ ];
505
+
506
+ // Return a 3 character hex if possible
507
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
508
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
509
+ }
510
+
511
+ return hex.join("");
512
+ }
513
+
514
+ // rgbaToHex
515
+ // Converts an RGBA color plus alpha transparency to hex
516
+ // Assumes r, g, b are contained in the set [0, 255] and
517
+ // a in [0, 1]. Returns a 4 or 8 character rgba hex
518
+ function rgbaToHex(r, g, b, a, allow4Char) {
519
+
520
+ var hex = [
521
+ pad2(mathRound(r).toString(16)),
522
+ pad2(mathRound(g).toString(16)),
523
+ pad2(mathRound(b).toString(16)),
524
+ pad2(convertDecimalToHex(a))
525
+ ];
526
+
527
+ // Return a 4 character hex if possible
528
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
529
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
530
+ }
531
+
532
+ return hex.join("");
533
+ }
534
+
535
+ // rgbaToArgbHex
536
+ // Converts an RGBA color to an ARGB Hex8 string
537
+ // Rarely used, but required for "toFilter()"
538
+ function rgbaToArgbHex(r, g, b, a) {
539
+
540
+ var hex = [
541
+ pad2(convertDecimalToHex(a)),
542
+ pad2(mathRound(r).toString(16)),
543
+ pad2(mathRound(g).toString(16)),
544
+ pad2(mathRound(b).toString(16))
545
+ ];
546
+
547
+ return hex.join("");
548
+ }
549
+
550
+ // equals
551
+ // Can be called with any tinycolor input
552
+ tinycolor.equals = function (color1, color2) {
553
+ if (!color1 || !color2) { return false; }
554
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
555
+ };
556
+
557
+ tinycolor.random = function() {
558
+ return tinycolor.fromRatio({
559
+ r: mathRandom(),
560
+ g: mathRandom(),
561
+ b: mathRandom()
562
+ });
563
+ };
564
+
565
+ // Modification Functions
566
+ // ----------------------
567
+ // Thanks to less.js for some of the basics here
568
+ // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
569
+
570
+ function desaturate(color, amount) {
571
+ amount = (amount === 0) ? 0 : (amount || 10);
572
+ var hsl = tinycolor(color).toHsl();
573
+ hsl.s -= amount / 100;
574
+ hsl.s = clamp01(hsl.s);
575
+ return tinycolor(hsl);
576
+ }
577
+
578
+ function saturate(color, amount) {
579
+ amount = (amount === 0) ? 0 : (amount || 10);
580
+ var hsl = tinycolor(color).toHsl();
581
+ hsl.s += amount / 100;
582
+ hsl.s = clamp01(hsl.s);
583
+ return tinycolor(hsl);
584
+ }
585
+
586
+ function greyscale(color) {
587
+ return tinycolor(color).desaturate(100);
588
+ }
589
+
590
+ function lighten (color, amount) {
591
+ amount = (amount === 0) ? 0 : (amount || 10);
592
+ var hsl = tinycolor(color).toHsl();
593
+ hsl.l += amount / 100;
594
+ hsl.l = clamp01(hsl.l);
595
+ return tinycolor(hsl);
596
+ }
597
+
598
+ function brighten(color, amount) {
599
+ amount = (amount === 0) ? 0 : (amount || 10);
600
+ var rgb = tinycolor(color).toRgb();
601
+ rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
602
+ rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
603
+ rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
604
+ return tinycolor(rgb);
605
+ }
606
+
607
+ function darken (color, amount) {
608
+ amount = (amount === 0) ? 0 : (amount || 10);
609
+ var hsl = tinycolor(color).toHsl();
610
+ hsl.l -= amount / 100;
611
+ hsl.l = clamp01(hsl.l);
612
+ return tinycolor(hsl);
613
+ }
614
+
615
+ // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
616
+ // Values outside of this range will be wrapped into this range.
617
+ function spin(color, amount) {
618
+ var hsl = tinycolor(color).toHsl();
619
+ var hue = (hsl.h + amount) % 360;
620
+ hsl.h = hue < 0 ? 360 + hue : hue;
621
+ return tinycolor(hsl);
622
+ }
623
+
624
+ // Combination Functions
625
+ // ---------------------
626
+ // Thanks to jQuery xColor for some of the ideas behind these
627
+ // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
628
+
629
+ function complement(color) {
630
+ var hsl = tinycolor(color).toHsl();
631
+ hsl.h = (hsl.h + 180) % 360;
632
+ return tinycolor(hsl);
633
+ }
634
+
635
+ function triad(color) {
636
+ var hsl = tinycolor(color).toHsl();
637
+ var h = hsl.h;
638
+ return [
639
+ tinycolor(color),
640
+ tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
641
+ tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
642
+ ];
643
+ }
644
+
645
+ function tetrad(color) {
646
+ var hsl = tinycolor(color).toHsl();
647
+ var h = hsl.h;
648
+ return [
649
+ tinycolor(color),
650
+ tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
651
+ tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
652
+ tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
653
+ ];
654
+ }
655
+
656
+ function splitcomplement(color) {
657
+ var hsl = tinycolor(color).toHsl();
658
+ var h = hsl.h;
659
+ return [
660
+ tinycolor(color),
661
+ tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
662
+ tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
663
+ ];
664
+ }
665
+
666
+ function analogous(color, results, slices) {
667
+ results = results || 6;
668
+ slices = slices || 30;
669
+
670
+ var hsl = tinycolor(color).toHsl();
671
+ var part = 360 / slices;
672
+ var ret = [tinycolor(color)];
673
+
674
+ for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
675
+ hsl.h = (hsl.h + part) % 360;
676
+ ret.push(tinycolor(hsl));
677
+ }
678
+ return ret;
679
+ }
680
+
681
+ function monochromatic(color, results) {
682
+ results = results || 6;
683
+ var hsv = tinycolor(color).toHsv();
684
+ var h = hsv.h, s = hsv.s, v = hsv.v;
685
+ var ret = [];
686
+ var modification = 1 / results;
687
+
688
+ while (results--) {
689
+ ret.push(tinycolor({ h: h, s: s, v: v}));
690
+ v = (v + modification) % 1;
691
+ }
692
+
693
+ return ret;
694
+ }
695
+
696
+ // Utility Functions
697
+ // ---------------------
698
+
699
+ tinycolor.mix = function(color1, color2, amount) {
700
+ amount = (amount === 0) ? 0 : (amount || 50);
701
+
702
+ var rgb1 = tinycolor(color1).toRgb();
703
+ var rgb2 = tinycolor(color2).toRgb();
704
+
705
+ var p = amount / 100;
706
+
707
+ var rgba = {
708
+ r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
709
+ g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
710
+ b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
711
+ a: ((rgb2.a - rgb1.a) * p) + rgb1.a
712
+ };
713
+
714
+ return tinycolor(rgba);
715
+ };
716
+
717
+ // Readability Functions
718
+ // ---------------------
719
+ // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
720
+
721
+ // contrast
722
+ // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
723
+ tinycolor.readability = function(color1, color2) {
724
+ var c1 = tinycolor(color1);
725
+ var c2 = tinycolor(color2);
726
+ return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
727
+ };
728
+
729
+ // isReadable
730
+ // Ensure that foreground and background color combinations meet WCAG2 guidelines.
731
+ // The third argument is an optional Object.
732
+ // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
733
+ // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
734
+ // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
735
+
736
+ // *Example*
737
+ // tinycolor.isReadable("#000", "#111") => false
738
+ // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
739
+ tinycolor.isReadable = function(color1, color2, wcag2) {
740
+ var readability = tinycolor.readability(color1, color2);
741
+ var wcag2Parms, out;
742
+
743
+ out = false;
744
+
745
+ wcag2Parms = validateWCAG2Parms(wcag2);
746
+ switch (wcag2Parms.level + wcag2Parms.size) {
747
+ case "AAsmall":
748
+ case "AAAlarge":
749
+ out = readability >= 4.5;
750
+ break;
751
+ case "AAlarge":
752
+ out = readability >= 3;
753
+ break;
754
+ case "AAAsmall":
755
+ out = readability >= 7;
756
+ break;
757
+ }
758
+ return out;
759
+
760
+ };
761
+
762
+ // mostReadable
763
+ // Given a base color and a list of possible foreground or background
764
+ // colors for that base, returns the most readable color.
765
+ // Optionally returns Black or White if the most readable color is unreadable.
766
+ // *Example*
767
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
768
+ // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
769
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
770
+ // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
771
+ tinycolor.mostReadable = function(baseColor, colorList, args) {
772
+ var bestColor = null;
773
+ var bestScore = 0;
774
+ var readability;
775
+ var includeFallbackColors, level, size ;
776
+ args = args || {};
777
+ includeFallbackColors = args.includeFallbackColors ;
778
+ level = args.level;
779
+ size = args.size;
780
+
781
+ for (var i= 0; i < colorList.length ; i++) {
782
+ readability = tinycolor.readability(baseColor, colorList[i]);
783
+ if (readability > bestScore) {
784
+ bestScore = readability;
785
+ bestColor = tinycolor(colorList[i]);
786
+ }
787
+ }
788
+
789
+ if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
790
+ return bestColor;
791
+ }
792
+ else {
793
+ args.includeFallbackColors=false;
794
+ return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
795
+ }
796
+ };
797
+
798
+ // Big List of Colors
799
+ // ------------------
800
+ // <http://www.w3.org/TR/css3-color/#svg-color>
801
+ var names = tinycolor.names = {
802
+ aliceblue: "f0f8ff",
803
+ antiquewhite: "faebd7",
804
+ aqua: "0ff",
805
+ aquamarine: "7fffd4",
806
+ azure: "f0ffff",
807
+ beige: "f5f5dc",
808
+ bisque: "ffe4c4",
809
+ black: "000",
810
+ blanchedalmond: "ffebcd",
811
+ blue: "00f",
812
+ blueviolet: "8a2be2",
813
+ brown: "a52a2a",
814
+ burlywood: "deb887",
815
+ burntsienna: "ea7e5d",
816
+ cadetblue: "5f9ea0",
817
+ chartreuse: "7fff00",
818
+ chocolate: "d2691e",
819
+ coral: "ff7f50",
820
+ cornflowerblue: "6495ed",
821
+ cornsilk: "fff8dc",
822
+ crimson: "dc143c",
823
+ cyan: "0ff",
824
+ darkblue: "00008b",
825
+ darkcyan: "008b8b",
826
+ darkgoldenrod: "b8860b",
827
+ darkgray: "a9a9a9",
828
+ darkgreen: "006400",
829
+ darkgrey: "a9a9a9",
830
+ darkkhaki: "bdb76b",
831
+ darkmagenta: "8b008b",
832
+ darkolivegreen: "556b2f",
833
+ darkorange: "ff8c00",
834
+ darkorchid: "9932cc",
835
+ darkred: "8b0000",
836
+ darksalmon: "e9967a",
837
+ darkseagreen: "8fbc8f",
838
+ darkslateblue: "483d8b",
839
+ darkslategray: "2f4f4f",
840
+ darkslategrey: "2f4f4f",
841
+ darkturquoise: "00ced1",
842
+ darkviolet: "9400d3",
843
+ deeppink: "ff1493",
844
+ deepskyblue: "00bfff",
845
+ dimgray: "696969",
846
+ dimgrey: "696969",
847
+ dodgerblue: "1e90ff",
848
+ firebrick: "b22222",
849
+ floralwhite: "fffaf0",
850
+ forestgreen: "228b22",
851
+ fuchsia: "f0f",
852
+ gainsboro: "dcdcdc",
853
+ ghostwhite: "f8f8ff",
854
+ gold: "ffd700",
855
+ goldenrod: "daa520",
856
+ gray: "808080",
857
+ green: "008000",
858
+ greenyellow: "adff2f",
859
+ grey: "808080",
860
+ honeydew: "f0fff0",
861
+ hotpink: "ff69b4",
862
+ indianred: "cd5c5c",
863
+ indigo: "4b0082",
864
+ ivory: "fffff0",
865
+ khaki: "f0e68c",
866
+ lavender: "e6e6fa",
867
+ lavenderblush: "fff0f5",
868
+ lawngreen: "7cfc00",
869
+ lemonchiffon: "fffacd",
870
+ lightblue: "add8e6",
871
+ lightcoral: "f08080",
872
+ lightcyan: "e0ffff",
873
+ lightgoldenrodyellow: "fafad2",
874
+ lightgray: "d3d3d3",
875
+ lightgreen: "90ee90",
876
+ lightgrey: "d3d3d3",
877
+ lightpink: "ffb6c1",
878
+ lightsalmon: "ffa07a",
879
+ lightseagreen: "20b2aa",
880
+ lightskyblue: "87cefa",
881
+ lightslategray: "789",
882
+ lightslategrey: "789",
883
+ lightsteelblue: "b0c4de",
884
+ lightyellow: "ffffe0",
885
+ lime: "0f0",
886
+ limegreen: "32cd32",
887
+ linen: "faf0e6",
888
+ magenta: "f0f",
889
+ maroon: "800000",
890
+ mediumaquamarine: "66cdaa",
891
+ mediumblue: "0000cd",
892
+ mediumorchid: "ba55d3",
893
+ mediumpurple: "9370db",
894
+ mediumseagreen: "3cb371",
895
+ mediumslateblue: "7b68ee",
896
+ mediumspringgreen: "00fa9a",
897
+ mediumturquoise: "48d1cc",
898
+ mediumvioletred: "c71585",
899
+ midnightblue: "191970",
900
+ mintcream: "f5fffa",
901
+ mistyrose: "ffe4e1",
902
+ moccasin: "ffe4b5",
903
+ navajowhite: "ffdead",
904
+ navy: "000080",
905
+ oldlace: "fdf5e6",
906
+ olive: "808000",
907
+ olivedrab: "6b8e23",
908
+ orange: "ffa500",
909
+ orangered: "ff4500",
910
+ orchid: "da70d6",
911
+ palegoldenrod: "eee8aa",
912
+ palegreen: "98fb98",
913
+ paleturquoise: "afeeee",
914
+ palevioletred: "db7093",
915
+ papayawhip: "ffefd5",
916
+ peachpuff: "ffdab9",
917
+ peru: "cd853f",
918
+ pink: "ffc0cb",
919
+ plum: "dda0dd",
920
+ powderblue: "b0e0e6",
921
+ purple: "800080",
922
+ rebeccapurple: "663399",
923
+ red: "f00",
924
+ rosybrown: "bc8f8f",
925
+ royalblue: "4169e1",
926
+ saddlebrown: "8b4513",
927
+ salmon: "fa8072",
928
+ sandybrown: "f4a460",
929
+ seagreen: "2e8b57",
930
+ seashell: "fff5ee",
931
+ sienna: "a0522d",
932
+ silver: "c0c0c0",
933
+ skyblue: "87ceeb",
934
+ slateblue: "6a5acd",
935
+ slategray: "708090",
936
+ slategrey: "708090",
937
+ snow: "fffafa",
938
+ springgreen: "00ff7f",
939
+ steelblue: "4682b4",
940
+ tan: "d2b48c",
941
+ teal: "008080",
942
+ thistle: "d8bfd8",
943
+ tomato: "ff6347",
944
+ turquoise: "40e0d0",
945
+ violet: "ee82ee",
946
+ wheat: "f5deb3",
947
+ white: "fff",
948
+ whitesmoke: "f5f5f5",
949
+ yellow: "ff0",
950
+ yellowgreen: "9acd32"
951
+ };
952
+
953
+ // Make it easy to access colors via hexNames[hex]
954
+ var hexNames = tinycolor.hexNames = flip(names);
955
+
956
+ // Utilities
957
+ // ---------
958
+
959
+ // { 'name1': 'val1' } becomes { 'val1': 'name1' }
960
+ function flip(o) {
961
+ var flipped = { };
962
+ for (var i in o) {
963
+ if (o.hasOwnProperty(i)) {
964
+ flipped[o[i]] = i;
965
+ }
966
+ }
967
+ return flipped;
968
+ }
969
+
970
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
971
+ function boundAlpha(a) {
972
+ a = parseFloat(a);
973
+
974
+ if (isNaN(a) || a < 0 || a > 1) {
975
+ a = 1;
976
+ }
977
+
978
+ return a;
979
+ }
980
+
981
+ // Take input from [0, n] and return it as [0, 1]
982
+ function bound01(n, max) {
983
+ if (isOnePointZero(n)) { n = "100%"; }
984
+
985
+ var processPercent = isPercentage(n);
986
+ n = mathMin(max, mathMax(0, parseFloat(n)));
987
+
988
+ // Automatically convert percentage into number
989
+ if (processPercent) {
990
+ n = parseInt(n * max, 10) / 100;
991
+ }
992
+
993
+ // Handle floating point rounding errors
994
+ if ((Math.abs(n - max) < 0.000001)) {
995
+ return 1;
996
+ }
997
+
998
+ // Convert into [0, 1] range if it isn't already
999
+ return (n % max) / parseFloat(max);
1000
+ }
1001
+
1002
+ // Force a number between 0 and 1
1003
+ function clamp01(val) {
1004
+ return mathMin(1, mathMax(0, val));
1005
+ }
1006
+
1007
+ // Parse a base-16 hex value into a base-10 integer
1008
+ function parseIntFromHex(val) {
1009
+ return parseInt(val, 16);
1010
+ }
1011
+
1012
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1013
+ // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1014
+ function isOnePointZero(n) {
1015
+ return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
1016
+ }
1017
+
1018
+ // Check to see if string passed in is a percentage
1019
+ function isPercentage(n) {
1020
+ return typeof n === "string" && n.indexOf('%') != -1;
1021
+ }
1022
+
1023
+ // Force a hex value to have 2 characters
1024
+ function pad2(c) {
1025
+ return c.length == 1 ? '0' + c : '' + c;
1026
+ }
1027
+
1028
+ // Replace a decimal with it's percentage value
1029
+ function convertToPercentage(n) {
1030
+ if (n <= 1) {
1031
+ n = (n * 100) + "%";
1032
+ }
1033
+
1034
+ return n;
1035
+ }
1036
+
1037
+ // Converts a decimal to a hex value
1038
+ function convertDecimalToHex(d) {
1039
+ return Math.round(parseFloat(d) * 255).toString(16);
1040
+ }
1041
+ // Converts a hex value to a decimal
1042
+ function convertHexToDecimal(h) {
1043
+ return (parseIntFromHex(h) / 255);
1044
+ }
1045
+
1046
+ var matchers = (function() {
1047
+
1048
+ // <http://www.w3.org/TR/css3-values/#integers>
1049
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
1050
+
1051
+ // <http://www.w3.org/TR/css3-values/#number-value>
1052
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1053
+
1054
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1055
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1056
+
1057
+ // Actual matching.
1058
+ // Parentheses and commas are optional, but not required.
1059
+ // Whitespace can take the place of commas or opening paren
1060
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1061
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
1062
+
1063
+ return {
1064
+ CSS_UNIT: new RegExp(CSS_UNIT),
1065
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1066
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1067
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1068
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1069
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1070
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1071
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1072
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1073
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1074
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
1075
+ };
1076
+ })();
1077
+
1078
+ // isValidCSSUnit
1079
+ // Take in a single string / number and check to see if it looks like a CSS unit
1080
+ // (see matchers above for definition).
1081
+ function isValidCSSUnit(color) {
1082
+ return !!matchers.CSS_UNIT.exec(color);
1083
+ }
1084
+
1085
+ // stringInputToObject
1086
+ // Permissive string parsing. Take in a number of formats, and output an object
1087
+ // based on detected format. Returns { r, g, b } or { h, s, l } or { h, s, v}
1088
+ function stringInputToObject(color) {
1089
+
1090
+ color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase();
1091
+ var named = false;
1092
+ if (names[color]) {
1093
+ color = names[color];
1094
+ named = true;
1095
+ }
1096
+ else if (color == 'transparent') {
1097
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
1098
+ }
1099
+
1100
+ // Try to match string input using regular expressions.
1101
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1102
+ // Just return an object and let the conversion functions handle that.
1103
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
1104
+ var match;
1105
+ if ((match = matchers.rgb.exec(color))) {
1106
+ return { r: match[1], g: match[2], b: match[3] };
1107
+ }
1108
+ if ((match = matchers.rgba.exec(color))) {
1109
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
1110
+ }
1111
+ if ((match = matchers.hsl.exec(color))) {
1112
+ return { h: match[1], s: match[2], l: match[3] };
1113
+ }
1114
+ if ((match = matchers.hsla.exec(color))) {
1115
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
1116
+ }
1117
+ if ((match = matchers.hsv.exec(color))) {
1118
+ return { h: match[1], s: match[2], v: match[3] };
1119
+ }
1120
+ if ((match = matchers.hsva.exec(color))) {
1121
+ return { h: match[1], s: match[2], v: match[3], a: match[4] };
1122
+ }
1123
+ if ((match = matchers.hex8.exec(color))) {
1124
+ return {
1125
+ r: parseIntFromHex(match[1]),
1126
+ g: parseIntFromHex(match[2]),
1127
+ b: parseIntFromHex(match[3]),
1128
+ a: convertHexToDecimal(match[4]),
1129
+ format: named ? "name" : "hex8"
1130
+ };
1131
+ }
1132
+ if ((match = matchers.hex6.exec(color))) {
1133
+ return {
1134
+ r: parseIntFromHex(match[1]),
1135
+ g: parseIntFromHex(match[2]),
1136
+ b: parseIntFromHex(match[3]),
1137
+ format: named ? "name" : "hex"
1138
+ };
1139
+ }
1140
+ if ((match = matchers.hex4.exec(color))) {
1141
+ return {
1142
+ r: parseIntFromHex(match[1] + '' + match[1]),
1143
+ g: parseIntFromHex(match[2] + '' + match[2]),
1144
+ b: parseIntFromHex(match[3] + '' + match[3]),
1145
+ a: convertHexToDecimal(match[4] + '' + match[4]),
1146
+ format: named ? "name" : "hex8"
1147
+ };
1148
+ }
1149
+ if ((match = matchers.hex3.exec(color))) {
1150
+ return {
1151
+ r: parseIntFromHex(match[1] + '' + match[1]),
1152
+ g: parseIntFromHex(match[2] + '' + match[2]),
1153
+ b: parseIntFromHex(match[3] + '' + match[3]),
1154
+ format: named ? "name" : "hex"
1155
+ };
1156
+ }
1157
+
1158
+ return false;
1159
+ }
1160
+
1161
+ function validateWCAG2Parms(parms) {
1162
+ // return valid WCAG2 parms for isReadable.
1163
+ // If input parms are invalid, return {"level":"AA", "size":"small"}
1164
+ var level, size;
1165
+ parms = parms || {"level":"AA", "size":"small"};
1166
+ level = (parms.level || "AA").toUpperCase();
1167
+ size = (parms.size || "small").toLowerCase();
1168
+ if (level !== "AA" && level !== "AAA") {
1169
+ level = "AA";
1170
+ }
1171
+ if (size !== "small" && size !== "large") {
1172
+ size = "small";
1173
+ }
1174
+ return {"level":level, "size":size};
1175
+ }
1176
+
1177
+ this.tinycolor = tinycolor;
1178
+
1179
+ })()`;
1180
+ }
1181
+ // It is hacky way to make this function will be compiled preferentially by less
1182
+ // resolve error: `ReferenceError: colorPalette is not defined`
1183
+ // https://github.com/ant-design/ant-motion/issues/44
1184
+ .tinyColorMixin();