@esri/calcite-components 1.0.0-beta.81 → 1.0.0-beta.84
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.
- package/dist/calcite/assets/date-picker/nls/ru.json +4 -4
- package/dist/calcite/assets/date-picker/nls/th.json +1 -1
- package/dist/calcite/assets/icon/changeDetection16.json +1 -0
- package/dist/calcite/assets/icon/changeDetection24.json +1 -0
- package/dist/calcite/assets/icon/changeDetection32.json +1 -0
- package/dist/calcite/assets/icon/compactness16.json +1 -0
- package/dist/calcite/assets/icon/compactness24.json +1 -0
- package/dist/calcite/assets/icon/compactness32.json +1 -0
- package/dist/calcite/assets/icon/configure16.json +1 -0
- package/dist/calcite/assets/icon/configure24.json +1 -0
- package/dist/calcite/assets/icon/configure32.json +1 -0
- package/dist/calcite/assets/icon/debugScript16.json +1 -0
- package/dist/calcite/assets/icon/debugScript24.json +1 -0
- package/dist/calcite/assets/icon/debugScript32.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures16.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures24.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures32.json +1 -0
- package/dist/calcite/assets/icon/distanceType16.json +1 -0
- package/dist/calcite/assets/icon/distanceType24.json +1 -0
- package/dist/calcite/assets/icon/distanceType32.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond16.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond24.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond32.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon16.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon24.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon32.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle16.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle24.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle32.json +1 -0
- package/dist/calcite/assets/icon/imageDisplayOrder16.json +1 -0
- package/dist/calcite/assets/icon/imageDisplayOrder24.json +1 -0
- package/dist/calcite/assets/icon/imageDisplayOrder32.json +1 -0
- package/dist/calcite/assets/icon/insets16.json +1 -0
- package/dist/calcite/assets/icon/insets24.json +1 -0
- package/dist/calcite/assets/icon/insets32.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll16.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll24.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll32.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign16.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign24.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign32.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign16.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign24.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign32.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/dist/calcite/assets/icon/numberCircle416.json +1 -0
- package/dist/calcite/assets/icon/numberCircle424.json +1 -0
- package/dist/calcite/assets/icon/numberCircle432.json +1 -0
- package/dist/calcite/assets/icon/numberCircle516.json +1 -0
- package/dist/calcite/assets/icon/numberCircle524.json +1 -0
- package/dist/calcite/assets/icon/numberCircle532.json +1 -0
- package/dist/calcite/assets/icon/numberCircle616.json +1 -0
- package/dist/calcite/assets/icon/numberCircle624.json +1 -0
- package/dist/calcite/assets/icon/numberCircle632.json +1 -0
- package/dist/calcite/assets/icon/numberCircle716.json +1 -0
- package/dist/calcite/assets/icon/numberCircle724.json +1 -0
- package/dist/calcite/assets/icon/numberCircle732.json +1 -0
- package/dist/calcite/assets/icon/numberCircle816.json +1 -0
- package/dist/calcite/assets/icon/numberCircle824.json +1 -0
- package/dist/calcite/assets/icon/numberCircle832.json +1 -0
- package/dist/calcite/assets/icon/numberCircle916.json +1 -0
- package/dist/calcite/assets/icon/numberCircle924.json +1 -0
- package/dist/calcite/assets/icon/numberCircle932.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories16.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories24.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories32.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures16.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures24.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures32.json +1 -0
- package/dist/calcite/assets/icon/profileVariables16.json +1 -0
- package/dist/calcite/assets/icon/profileVariables24.json +1 -0
- package/dist/calcite/assets/icon/profileVariables32.json +1 -0
- package/dist/calcite/assets/icon/rangefinder16.json +1 -0
- package/dist/calcite/assets/icon/rangefinder24.json +1 -0
- package/dist/calcite/assets/icon/rangefinder32.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis16.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis24.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis32.json +1 -0
- package/dist/calcite/assets/icon/recurrence16.json +1 -0
- package/dist/calcite/assets/icon/recurrence24.json +1 -0
- package/dist/calcite/assets/icon/recurrence32.json +1 -0
- package/dist/calcite/assets/icon/rfid16.json +1 -0
- package/dist/calcite/assets/icon/rfid24.json +1 -0
- package/dist/calcite/assets/icon/rfid32.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign16.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign24.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign32.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign16.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign24.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign32.json +1 -0
- package/dist/calcite/assets/icon/showMultipleLayersAtATime16.json +1 -0
- package/dist/calcite/assets/icon/showMultipleLayersAtATime24.json +1 -0
- package/dist/calcite/assets/icon/showMultipleLayersAtATime32.json +1 -0
- package/dist/calcite/assets/icon/showOneLayerAtATime16.json +1 -0
- package/dist/calcite/assets/icon/showOneLayerAtATime24.json +1 -0
- package/dist/calcite/assets/icon/showOneLayerAtATime32.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures16.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures24.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures32.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance16.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance24.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance32.json +1 -0
- package/dist/calcite/assets/icon/testData16.json +1 -0
- package/dist/calcite/assets/icon/testData24.json +1 -0
- package/dist/calcite/assets/icon/testData32.json +1 -0
- package/dist/calcite/calcite.css +1 -1
- package/dist/calcite/calcite.esm.js +2 -2
- package/dist/calcite/calcite.js +1 -1
- package/dist/calcite/index.esm.js +1 -1
- package/dist/calcite/p-00247a8d.system.js +7 -0
- package/dist/calcite/p-02bb8194.entry.js +6 -0
- package/dist/calcite/p-061aea88.entry.js +6 -0
- package/dist/calcite/p-07c6e102.system.js +6 -0
- package/dist/calcite/{p-14ca50d9.entry.js → p-0bfe5ca7.entry.js} +2 -2
- package/dist/calcite/{p-ffc13e2d.entry.js → p-114d44c3.entry.js} +2 -2
- package/dist/calcite/{p-f8d2efa3.js → p-1157ae2f.js} +1 -1
- package/dist/calcite/p-1363adcd.entry.js +6 -0
- package/dist/calcite/p-13d66ebf.entry.js +6 -0
- package/dist/calcite/p-14a22bfc.system.entry.js +6 -0
- package/dist/calcite/{p-e4a047e7.system.entry.js → p-14f0920e.system.entry.js} +2 -2
- package/dist/calcite/p-16888553.system.entry.js +6 -0
- package/dist/calcite/p-16dbdef2.system.entry.js +6 -0
- package/dist/calcite/p-1adea169.system.entry.js +6 -0
- package/dist/calcite/p-1db25c99.system.entry.js +6 -0
- package/dist/calcite/p-204443b0.system.entry.js +6 -0
- package/dist/calcite/p-20d610fc.entry.js +6 -0
- package/dist/calcite/p-21a1034c.entry.js +6 -0
- package/dist/calcite/p-236f1255.system.entry.js +6 -0
- package/dist/calcite/p-24d52a72.entry.js +6 -0
- package/dist/calcite/p-25349c89.system.entry.js +6 -0
- package/dist/calcite/{p-045f28b2.entry.js → p-26757de8.entry.js} +2 -2
- package/dist/calcite/p-278c8372.entry.js +6 -0
- package/dist/calcite/p-282106cb.system.js +6 -0
- package/dist/calcite/p-2b531882.entry.js +6 -0
- package/dist/calcite/{p-0ee86cc3.js → p-2bf5b9b6.js} +2 -2
- package/dist/calcite/p-2ce10f9a.system.js +6 -0
- package/dist/calcite/p-2e3ffd32.system.js +6 -0
- package/dist/calcite/p-30256458.entry.js +6 -0
- package/dist/calcite/{p-82c05795.js → p-34e0b58b.js} +2 -2
- package/dist/calcite/p-352b94a1.system.entry.js +6 -0
- package/dist/calcite/p-39bb68b3.system.js +6 -0
- package/dist/calcite/p-3aefc333.entry.js +6 -0
- package/dist/calcite/p-3d2eebab.system.entry.js +6 -0
- package/dist/calcite/{p-a2b46564.entry.js → p-3d8ab9d5.entry.js} +2 -2
- package/dist/calcite/p-4185af29.entry.js +6 -0
- package/dist/calcite/{p-4275a429.system.js → p-4196e498.system.js} +2 -2
- package/dist/calcite/p-41cbf505.system.entry.js +6 -0
- package/dist/calcite/p-438d87b0.entry.js +6 -0
- package/dist/calcite/p-448b3393.system.entry.js +6 -0
- package/dist/calcite/p-45588eee.system.entry.js +6 -0
- package/dist/calcite/{p-fb726bdd.system.js → p-4908e3a5.system.js} +1 -1
- package/dist/calcite/p-49488c34.entry.js +6 -0
- package/dist/calcite/p-4b414b81.entry.js +6 -0
- package/dist/calcite/{p-f839293b.system.js → p-4cfef590.system.js} +2 -2
- package/dist/calcite/{p-be0551f8.system.js → p-4d9c7cc9.system.js} +1 -1
- package/dist/calcite/p-4eb531c4.js +7 -0
- package/dist/calcite/p-4f1dbd36.system.entry.js +6 -0
- package/dist/calcite/p-4f9ce175.js +6 -0
- package/dist/calcite/{p-24db2b0a.system.js → p-51491e10.system.js} +1 -1
- package/dist/calcite/p-51ffb552.system.entry.js +6 -0
- package/dist/calcite/{p-61021069.system.js → p-549e267e.system.js} +1 -1
- package/dist/calcite/p-56f93049.js +6 -0
- package/dist/calcite/p-57b60838.entry.js +6 -0
- package/dist/calcite/p-594f52ca.system.entry.js +6 -0
- package/dist/calcite/{p-769054e6.entry.js → p-5bd80046.entry.js} +2 -2
- package/dist/calcite/{p-a9630b98.js → p-5d7f4169.js} +1 -1
- package/dist/calcite/p-6309de22.entry.js +6 -0
- package/dist/calcite/p-67a0e692.system.entry.js +6 -0
- package/dist/calcite/p-6a554714.entry.js +6 -0
- package/dist/calcite/{p-3412c57d.system.js → p-6a8f1936.system.js} +2 -2
- package/dist/calcite/p-6cff0a2a.entry.js +6 -0
- package/dist/calcite/p-6d1c91ee.entry.js +6 -0
- package/dist/calcite/p-6d96d61f.system.js +6 -0
- package/dist/calcite/p-6e366971.system.entry.js +6 -0
- package/dist/calcite/{p-89146101.entry.js → p-6eadd519.entry.js} +2 -2
- package/dist/calcite/p-70e1d287.system.entry.js +6 -0
- package/dist/calcite/{p-0f0713c7.entry.js → p-7168da40.entry.js} +2 -2
- package/dist/calcite/p-74153f82.js +6 -0
- package/dist/calcite/p-74b7ff1f.entry.js +6 -0
- package/dist/calcite/p-77bc0e49.entry.js +6 -0
- package/dist/calcite/p-7c7ad2d6.entry.js +6 -0
- package/dist/calcite/p-7cc3d924.system.entry.js +6 -0
- package/dist/calcite/{p-db2360e6.js → p-7ec42769.js} +1 -1
- package/dist/calcite/p-7ede3d65.system.entry.js +6 -0
- package/dist/calcite/{p-e3f1b697.system.entry.js → p-8018d689.system.entry.js} +2 -2
- package/dist/calcite/p-8133b2a5.entry.js +6 -0
- package/dist/calcite/{p-609f05ef.entry.js → p-8137bc05.entry.js} +2 -2
- package/dist/calcite/{p-c62291e6.system.entry.js → p-8202ad8a.system.entry.js} +2 -2
- package/dist/calcite/p-82dec536.system.entry.js +6 -0
- package/dist/calcite/{p-99bd5049.system.js → p-82e24e64.system.js} +1 -1
- package/dist/calcite/p-88d2d38a.entry.js +6 -0
- package/dist/calcite/p-890cc5a8.system.entry.js +6 -0
- package/dist/calcite/p-891e53dd.system.entry.js +6 -0
- package/dist/calcite/p-8ae680a2.system.entry.js +6 -0
- package/dist/calcite/{p-c76d5a12.entry.js → p-8c25b934.entry.js} +2 -2
- package/dist/calcite/p-8c9e453c.js +6 -0
- package/dist/calcite/p-90608473.entry.js +6 -0
- package/dist/calcite/{p-47913e44.system.entry.js → p-974b7008.system.entry.js} +2 -2
- package/dist/calcite/p-98a2aa34.entry.js +6 -0
- package/dist/calcite/p-98dfd14b.system.entry.js +6 -0
- package/dist/calcite/p-99551007.system.entry.js +6 -0
- package/dist/calcite/{p-1866c3d6.entry.js → p-9c4aa033.entry.js} +2 -2
- package/dist/calcite/p-9c5c3cb3.system.entry.js +6 -0
- package/dist/calcite/p-9c80707e.system.js +6 -0
- package/dist/calcite/p-9d158b37.system.js +6 -0
- package/dist/calcite/{p-3ceba891.js → p-9e8d6e02.js} +2 -2
- package/dist/calcite/p-9eaf38bc.js +6 -0
- package/dist/calcite/p-9f13e930.entry.js +6 -0
- package/dist/calcite/{p-4ff2f38c.entry.js → p-a0971f99.entry.js} +2 -2
- package/dist/calcite/p-a1208386.entry.js +6 -0
- package/dist/calcite/p-a1cc6421.entry.js +6 -0
- package/dist/calcite/{p-daf452fa.entry.js → p-a6e1e1e4.entry.js} +2 -2
- package/dist/calcite/{p-7e9cac29.system.entry.js → p-a89fc6a1.system.entry.js} +2 -2
- package/dist/calcite/{p-d7f31cff.system.js → p-a92ac42d.system.js} +1 -1
- package/dist/calcite/{p-5a3414c7.js → p-aa9ce421.js} +1 -1
- package/dist/calcite/{p-5dd1e943.system.js → p-aaba2ea0.system.js} +1 -1
- package/dist/calcite/p-b2f27af5.entry.js +6 -0
- package/dist/calcite/p-b31d3dad.system.entry.js +6 -0
- package/dist/calcite/p-b3a4497d.entry.js +6 -0
- package/dist/calcite/p-b48feb98.system.entry.js +6 -0
- package/dist/calcite/p-bb1711f3.js +6 -0
- package/dist/calcite/{p-5ed8397b.js → p-bbd8269c.js} +1 -1
- package/dist/calcite/{p-ceae054a.system.entry.js → p-bc5a7fee.system.entry.js} +2 -2
- package/dist/calcite/p-bce5ab4f.system.entry.js +6 -0
- package/dist/calcite/{p-99520e50.js → p-c2ed5f67.js} +1 -1
- package/dist/calcite/p-c78d1678.system.entry.js +6 -0
- package/dist/calcite/p-c9d73fce.system.entry.js +6 -0
- package/dist/calcite/{p-90660203.js → p-ca1b7a2e.js} +1 -1
- package/dist/calcite/{p-e837987d.system.js → p-cc041a12.system.js} +1 -1
- package/dist/calcite/p-ccf1e5d8.entry.js +6 -0
- package/dist/calcite/{p-1b7e43a7.js → p-ce28c259.js} +2 -2
- package/dist/calcite/{p-c477a6ac.system.entry.js → p-ce34288b.entry.js} +2 -2
- package/dist/calcite/{p-40a15f4a.system.entry.js → p-ce654c2c.system.entry.js} +2 -2
- package/dist/calcite/p-d05f35e8.system.js +6 -0
- package/dist/calcite/p-d48cc6d2.entry.js +6 -0
- package/dist/calcite/p-d4f596f2.entry.js +6 -0
- package/dist/calcite/{p-bef4c06f.system.js → p-d6d814a6.system.js} +1 -1
- package/dist/calcite/p-d96573eb.system.entry.js +6 -0
- package/dist/calcite/p-dca64e20.js +6 -0
- package/dist/calcite/{p-44f00a2a.system.entry.js → p-dd1e12e4.system.entry.js} +2 -2
- package/dist/calcite/{p-8729fefb.entry.js → p-dd5185d6.entry.js} +2 -2
- package/dist/calcite/p-dd5e585b.entry.js +6 -0
- package/dist/calcite/{p-dfd0c1ce.js → p-df26aab6.js} +1 -1
- package/dist/calcite/p-e2ccf473.entry.js +6 -0
- package/dist/calcite/p-e345449f.entry.js +6 -0
- package/dist/calcite/{p-ed535fb3.system.js → p-e45d0fed.system.js} +1 -1
- package/dist/calcite/p-e5381e40.system.entry.js +6 -0
- package/dist/calcite/p-e6578cf2.system.entry.js +6 -0
- package/dist/calcite/{p-7ebc956d.system.js → p-e69d3ca4.system.js} +1 -1
- package/dist/calcite/p-e78d93ed.entry.js +6 -0
- package/dist/calcite/p-e7b4e5b8.system.entry.js +6 -0
- package/dist/calcite/{p-e131dae7.system.entry.js → p-e956598c.system.entry.js} +2 -2
- package/dist/calcite/{p-72ab20ed.system.entry.js → p-e9c9fb33.system.entry.js} +2 -2
- package/dist/calcite/p-ebb71e37.system.entry.js +6 -0
- package/dist/calcite/p-ebeb09f0.system.entry.js +6 -0
- package/dist/calcite/{p-bddde234.system.entry.js → p-ec8d9088.system.entry.js} +2 -2
- package/dist/calcite/p-eccc820a.entry.js +6 -0
- package/dist/calcite/{p-a3478523.js → p-ecd12a92.js} +1 -1
- package/dist/calcite/p-eceb3f95.system.entry.js +6 -0
- package/dist/calcite/p-ee60b60f.system.entry.js +6 -0
- package/dist/calcite/{p-2363fc48.system.entry.js → p-f07627e7.system.entry.js} +2 -2
- package/dist/calcite/p-f14e0497.system.entry.js +6 -0
- package/dist/calcite/p-f2384caf.entry.js +6 -0
- package/dist/calcite/p-f537a6a5.entry.js +6 -0
- package/dist/calcite/p-f6760679.js +6 -0
- package/dist/calcite/{p-7c32da09.entry.js → p-f8695531.entry.js} +2 -2
- package/dist/calcite/{p-23c9c6f9.js → p-f8cb1eeb.js} +1 -1
- package/dist/calcite/{p-3113528a.js → p-fb0e5ae3.js} +1 -1
- package/dist/calcite/p-fb97a373.system.entry.js +6 -0
- package/dist/calcite/p-fbbfde67.system.js +6 -0
- package/dist/calcite/p-fc6a158c.system.entry.js +6 -0
- package/dist/calcite/p-fca56e68.system.entry.js +6 -0
- package/dist/calcite/{p-2f07bcb4.system.js → p-fdc7032c.system.js} +1 -1
- package/dist/cjs/{ExpandToggle-e3bd3e9d.js → ExpandToggle-894fe6d0.js} +9 -7
- package/dist/cjs/{Heading-b864aca1.js → Heading-9546b15c.js} +3 -3
- package/dist/cjs/{array-00db7b4e.js → array-1c85be7d.js} +1 -1
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +41 -26
- package/dist/cjs/calcite-action-bar.cjs.entry.js +22 -16
- package/dist/cjs/calcite-action-group.cjs.entry.js +11 -11
- package/dist/cjs/calcite-action-menu.cjs.entry.js +32 -28
- package/dist/cjs/calcite-action-pad.cjs.entry.js +20 -15
- package/dist/cjs/calcite-action.cjs.entry.js +20 -15
- package/dist/cjs/calcite-alert.cjs.entry.js +61 -34
- package/dist/cjs/calcite-avatar.cjs.entry.js +12 -7
- package/dist/cjs/calcite-block_2.cjs.entry.js +40 -18
- package/dist/cjs/calcite-button.cjs.entry.js +18 -14
- package/dist/cjs/calcite-card.cjs.entry.js +23 -14
- package/dist/cjs/calcite-checkbox.cjs.entry.js +11 -10
- package/dist/cjs/calcite-chip.cjs.entry.js +19 -13
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1396 -1352
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +111 -51
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +115 -32
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +129 -54
- package/dist/cjs/calcite-fab.cjs.entry.js +6 -5
- package/dist/cjs/calcite-filter.cjs.entry.js +17 -15
- package/dist/cjs/calcite-flow.cjs.entry.js +12 -11
- package/dist/cjs/calcite-graph_2.cjs.entry.js +57 -12
- package/dist/cjs/calcite-handle.cjs.entry.js +9 -6
- package/dist/cjs/calcite-icon.cjs.entry.js +10 -6
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +23 -19
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +56 -23
- package/dist/cjs/calcite-input-message.cjs.entry.js +5 -5
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +117 -67
- package/dist/cjs/calcite-input.cjs.entry.js +136 -80
- package/dist/cjs/calcite-label.cjs.entry.js +13 -8
- package/dist/cjs/calcite-link.cjs.entry.js +8 -7
- package/dist/cjs/calcite-list_3.cjs.entry.js +13 -13
- package/dist/cjs/calcite-loader.cjs.entry.js +12 -10
- package/dist/cjs/calcite-modal.cjs.entry.js +46 -28
- package/dist/cjs/calcite-notice.cjs.entry.js +16 -14
- package/dist/cjs/calcite-option_3.cjs.entry.js +16 -16
- package/dist/cjs/calcite-pagination.cjs.entry.js +97 -12
- package/dist/cjs/calcite-panel.cjs.entry.js +54 -23
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +47 -38
- package/dist/cjs/calcite-popover_2.cjs.entry.js +155 -63
- package/dist/cjs/calcite-progress.cjs.entry.js +5 -5
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -3
- package/dist/cjs/calcite-radio-button.cjs.entry.js +13 -10
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +15 -12
- package/dist/cjs/calcite-rating.cjs.entry.js +33 -15
- package/dist/cjs/calcite-scrim.cjs.entry.js +5 -3
- package/dist/cjs/calcite-shell_3.cjs.entry.js +10 -9
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -5
- package/dist/cjs/calcite-split-button.cjs.entry.js +9 -6
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +175 -121
- package/dist/cjs/calcite-switch.cjs.entry.js +12 -10
- package/dist/cjs/calcite-tab_4.cjs.entry.js +61 -37
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +8 -7
- package/dist/cjs/calcite-tile.cjs.entry.js +9 -8
- package/dist/cjs/calcite-tip_3.cjs.entry.js +12 -10
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +188 -141
- package/dist/cjs/calcite-tree_2.cjs.entry.js +35 -24
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +43 -35
- package/dist/cjs/calcite.cjs.js +4 -4
- package/dist/cjs/{conditionalSlot-8468d1b6.js → conditionalSlot-ecb74d9a.js} +7 -3
- package/dist/cjs/{debounce-a29e2f71.js → debounce-a74a2080.js} +1 -1
- package/dist/cjs/{dom-66c5cb56.js → dom-69c7e941.js} +19 -27
- package/dist/cjs/{forIn-d4941a7b.js → forIn-efe39801.js} +2 -2
- package/dist/cjs/{form-cfcc3b12.js → form-901b31de.js} +39 -3
- package/dist/cjs/{guid-364777e6.js → guid-263ed05b.js} +1 -1
- package/dist/cjs/{index-ab066772.js → index-8fbe74dd.js} +7 -19
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{interactive-3808ad50.js → interactive-b2df5d51.js} +7 -4
- package/dist/cjs/{interfaces-597482d7.js → interfaces-a8a9ed80.js} +1 -1
- package/dist/cjs/key-0fe936c7.js +14 -0
- package/dist/cjs/{label-e53e11ab.js → label-f1317d82.js} +26 -19
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/locale-0becaa93.js +262 -0
- package/dist/cjs/{math-b81c3249.js → math-0877dd01.js} +1 -1
- package/dist/cjs/{observers-2dc895e1.js → observers-8169781c.js} +1 -1
- package/dist/cjs/{popper-5aeab272.js → popper-46476990.js} +2 -2
- package/dist/cjs/{resources-9baed1da.js → resources-192c00c3.js} +10 -22
- package/dist/cjs/{resources-7b0c6b5a.js → resources-6ac223e5.js} +44 -3
- package/dist/cjs/{resources-ff2cae6a.js → resources-80d6cd05.js} +1 -1
- package/dist/cjs/{resources-39df6d9b.js → resources-93a62cd3.js} +1 -1
- package/dist/cjs/{sortable.esm-6d0d59e8.js → sortable.esm-b7091c1d.js} +1 -1
- package/dist/cjs/{utils-9f674b6a.js → utils-b1d11545.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/accordion.js +27 -22
- package/dist/collection/components/accordion/interfaces.js +1 -1
- package/dist/collection/components/accordion-item/accordion-item.css +38 -18
- package/dist/collection/components/accordion-item/accordion-item.js +98 -27
- package/dist/collection/components/action/action.css +38 -14
- package/dist/collection/components/action/action.js +28 -24
- package/dist/collection/components/action/resources.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +29 -17
- package/dist/collection/components/action-bar/resources.js +1 -1
- package/dist/collection/components/action-bar/utils.js +1 -1
- package/dist/collection/components/action-group/action-group.css +1 -1
- package/dist/collection/components/action-group/action-group.js +11 -11
- package/dist/collection/components/action-group/resources.js +1 -1
- package/dist/collection/components/action-menu/action-menu.css +2 -3
- package/dist/collection/components/action-menu/action-menu.js +32 -28
- package/dist/collection/components/action-menu/resources.js +1 -1
- package/dist/collection/components/action-pad/action-pad.js +30 -19
- package/dist/collection/components/action-pad/resources.js +1 -1
- package/dist/collection/components/alert/alert.css +37 -38
- package/dist/collection/components/alert/alert.js +129 -57
- package/dist/collection/components/alert/interfaces.js +1 -1
- package/dist/collection/components/alert/resources.js +4 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/avatar/avatar.js +7 -7
- package/dist/collection/components/avatar/utils.js +6 -1
- package/dist/collection/components/block/block.css +6 -4
- package/dist/collection/components/block/block.js +84 -17
- package/dist/collection/components/block/resources.js +2 -1
- package/dist/collection/components/block-section/block-section.css +6 -5
- package/dist/collection/components/block-section/block-section.js +3 -3
- package/dist/collection/components/block-section/interfaces.js +1 -1
- package/dist/collection/components/block-section/resources.js +1 -1
- package/dist/collection/components/button/button.css +116 -57
- package/dist/collection/components/button/button.js +11 -7
- package/dist/collection/components/button/interfaces.js +1 -1
- package/dist/collection/components/button/resources.js +1 -1
- package/dist/collection/components/card/card.css +32 -11
- package/dist/collection/components/card/card.js +45 -11
- package/dist/collection/components/card/resources.js +3 -3
- package/dist/collection/components/checkbox/checkbox.css +15 -11
- package/dist/collection/components/checkbox/checkbox.js +5 -3
- package/dist/collection/components/chip/chip.css +27 -25
- package/dist/collection/components/chip/chip.js +28 -5
- package/dist/collection/components/chip/interfaces.js +1 -1
- package/dist/collection/components/chip/resources.js +4 -3
- package/dist/collection/components/color-picker/color-picker.css +3 -12
- package/dist/collection/components/color-picker/color-picker.js +111 -41
- package/dist/collection/components/color-picker/interfaces.js +1 -1
- package/dist/collection/components/color-picker/resources.js +1 -1
- package/dist/collection/components/color-picker/utils.js +1 -1
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +27 -3
- package/dist/collection/components/color-picker-hex-input/resources.js +1 -1
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +1 -1
- package/dist/collection/components/color-picker-swatch/resources.js +1 -1
- package/dist/collection/components/combobox/combobox.css +4 -4
- package/dist/collection/components/combobox/combobox.js +195 -57
- package/dist/collection/components/combobox/interfaces.js +1 -1
- package/dist/collection/components/combobox/resources.js +6 -1
- package/dist/collection/components/combobox/utils.js +1 -1
- package/dist/collection/components/combobox-item/combobox-item.css +4 -4
- package/dist/collection/components/combobox-item/combobox-item.js +32 -4
- package/dist/collection/components/combobox-item/resources.js +1 -1
- package/dist/collection/components/combobox-item-group/combobox-item-group.css +2 -1
- package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
- package/dist/collection/components/combobox-item-group/resources.js +1 -1
- package/dist/collection/components/date-picker/assets/date-picker/nls/ru.json +4 -4
- package/dist/collection/components/date-picker/assets/date-picker/nls/th.json +1 -1
- package/dist/collection/components/date-picker/date-picker.js +36 -7
- package/dist/collection/components/date-picker/interfaces.js +1 -1
- package/dist/collection/components/date-picker/resources.js +1 -1
- package/dist/collection/components/date-picker/utils.js +7 -1
- package/dist/collection/components/date-picker-day/date-picker-day.css +25 -18
- package/dist/collection/components/date-picker-day/date-picker-day.js +4 -4
- package/dist/collection/components/date-picker-month/date-picker-month.js +38 -10
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +5 -9
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +32 -7
- package/dist/collection/components/date-picker-month-header/resources.js +6 -0
- package/dist/collection/components/dropdown/dropdown.css +2 -1
- package/dist/collection/components/dropdown/dropdown.js +186 -47
- package/dist/collection/components/dropdown/interfaces.js +1 -1
- package/dist/collection/components/dropdown/resources.js +4 -1
- package/dist/collection/components/dropdown-group/dropdown-group.css +4 -0
- package/dist/collection/components/dropdown-group/dropdown-group.js +9 -7
- package/dist/collection/components/dropdown-group/interfaces.js +1 -1
- package/dist/collection/components/dropdown-group/resources.js +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.css +16 -9
- package/dist/collection/components/dropdown-item/dropdown-item.js +21 -21
- package/dist/collection/components/dropdown-item/resources.js +1 -1
- package/dist/collection/components/fab/fab.js +2 -1
- package/dist/collection/components/fab/resources.js +1 -1
- package/dist/collection/components/filter/filter.css +3 -3
- package/dist/collection/components/filter/filter.js +9 -8
- package/dist/collection/components/filter/resources.js +2 -3
- package/dist/collection/components/flow/flow.css +1 -9
- package/dist/collection/components/flow/flow.js +9 -8
- package/dist/collection/components/flow/interfaces.js +1 -1
- package/dist/collection/components/flow/resources.js +1 -1
- package/dist/collection/components/functional/ExpandToggle.js +5 -3
- package/dist/collection/components/functional/Heading.js +2 -2
- package/dist/collection/components/graph/graph.css +1 -0
- package/dist/collection/components/graph/graph.js +1 -1
- package/dist/collection/components/graph/interfaces.js +1 -1
- package/dist/collection/components/graph/util.js +29 -1
- package/dist/collection/components/handle/handle.css +0 -2
- package/dist/collection/components/handle/handle.js +7 -5
- package/dist/collection/components/handle/resources.js +1 -1
- package/dist/collection/components/icon/assets/icon/changeDetection16.json +1 -0
- package/dist/collection/components/icon/assets/icon/changeDetection24.json +1 -0
- package/dist/collection/components/icon/assets/icon/changeDetection32.json +1 -0
- package/dist/collection/components/icon/assets/icon/compactness16.json +1 -0
- package/dist/collection/components/icon/assets/icon/compactness24.json +1 -0
- package/dist/collection/components/icon/assets/icon/compactness32.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure16.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure24.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure32.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript16.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript24.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript32.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType16.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType24.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle32.json +1 -0
- package/dist/collection/components/icon/assets/icon/imageDisplayOrder16.json +1 -0
- package/dist/collection/components/icon/assets/icon/imageDisplayOrder24.json +1 -0
- package/dist/collection/components/icon/assets/icon/imageDisplayOrder32.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets16.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets24.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets32.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll16.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll24.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll32.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle416.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle424.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle432.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle516.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle524.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle532.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle616.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle624.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle632.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle716.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle724.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle732.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle816.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle824.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle832.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle916.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle924.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberCircle932.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories16.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories24.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories32.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables16.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables24.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis32.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence16.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence24.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/showMultipleLayersAtATime16.json +1 -0
- package/dist/collection/components/icon/assets/icon/showMultipleLayersAtATime24.json +1 -0
- package/dist/collection/components/icon/assets/icon/showMultipleLayersAtATime32.json +1 -0
- package/dist/collection/components/icon/assets/icon/showOneLayerAtATime16.json +1 -0
- package/dist/collection/components/icon/assets/icon/showOneLayerAtATime24.json +1 -0
- package/dist/collection/components/icon/assets/icon/showOneLayerAtATime32.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance16.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance24.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance32.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData16.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData24.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData32.json +1 -0
- package/dist/collection/components/icon/icon.js +3 -3
- package/dist/collection/components/icon/resources.js +1 -1
- package/dist/collection/components/icon/utils.js +5 -1
- package/dist/collection/components/inline-editable/inline-editable.css +1 -4
- package/dist/collection/components/inline-editable/inline-editable.js +18 -14
- package/dist/collection/components/inline-editable/resources.js +1 -1
- package/dist/collection/components/input/input.css +47 -56
- package/dist/collection/components/input/input.js +250 -111
- package/dist/collection/components/input/interfaces.js +1 -1
- package/dist/collection/components/input/resources.js +4 -1
- package/dist/collection/components/input-date-picker/input-date-picker.css +1 -1
- package/dist/collection/components/input-date-picker/input-date-picker.js +52 -18
- package/dist/collection/components/input-message/input-message.css +11 -16
- package/dist/collection/components/input-message/input-message.js +1 -1
- package/dist/collection/components/input-message/interfaces.js +1 -1
- package/dist/collection/components/input-number/interfaces.js +1 -0
- package/dist/collection/components/input-time-picker/input-time-picker.js +54 -16
- package/dist/collection/components/interfaces.js +1 -1
- package/dist/collection/components/label/label.css +28 -8
- package/dist/collection/components/label/label.js +21 -13
- package/dist/collection/components/label/resources.js +1 -1
- package/dist/collection/components/link/link.css +11 -18
- package/dist/collection/components/link/link.js +3 -2
- package/dist/collection/components/list/list.js +5 -4
- package/dist/collection/components/list/resources.js +1 -1
- package/dist/collection/components/list-item/list-item.css +23 -15
- package/dist/collection/components/list-item/list-item.js +12 -12
- package/dist/collection/components/list-item/resources.js +1 -1
- package/dist/collection/components/list-item-group/list-item-group.css +1 -1
- package/dist/collection/components/list-item-group/list-item-group.js +3 -3
- package/dist/collection/components/list-item-group/resources.js +1 -1
- package/dist/collection/components/loader/loader.css +3 -3
- package/dist/collection/components/loader/loader.js +23 -21
- package/dist/collection/components/modal/interfaces.js +1 -1
- package/dist/collection/components/modal/modal.css +30 -60
- package/dist/collection/components/modal/modal.js +117 -71
- package/dist/collection/components/modal/resources.js +1 -1
- package/dist/collection/components/notice/notice.css +22 -25
- package/dist/collection/components/notice/notice.js +25 -22
- package/dist/collection/components/notice/resources.js +1 -1
- package/dist/collection/components/option/option.js +10 -10
- package/dist/collection/components/option-group/option-group.js +7 -7
- package/dist/collection/components/pagination/pagination.css +26 -20
- package/dist/collection/components/pagination/pagination.js +49 -22
- package/dist/collection/components/pagination/resources.js +1 -1
- package/dist/collection/components/panel/panel.css +15 -8
- package/dist/collection/components/panel/panel.js +123 -43
- package/dist/collection/components/panel/resources.js +2 -1
- package/dist/collection/components/pick-list/pick-list.js +40 -29
- package/dist/collection/components/pick-list/resources.js +1 -1
- package/dist/collection/components/pick-list/shared-list-logic.js +3 -3
- package/dist/collection/components/pick-list/shared-list-render.js +4 -15
- package/dist/collection/components/pick-list-group/pick-list-group.css +2 -1
- package/dist/collection/components/pick-list-group/pick-list-group.js +3 -3
- package/dist/collection/components/pick-list-group/resources.js +1 -1
- package/dist/collection/components/pick-list-item/pick-list-item.css +3 -4
- package/dist/collection/components/pick-list-item/pick-list-item.js +47 -37
- package/dist/collection/components/pick-list-item/resources.js +1 -1
- package/dist/collection/components/popover/PopoverManager.js +74 -0
- package/dist/collection/components/popover/popover.css +7 -1
- package/dist/collection/components/popover/popover.js +128 -50
- package/dist/collection/components/popover/resources.js +1 -2
- package/dist/collection/components/popover-manager/popover-manager.js +33 -45
- package/dist/collection/components/progress/progress.css +2 -1
- package/dist/collection/components/progress/progress.js +9 -9
- package/dist/collection/components/radio-button/radio-button.css +10 -6
- package/dist/collection/components/radio-button/radio-button.js +6 -3
- package/dist/collection/components/radio-button/resources.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-group/interfaces.js +1 -1
- package/dist/collection/components/radio-group/radio-group.css +2 -1
- package/dist/collection/components/radio-group/radio-group.js +12 -6
- package/dist/collection/components/radio-group-item/radio-group-item.css +14 -2
- package/dist/collection/components/radio-group-item/radio-group-item.js +6 -6
- package/dist/collection/components/radio-group-item/resources.js +1 -1
- package/dist/collection/components/rating/rating.css +2 -12
- package/dist/collection/components/rating/rating.js +26 -8
- package/dist/collection/components/rating/resources.js +1 -1
- package/dist/collection/components/scrim/resources.js +1 -1
- package/dist/collection/components/scrim/scrim.js +4 -2
- package/dist/collection/components/select/resources.js +1 -1
- package/dist/collection/components/select/select.css +0 -2
- package/dist/collection/components/select/select.js +3 -3
- package/dist/collection/components/shell/resources.js +1 -1
- package/dist/collection/components/shell/shell.css +7 -3
- package/dist/collection/components/shell/shell.js +1 -1
- package/dist/collection/components/shell-center-row/resources.js +1 -1
- package/dist/collection/components/shell-center-row/shell-center-row.css +1 -1
- package/dist/collection/components/shell-center-row/shell-center-row.js +1 -1
- package/dist/collection/components/shell-panel/resources.js +1 -1
- package/dist/collection/components/shell-panel/shell-panel.css +13 -9
- package/dist/collection/components/shell-panel/shell-panel.js +6 -2
- package/dist/collection/components/slider/slider.css +47 -10
- package/dist/collection/components/slider/slider.js +19 -2
- package/dist/collection/components/sortable-list/resources.js +1 -1
- package/dist/collection/components/sortable-list/sortable-list.js +1 -1
- package/dist/collection/components/split-button/resources.js +1 -1
- package/dist/collection/components/split-button/split-button.css +1 -4
- package/dist/collection/components/split-button/split-button.js +6 -3
- package/dist/collection/components/stepper/interfaces.js +6 -0
- package/dist/collection/components/stepper/stepper.js +150 -72
- package/dist/collection/components/stepper-item/stepper-item.css +50 -17
- package/dist/collection/components/stepper-item/stepper-item.js +183 -89
- package/dist/collection/components/switch/switch.css +2 -3
- package/dist/collection/components/switch/switch.js +6 -4
- package/dist/collection/components/tab/interfaces.js +1 -1
- package/dist/collection/components/tab/tab.js +27 -10
- package/dist/collection/components/tab-nav/tab-nav.css +21 -4
- package/dist/collection/components/tab-nav/tab-nav.js +28 -17
- package/dist/collection/components/tab-title/tab-title.css +78 -27
- package/dist/collection/components/tab-title/tab-title.js +41 -26
- package/dist/collection/components/tabs/interfaces.js +1 -1
- package/dist/collection/components/tabs/resources.js +1 -1
- package/dist/collection/components/tabs/tabs.css +41 -1
- package/dist/collection/components/tabs/tabs.js +17 -12
- package/dist/collection/components/tile/resources.js +1 -1
- package/dist/collection/components/tile/tile.css +5 -4
- package/dist/collection/components/tile/tile.js +2 -1
- package/dist/collection/components/tile-select/interfaces.js +1 -1
- package/dist/collection/components/tile-select/resources.js +1 -1
- package/dist/collection/components/tile-select/tile-select.css +9 -3
- package/dist/collection/components/tile-select/tile-select.js +3 -2
- package/dist/collection/components/tile-select-group/interfaces.js +1 -1
- package/dist/collection/components/tile-select-group/tile-select-group.css +1 -1
- package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
- package/dist/collection/components/time-picker/resources.js +1 -1
- package/dist/collection/components/time-picker/time-picker.css +8 -5
- package/dist/collection/components/time-picker/time-picker.js +61 -26
- package/dist/collection/components/tip/resources.js +1 -1
- package/dist/collection/components/tip/tip.css +4 -4
- package/dist/collection/components/tip/tip.js +1 -1
- package/dist/collection/components/tip-group/tip-group.js +1 -1
- package/dist/collection/components/tip-manager/resources.js +1 -1
- package/dist/collection/components/tip-manager/tip-manager.css +3 -14
- package/dist/collection/components/tip-manager/tip-manager.js +23 -4
- package/dist/collection/components/tooltip/TooltipManager.js +161 -0
- package/dist/collection/components/tooltip/resources.js +1 -2
- package/dist/collection/components/tooltip/tooltip.css +7 -4
- package/dist/collection/components/tooltip/tooltip.js +58 -30
- package/dist/collection/components/tooltip-manager/tooltip-manager.js +6 -160
- package/dist/collection/components/tree/interfaces.js +1 -1
- package/dist/collection/components/tree/tree.js +18 -13
- package/dist/collection/components/tree-item/interfaces.js +1 -1
- package/dist/collection/components/tree-item/resources.js +1 -1
- package/dist/collection/components/tree-item/tree-item.css +24 -19
- package/dist/collection/components/tree-item/tree-item.js +34 -28
- package/dist/collection/components/value-list/resources.js +1 -1
- package/dist/collection/components/value-list/value-list.js +45 -34
- package/dist/collection/components/value-list-item/resources.js +1 -1
- package/dist/collection/components/value-list-item/value-list-item.css +2 -3
- package/dist/collection/components/value-list-item/value-list-item.js +37 -28
- package/dist/collection/utils/array.js +1 -1
- package/dist/collection/utils/conditionalSlot.js +5 -1
- package/dist/collection/utils/date.js +36 -1
- package/dist/collection/utils/dom.js +17 -25
- package/dist/collection/utils/filter.js +4 -4
- package/dist/collection/utils/form.js +35 -1
- package/dist/collection/utils/globalAttributes.js +6 -1
- package/dist/collection/utils/guid.js +1 -1
- package/dist/collection/utils/interactive.js +7 -4
- package/dist/collection/utils/key.js +1 -1
- package/dist/collection/utils/label.js +25 -18
- package/dist/collection/utils/locale.js +30 -36
- package/dist/collection/utils/math.js +1 -1
- package/dist/collection/utils/number.js +71 -8
- package/dist/collection/utils/observers.js +1 -1
- package/dist/collection/utils/openCloseComponent.js +6 -0
- package/dist/collection/utils/popper.js +1 -1
- package/dist/collection/utils/resources.js +1 -1
- package/dist/collection/utils/time.js +1 -1
- package/dist/components/ExpandToggle.js +5 -3
- package/dist/components/Heading.js +2 -2
- package/dist/components/action-group.js +14 -20
- package/dist/components/action-menu.js +34 -36
- package/dist/components/action.js +16 -12
- package/dist/components/array.js +1 -1
- package/dist/components/button.js +14 -10
- package/dist/components/calcite-accordion-item.js +28 -15
- package/dist/components/calcite-accordion.js +17 -12
- package/dist/components/calcite-action-bar.js +25 -25
- package/dist/components/calcite-action-group.js +1 -1
- package/dist/components/calcite-action-menu.js +1 -1
- package/dist/components/calcite-action-pad.js +24 -25
- package/dist/components/calcite-action.js +1 -1
- package/dist/components/calcite-alert.js +59 -32
- package/dist/components/calcite-avatar.js +8 -3
- package/dist/components/calcite-block-section.js +4 -4
- package/dist/components/calcite-block.js +49 -31
- package/dist/components/calcite-button.js +1 -1
- package/dist/components/calcite-card.js +22 -12
- package/dist/components/calcite-checkbox.js +1 -1
- package/dist/components/calcite-chip.js +1 -1
- package/dist/components/calcite-color-picker-hex-input.js +1 -1
- package/dist/components/calcite-color-picker-swatch.js +1 -1
- package/dist/components/calcite-color-picker.js +96 -42
- package/dist/components/calcite-combobox-item-group.js +1 -1
- package/dist/components/calcite-combobox-item.js +5 -2
- package/dist/components/calcite-combobox.js +103 -42
- package/dist/components/calcite-date-picker-day.js +1 -1
- package/dist/components/calcite-date-picker-month-header.js +1 -1
- package/dist/components/calcite-date-picker-month.js +1 -1
- package/dist/components/calcite-date-picker.js +1 -1
- package/dist/components/calcite-dropdown-group.js +9 -7
- package/dist/components/calcite-dropdown-item.js +19 -19
- package/dist/components/calcite-dropdown.js +1 -1
- package/dist/components/calcite-fab.js +2 -1
- package/dist/components/calcite-filter.js +1 -1
- package/dist/components/calcite-flow.js +10 -9
- package/dist/components/calcite-graph.js +1 -1
- package/dist/components/calcite-handle.js +1 -1
- package/dist/components/calcite-icon.js +1 -1
- package/dist/components/calcite-inline-editable.js +19 -15
- package/dist/components/calcite-input-date-picker.js +51 -17
- package/dist/components/calcite-input-message.js +2 -2
- package/dist/components/calcite-input-time-picker.js +35 -14
- package/dist/components/calcite-input.js +1 -1
- package/dist/components/calcite-label.js +2 -2
- package/dist/components/calcite-link.js +1 -1
- package/dist/components/calcite-list-item-group.js +2 -2
- package/dist/components/calcite-list-item.js +4 -4
- package/dist/components/calcite-list.js +2 -2
- package/dist/components/calcite-loader.js +1 -1
- package/dist/components/calcite-modal.js +43 -25
- package/dist/components/calcite-notice.js +10 -8
- package/dist/components/calcite-option-group.js +4 -4
- package/dist/components/calcite-option.js +5 -5
- package/dist/components/calcite-pagination.js +96 -11
- package/dist/components/calcite-panel.js +61 -34
- package/dist/components/calcite-pick-list-group.js +2 -2
- package/dist/components/calcite-pick-list-item.js +1 -1
- package/dist/components/calcite-pick-list.js +21 -16
- package/dist/components/calcite-popover-manager.js +31 -38
- package/dist/components/calcite-popover.js +1 -1
- package/dist/components/calcite-progress.js +1 -1
- package/dist/components/calcite-radio-button-group.js +1 -1
- package/dist/components/calcite-radio-button.js +8 -5
- package/dist/components/calcite-radio-group-item.js +6 -6
- package/dist/components/calcite-radio-group.js +8 -5
- package/dist/components/calcite-rating.js +28 -10
- package/dist/components/calcite-scrim.js +1 -1
- package/dist/components/calcite-select.js +4 -4
- package/dist/components/calcite-shell-center-row.js +2 -2
- package/dist/components/calcite-shell-panel.js +3 -2
- package/dist/components/calcite-shell.js +1 -1
- package/dist/components/calcite-slider.js +22 -5
- package/dist/components/calcite-sortable-list.js +1 -1
- package/dist/components/calcite-split-button.js +7 -4
- package/dist/components/calcite-stepper-item.js +79 -65
- package/dist/components/calcite-stepper.js +97 -55
- package/dist/components/calcite-switch.js +1 -1
- package/dist/components/calcite-tab-nav.js +1 -1
- package/dist/components/calcite-tab-title.js +1 -1
- package/dist/components/calcite-tab.js +1 -1
- package/dist/components/calcite-tabs.js +1 -1
- package/dist/components/calcite-tile-select-group.js +2 -2
- package/dist/components/calcite-tile-select.js +4 -3
- package/dist/components/calcite-tile.js +1 -1
- package/dist/components/calcite-time-picker.js +1 -1
- package/dist/components/calcite-tip-group.js +1 -1
- package/dist/components/calcite-tip-manager.js +7 -5
- package/dist/components/calcite-tip.js +3 -3
- package/dist/components/calcite-tooltip-manager.js +48 -2
- package/dist/components/calcite-tooltip.js +195 -24
- package/dist/components/calcite-tree-item.js +21 -15
- package/dist/components/calcite-tree.js +12 -7
- package/dist/components/calcite-value-list-item.js +16 -13
- package/dist/components/calcite-value-list.js +22 -17
- package/dist/components/checkbox.js +7 -5
- package/dist/components/chip.js +15 -8
- package/dist/components/color-picker-hex-input.js +11 -3
- package/dist/components/color-picker-swatch.js +1335 -1351
- package/dist/components/conditionalSlot.js +5 -1
- package/dist/components/date-picker-day.js +4 -4
- package/dist/components/date-picker-month-header.js +35 -9
- package/dist/components/date-picker-month.js +36 -8
- package/dist/components/date-picker.js +42 -7
- package/dist/components/date.js +37 -2
- package/dist/components/debounce.js +1 -1
- package/dist/components/dom.js +18 -26
- package/dist/components/dropdown.js +104 -30
- package/dist/components/filter.js +11 -9
- package/dist/components/forIn.js +1 -1
- package/dist/components/form.js +37 -3
- package/dist/components/graph.js +30 -2
- package/dist/components/guid.js +1 -1
- package/dist/components/handle.js +7 -5
- package/dist/components/icon.js +7 -3
- package/dist/components/index.d.ts +90 -5
- package/dist/components/index.js +91 -1
- package/dist/components/input.js +126 -67
- package/dist/components/interactive.js +7 -4
- package/dist/components/interfaces.js +1 -1
- package/dist/components/interfaces2.js +1 -1
- package/dist/components/key.js +11 -0
- package/dist/components/label.js +86 -104
- package/dist/components/label2.js +112 -82
- package/dist/components/link.js +4 -3
- package/dist/components/loader.js +10 -8
- package/dist/components/locale.js +159 -37
- package/dist/components/math.js +1 -1
- package/dist/components/observers.js +1 -1
- package/dist/components/pick-list-item.js +22 -18
- package/dist/components/popover.js +145 -26
- package/dist/components/popper.js +2 -2
- package/dist/components/progress.js +4 -4
- package/dist/components/resources.js +11 -19
- package/dist/components/resources2.js +8 -6
- package/dist/components/resources3.js +25 -11
- package/dist/components/scrim.js +4 -2
- package/dist/components/shared-list-render.js +9 -21
- package/dist/components/sortable.esm.js +1 -1
- package/dist/components/switch.js +8 -6
- package/dist/components/tab-nav.js +22 -11
- package/dist/components/tab-title.js +19 -16
- package/dist/components/tab.js +11 -6
- package/dist/components/tabs.js +12 -7
- package/dist/components/tile.js +3 -2
- package/dist/components/time-picker.js +52 -22
- package/dist/components/utils.js +1 -1
- package/dist/components/utils2.js +1 -1
- package/dist/custom-elements/index.js +3830 -2719
- package/dist/esm/{ExpandToggle-847b61ba.js → ExpandToggle-baf2c551.js} +9 -7
- package/dist/esm/{Heading-f4ee0499.js → Heading-1183c4d7.js} +3 -3
- package/dist/esm/{array-328a8961.js → array-d7b2d2da.js} +1 -1
- package/dist/esm/calcite-accordion_2.entry.js +41 -26
- package/dist/esm/calcite-action-bar.entry.js +22 -16
- package/dist/esm/calcite-action-group.entry.js +11 -11
- package/dist/esm/calcite-action-menu.entry.js +32 -28
- package/dist/esm/calcite-action-pad.entry.js +20 -15
- package/dist/esm/calcite-action.entry.js +20 -15
- package/dist/esm/calcite-alert.entry.js +61 -34
- package/dist/esm/calcite-avatar.entry.js +12 -7
- package/dist/esm/calcite-block_2.entry.js +40 -18
- package/dist/esm/calcite-button.entry.js +18 -14
- package/dist/esm/calcite-card.entry.js +23 -14
- package/dist/esm/calcite-checkbox.entry.js +11 -10
- package/dist/esm/calcite-chip.entry.js +19 -13
- package/dist/esm/calcite-color-picker_3.entry.js +1396 -1352
- package/dist/esm/calcite-combobox_3.entry.js +111 -51
- package/dist/esm/calcite-date-picker_4.entry.js +115 -32
- package/dist/esm/calcite-dropdown_3.entry.js +129 -54
- package/dist/esm/calcite-fab.entry.js +6 -5
- package/dist/esm/calcite-filter.entry.js +17 -15
- package/dist/esm/calcite-flow.entry.js +12 -11
- package/dist/esm/calcite-graph_2.entry.js +57 -12
- package/dist/esm/calcite-handle.entry.js +9 -6
- package/dist/esm/calcite-icon.entry.js +10 -6
- package/dist/esm/calcite-inline-editable.entry.js +23 -19
- package/dist/esm/calcite-input-date-picker.entry.js +56 -23
- package/dist/esm/calcite-input-message.entry.js +5 -5
- package/dist/esm/calcite-input-time-picker_2.entry.js +87 -37
- package/dist/esm/calcite-input.entry.js +127 -71
- package/dist/esm/calcite-label.entry.js +13 -8
- package/dist/esm/calcite-link.entry.js +8 -7
- package/dist/esm/calcite-list_3.entry.js +13 -13
- package/dist/esm/calcite-loader.entry.js +12 -10
- package/dist/esm/calcite-modal.entry.js +46 -28
- package/dist/esm/calcite-notice.entry.js +16 -14
- package/dist/esm/calcite-option_3.entry.js +16 -16
- package/dist/esm/calcite-pagination.entry.js +97 -12
- package/dist/esm/calcite-panel.entry.js +54 -23
- package/dist/esm/calcite-pick-list_3.entry.js +47 -38
- package/dist/esm/calcite-popover_2.entry.js +155 -63
- package/dist/esm/calcite-progress.entry.js +5 -5
- package/dist/esm/calcite-radio-button-group.entry.js +3 -3
- package/dist/esm/calcite-radio-button.entry.js +13 -10
- package/dist/esm/calcite-radio-group_2.entry.js +15 -12
- package/dist/esm/calcite-rating.entry.js +33 -15
- package/dist/esm/calcite-scrim.entry.js +5 -3
- package/dist/esm/calcite-shell_3.entry.js +10 -9
- package/dist/esm/calcite-sortable-list.entry.js +5 -5
- package/dist/esm/calcite-split-button.entry.js +9 -6
- package/dist/esm/calcite-stepper_2.entry.js +175 -121
- package/dist/esm/calcite-switch.entry.js +12 -10
- package/dist/esm/calcite-tab_4.entry.js +61 -37
- package/dist/esm/calcite-tile-select_2.entry.js +8 -7
- package/dist/esm/calcite-tile.entry.js +9 -8
- package/dist/esm/calcite-tip_3.entry.js +12 -10
- package/dist/esm/calcite-tooltip_2.entry.js +188 -141
- package/dist/esm/calcite-tree_2.entry.js +35 -24
- package/dist/esm/calcite-value-list_2.entry.js +43 -35
- package/dist/esm/calcite.js +4 -4
- package/dist/esm/{conditionalSlot-a8a2c2f8.js → conditionalSlot-91141c10.js} +7 -3
- package/dist/esm/{debounce-f689f579.js → debounce-8620d992.js} +1 -1
- package/dist/esm/{dom-0dcd3a1e.js → dom-0e5130f0.js} +19 -27
- package/dist/esm/{forIn-8f588c7b.js → forIn-908ce382.js} +2 -2
- package/dist/esm/{form-2b88b33a.js → form-44145a77.js} +38 -4
- package/dist/esm/{guid-174508ff.js → guid-035850cf.js} +1 -1
- package/dist/esm/{index-221092de.js → index-7daa7f57.js} +7 -19
- package/dist/esm/index.js +1 -1
- package/dist/esm/{interactive-b11a6c05.js → interactive-26697f71.js} +7 -4
- package/dist/esm/{interfaces-2bc002ac.js → interfaces-666dcdb6.js} +1 -1
- package/dist/esm/key-5106532f.js +11 -0
- package/dist/esm/{label-2dac3c62.js → label-e58bd849.js} +26 -19
- package/dist/esm/loader.js +4 -4
- package/dist/esm/locale-bd54ff3b.js +254 -0
- package/dist/esm/{math-4cd9449e.js → math-28a370c3.js} +1 -1
- package/dist/esm/{observers-232c6ed6.js → observers-5cd6c82a.js} +1 -1
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{popper-66bcddc6.js → popper-1df5bd76.js} +2 -2
- package/dist/esm/{resources-886efb7e.js → resources-3498bd44.js} +44 -3
- package/dist/esm/{resources-8ade5fae.js → resources-b9270cdb.js} +1 -1
- package/dist/esm/{resources-762aa55a.js → resources-d196b6c1.js} +10 -22
- package/dist/esm/{resources-df870d40.js → resources-daaebdea.js} +1 -1
- package/dist/esm/{sortable.esm-0891f88f.js → sortable.esm-ef18907c.js} +1 -1
- package/dist/esm/{utils-79203b5b.js → utils-cf3669f8.js} +1 -1
- package/dist/esm-es5/{ExpandToggle-847b61ba.js → ExpandToggle-baf2c551.js} +2 -2
- package/dist/esm-es5/Heading-1183c4d7.js +6 -0
- package/dist/esm-es5/{array-328a8961.js → array-d7b2d2da.js} +1 -1
- package/dist/esm-es5/calcite-accordion_2.entry.js +2 -2
- package/dist/esm-es5/calcite-action-bar.entry.js +2 -2
- package/dist/esm-es5/calcite-action-group.entry.js +2 -2
- package/dist/esm-es5/calcite-action-menu.entry.js +2 -2
- package/dist/esm-es5/calcite-action-pad.entry.js +2 -2
- package/dist/esm-es5/calcite-action.entry.js +2 -2
- package/dist/esm-es5/calcite-alert.entry.js +3 -3
- package/dist/esm-es5/calcite-avatar.entry.js +2 -2
- package/dist/esm-es5/calcite-block_2.entry.js +2 -2
- package/dist/esm-es5/calcite-button.entry.js +2 -2
- package/dist/esm-es5/calcite-card.entry.js +2 -2
- package/dist/esm-es5/calcite-checkbox.entry.js +3 -3
- package/dist/esm-es5/calcite-chip.entry.js +3 -3
- package/dist/esm-es5/calcite-color-picker_3.entry.js +3 -3
- package/dist/esm-es5/calcite-combobox_3.entry.js +3 -3
- package/dist/esm-es5/calcite-date-picker_4.entry.js +3 -3
- package/dist/esm-es5/calcite-dropdown_3.entry.js +3 -3
- package/dist/esm-es5/calcite-fab.entry.js +2 -2
- package/dist/esm-es5/calcite-filter.entry.js +2 -2
- package/dist/esm-es5/calcite-flow.entry.js +3 -3
- package/dist/esm-es5/calcite-graph_2.entry.js +2 -2
- package/dist/esm-es5/calcite-handle.entry.js +2 -2
- package/dist/esm-es5/calcite-icon.entry.js +2 -2
- package/dist/esm-es5/calcite-inline-editable.entry.js +3 -3
- package/dist/esm-es5/calcite-input-date-picker.entry.js +3 -3
- package/dist/esm-es5/calcite-input-message.entry.js +2 -2
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +3 -3
- package/dist/esm-es5/calcite-input.entry.js +3 -3
- package/dist/esm-es5/calcite-label.entry.js +2 -2
- package/dist/esm-es5/calcite-link.entry.js +3 -3
- package/dist/esm-es5/calcite-list_3.entry.js +2 -2
- package/dist/esm-es5/calcite-loader.entry.js +3 -3
- package/dist/esm-es5/calcite-modal.entry.js +3 -3
- package/dist/esm-es5/calcite-notice.entry.js +3 -3
- package/dist/esm-es5/calcite-option_3.entry.js +2 -2
- package/dist/esm-es5/calcite-pagination.entry.js +2 -2
- package/dist/esm-es5/calcite-panel.entry.js +3 -3
- package/dist/esm-es5/calcite-pick-list_3.entry.js +3 -3
- package/dist/esm-es5/calcite-popover_2.entry.js +3 -3
- package/dist/esm-es5/calcite-progress.entry.js +2 -2
- package/dist/esm-es5/calcite-radio-button-group.entry.js +2 -2
- package/dist/esm-es5/calcite-radio-button.entry.js +2 -2
- package/dist/esm-es5/calcite-radio-group_2.entry.js +3 -3
- package/dist/esm-es5/calcite-rating.entry.js +3 -3
- package/dist/esm-es5/calcite-scrim.entry.js +2 -2
- package/dist/esm-es5/calcite-shell_3.entry.js +2 -2
- package/dist/esm-es5/calcite-sortable-list.entry.js +2 -2
- package/dist/esm-es5/calcite-split-button.entry.js +2 -2
- package/dist/esm-es5/calcite-stepper_2.entry.js +3 -3
- package/dist/esm-es5/calcite-switch.entry.js +3 -3
- package/dist/esm-es5/calcite-tab_4.entry.js +3 -3
- package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -2
- package/dist/esm-es5/calcite-tile.entry.js +2 -2
- package/dist/esm-es5/calcite-tip_3.entry.js +3 -3
- package/dist/esm-es5/calcite-tooltip_2.entry.js +3 -3
- package/dist/esm-es5/calcite-tree_2.entry.js +2 -2
- package/dist/esm-es5/calcite-value-list_2.entry.js +2 -2
- package/dist/esm-es5/calcite.js +2 -2
- package/dist/esm-es5/{conditionalSlot-a8a2c2f8.js → conditionalSlot-91141c10.js} +2 -2
- package/dist/esm-es5/{debounce-f689f579.js → debounce-8620d992.js} +1 -1
- package/dist/esm-es5/dom-0e5130f0.js +6 -0
- package/dist/esm-es5/{forIn-8f588c7b.js → forIn-908ce382.js} +2 -2
- package/dist/esm-es5/form-44145a77.js +6 -0
- package/dist/esm-es5/{guid-174508ff.js → guid-035850cf.js} +1 -1
- package/dist/esm-es5/index-7daa7f57.js +7 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{interactive-b11a6c05.js → interactive-26697f71.js} +1 -1
- package/dist/esm-es5/{interfaces-2bc002ac.js → interfaces-666dcdb6.js} +1 -1
- package/dist/esm-es5/key-5106532f.js +6 -0
- package/dist/esm-es5/label-e58bd849.js +6 -0
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/locale-bd54ff3b.js +6 -0
- package/dist/esm-es5/{math-4cd9449e.js → math-28a370c3.js} +1 -1
- package/dist/esm-es5/{observers-232c6ed6.js → observers-5cd6c82a.js} +1 -1
- package/dist/esm-es5/{popper-66bcddc6.js → popper-1df5bd76.js} +2 -2
- package/dist/esm-es5/{resources-886efb7e.js → resources-3498bd44.js} +2 -2
- package/dist/esm-es5/{resources-8ade5fae.js → resources-b9270cdb.js} +1 -1
- package/dist/esm-es5/resources-d196b6c1.js +6 -0
- package/dist/esm-es5/{resources-df870d40.js → resources-daaebdea.js} +1 -1
- package/dist/esm-es5/{sortable.esm-0891f88f.js → sortable.esm-ef18907c.js} +1 -1
- package/dist/esm-es5/{utils-79203b5b.js → utils-cf3669f8.js} +1 -1
- package/dist/extras/docs-json.d.ts +3 -0
- package/dist/extras/docs-json.json +1256 -558
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +11 -9
- package/dist/types/components/accordion-item/accordion-item.d.ts +26 -8
- package/dist/types/components/action/action.d.ts +16 -15
- package/dist/types/components/action-bar/action-bar.d.ts +14 -9
- package/dist/types/components/action-group/action-group.d.ts +7 -7
- package/dist/types/components/action-menu/action-menu.d.ts +11 -9
- package/dist/types/components/action-pad/action-pad.d.ts +15 -11
- package/dist/types/components/alert/alert.d.ts +45 -24
- package/dist/types/components/alert/resources.d.ts +3 -0
- package/dist/types/components/avatar/avatar.d.ts +5 -5
- package/dist/types/components/avatar/utils.d.ts +5 -0
- package/dist/types/components/block/block.d.ts +18 -4
- package/dist/types/components/block/resources.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +6 -3
- package/dist/types/components/card/card.d.ts +13 -4
- package/dist/types/components/card/resources.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +4 -1
- package/dist/types/components/chip/chip.d.ts +5 -1
- package/dist/types/components/chip/resources.d.ts +3 -2
- package/dist/types/components/color-picker/color-picker.d.ts +66 -23
- package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +6 -1
- package/dist/types/components/combobox/combobox.d.ts +36 -16
- package/dist/types/components/combobox/resources.d.ts +5 -0
- package/dist/types/components/combobox-item/combobox-item.d.ts +11 -1
- package/dist/types/components/date-picker/date-picker.d.ts +32 -3
- package/dist/types/components/date-picker/utils.d.ts +6 -1
- package/dist/types/components/date-picker-day/date-picker-day.d.ts +2 -1
- package/dist/types/components/date-picker-month/date-picker-month.d.ts +30 -2
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +9 -0
- package/dist/types/components/date-picker-month-header/resources.d.ts +1 -0
- package/dist/types/components/dropdown/dropdown.d.ts +34 -12
- package/dist/types/components/dropdown/resources.d.ts +3 -0
- package/dist/types/components/dropdown-group/dropdown-group.d.ts +5 -3
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +3 -3
- package/dist/types/components/fab/fab.d.ts +1 -0
- package/dist/types/components/filter/filter.d.ts +1 -1
- package/dist/types/components/filter/resources.d.ts +0 -1
- package/dist/types/components/flow/flow.d.ts +1 -1
- package/dist/types/components/graph/util.d.ts +14 -0
- package/dist/types/components/handle/handle.d.ts +1 -1
- package/dist/types/components/icon/utils.d.ts +4 -0
- package/dist/types/components/inline-editable/inline-editable.d.ts +10 -5
- package/dist/types/components/input/input.d.ts +112 -47
- package/dist/types/components/input/resources.d.ts +3 -0
- package/dist/types/components/input-date-picker/input-date-picker.d.ts +26 -6
- package/dist/types/components/input-message/input-message.d.ts +7 -3
- package/dist/types/components/input-time-picker/input-time-picker.d.ts +9 -2
- package/dist/types/components/interfaces.d.ts +1 -0
- package/dist/types/components/label/label.d.ts +7 -2
- package/dist/types/components/link/link.d.ts +2 -1
- package/dist/types/components/list/list.d.ts +3 -2
- package/dist/types/components/list-item/list-item.d.ts +9 -9
- package/dist/types/components/list-item-group/list-item-group.d.ts +2 -2
- package/dist/types/components/loader/loader.d.ts +11 -9
- package/dist/types/components/modal/modal.d.ts +44 -29
- package/dist/types/components/notice/notice.d.ts +20 -18
- package/dist/types/components/option/option.d.ts +5 -5
- package/dist/types/components/option-group/option-group.d.ts +3 -3
- package/dist/types/components/pagination/pagination.d.ts +22 -12
- package/dist/types/components/panel/panel.d.ts +41 -21
- package/dist/types/components/panel/resources.d.ts +1 -0
- package/dist/types/components/pick-list/pick-list.d.ts +19 -15
- package/dist/types/components/pick-list/shared-list-logic.d.ts +1 -1
- package/dist/types/components/pick-list-group/pick-list-group.d.ts +2 -2
- package/dist/types/components/pick-list-item/pick-list-item.d.ts +25 -19
- package/dist/types/components/popover/PopoverManager.d.ts +13 -0
- package/dist/types/components/popover/popover.d.ts +43 -22
- package/dist/types/components/popover/resources.d.ts +0 -1
- package/dist/types/components/popover-manager/popover-manager.d.ts +7 -2
- package/dist/types/components/progress/progress.d.ts +5 -5
- package/dist/types/components/radio-button/radio-button.d.ts +7 -0
- package/dist/types/components/radio-group/radio-group.d.ts +3 -0
- package/dist/types/components/radio-group-item/radio-group-item.d.ts +2 -1
- package/dist/types/components/rating/rating.d.ts +8 -2
- package/dist/types/components/scrim/scrim.d.ts +3 -1
- package/dist/types/components/shell-panel/shell-panel.d.ts +3 -0
- package/dist/types/components/slider/slider.d.ts +19 -0
- package/dist/types/components/split-button/split-button.d.ts +5 -2
- package/dist/types/components/stepper/interfaces.d.ts +10 -0
- package/dist/types/components/stepper/stepper.d.ts +27 -12
- package/dist/types/components/stepper-item/stepper-item.d.ts +29 -12
- package/dist/types/components/switch/switch.d.ts +3 -1
- package/dist/types/components/tab/tab.d.ts +6 -2
- package/dist/types/components/tab-nav/tab-nav.d.ts +15 -4
- package/dist/types/components/tab-title/tab-title.d.ts +21 -9
- package/dist/types/components/tabs/interfaces.d.ts +1 -1
- package/dist/types/components/tabs/tabs.d.ts +8 -3
- package/dist/types/components/tile/tile.d.ts +1 -0
- package/dist/types/components/time-picker/time-picker.d.ts +45 -16
- package/dist/types/components/tip-manager/tip-manager.d.ts +6 -0
- package/dist/types/components/tooltip/TooltipManager.d.ts +28 -0
- package/dist/types/components/tooltip/resources.d.ts +0 -1
- package/dist/types/components/tooltip/tooltip.d.ts +15 -13
- package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +2 -29
- package/dist/types/components/tree/tree.d.ts +14 -7
- package/dist/types/components/tree-item/tree-item.d.ts +29 -15
- package/dist/types/components/value-list/value-list.d.ts +22 -18
- package/dist/types/components/value-list-item/value-list-item.d.ts +18 -15
- package/dist/types/components.d.ts +1116 -588
- package/dist/types/preact.d.ts +70 -60
- package/dist/types/utils/conditionalSlot.d.ts +4 -0
- package/dist/types/utils/date.d.ts +35 -0
- package/dist/types/utils/dom.d.ts +14 -6
- package/dist/types/utils/form.d.ts +35 -8
- package/dist/types/utils/globalAttributes.d.ts +5 -0
- package/dist/types/utils/interactive.d.ts +7 -4
- package/dist/types/utils/label.d.ts +7 -0
- package/dist/types/utils/locale.d.ts +2 -1
- package/dist/types/utils/number.d.ts +16 -0
- package/dist/types/utils/openCloseComponent.d.ts +26 -0
- package/dist/types/utils/popper.d.ts +3 -2
- package/hydrate/index.js +4062 -2777
- package/package.json +47 -46
- package/readme.md +12 -4
- package/dist/calcite/p-023a27d2.system.entry.js +0 -6
- package/dist/calcite/p-0a6b6898.system.entry.js +0 -6
- package/dist/calcite/p-0ba791df.entry.js +0 -6
- package/dist/calcite/p-0f8c3ea0.entry.js +0 -6
- package/dist/calcite/p-1084cd40.entry.js +0 -6
- package/dist/calcite/p-117836c2.system.entry.js +0 -6
- package/dist/calcite/p-14be4304.system.entry.js +0 -6
- package/dist/calcite/p-181bd093.entry.js +0 -6
- package/dist/calcite/p-19987cfa.system.entry.js +0 -6
- package/dist/calcite/p-1d0db848.system.entry.js +0 -6
- package/dist/calcite/p-1d3ba736.system.entry.js +0 -6
- package/dist/calcite/p-21461822.entry.js +0 -6
- package/dist/calcite/p-22e1813c.entry.js +0 -6
- package/dist/calcite/p-26fc61bb.system.js +0 -6
- package/dist/calcite/p-2789e3e2.system.js +0 -6
- package/dist/calcite/p-2a4bbfa2.system.entry.js +0 -6
- package/dist/calcite/p-2bcf0f54.js +0 -6
- package/dist/calcite/p-2c0fdd49.entry.js +0 -6
- package/dist/calcite/p-2f42b00e.system.entry.js +0 -6
- package/dist/calcite/p-300c0203.system.entry.js +0 -6
- package/dist/calcite/p-3119474f.entry.js +0 -6
- package/dist/calcite/p-329ade24.system.entry.js +0 -6
- package/dist/calcite/p-33391f44.entry.js +0 -6
- package/dist/calcite/p-34a92432.system.entry.js +0 -6
- package/dist/calcite/p-34cf7a42.entry.js +0 -6
- package/dist/calcite/p-3b38f3f5.system.entry.js +0 -6
- package/dist/calcite/p-3b6e600a.entry.js +0 -6
- package/dist/calcite/p-3c732519.entry.js +0 -6
- package/dist/calcite/p-3e5f8e93.system.entry.js +0 -6
- package/dist/calcite/p-3ebff946.system.entry.js +0 -6
- package/dist/calcite/p-40334853.system.js +0 -6
- package/dist/calcite/p-469490f8.js +0 -6
- package/dist/calcite/p-482956de.entry.js +0 -6
- package/dist/calcite/p-48aa73e5.entry.js +0 -6
- package/dist/calcite/p-4a543a6e.entry.js +0 -6
- package/dist/calcite/p-4b6a7167.entry.js +0 -6
- package/dist/calcite/p-4f04264f.system.entry.js +0 -6
- package/dist/calcite/p-4f443e21.system.entry.js +0 -6
- package/dist/calcite/p-50f49b13.system.entry.js +0 -6
- package/dist/calcite/p-52c9824d.system.entry.js +0 -6
- package/dist/calcite/p-55d64bae.system.entry.js +0 -6
- package/dist/calcite/p-5857c533.system.entry.js +0 -6
- package/dist/calcite/p-608aaf1d.js +0 -6
- package/dist/calcite/p-60f78917.system.entry.js +0 -6
- package/dist/calcite/p-6294787b.system.js +0 -6
- package/dist/calcite/p-62a93131.entry.js +0 -6
- package/dist/calcite/p-6750e68e.entry.js +0 -6
- package/dist/calcite/p-678e83fe.entry.js +0 -6
- package/dist/calcite/p-693cc0cd.system.entry.js +0 -6
- package/dist/calcite/p-69fdc534.entry.js +0 -6
- package/dist/calcite/p-6c9ab1d6.system.entry.js +0 -6
- package/dist/calcite/p-6ebbdae4.entry.js +0 -6
- package/dist/calcite/p-7225f4ed.js +0 -6
- package/dist/calcite/p-7463e93d.entry.js +0 -6
- package/dist/calcite/p-7549f33d.entry.js +0 -6
- package/dist/calcite/p-8117e07b.system.js +0 -6
- package/dist/calcite/p-88f476f3.system.entry.js +0 -6
- package/dist/calcite/p-8d372581.entry.js +0 -6
- package/dist/calcite/p-8d9d8984.system.entry.js +0 -6
- package/dist/calcite/p-941b8b06.js +0 -6
- package/dist/calcite/p-948a5bba.system.entry.js +0 -6
- package/dist/calcite/p-9b7b6b30.entry.js +0 -6
- package/dist/calcite/p-9d488536.entry.js +0 -6
- package/dist/calcite/p-9da64897.system.js +0 -6
- package/dist/calcite/p-a4b72090.system.entry.js +0 -6
- package/dist/calcite/p-aad21300.system.js +0 -6
- package/dist/calcite/p-ae4a167e.system.js +0 -6
- package/dist/calcite/p-af100a3b.entry.js +0 -6
- package/dist/calcite/p-b15cde3f.js +0 -6
- package/dist/calcite/p-b3d74df1.entry.js +0 -6
- package/dist/calcite/p-b50b0f92.system.entry.js +0 -6
- package/dist/calcite/p-b6dad672.system.entry.js +0 -6
- package/dist/calcite/p-bae3c0b1.entry.js +0 -6
- package/dist/calcite/p-bc873e26.system.js +0 -6
- package/dist/calcite/p-c0ab6c20.system.entry.js +0 -6
- package/dist/calcite/p-c22bd1df.system.entry.js +0 -6
- package/dist/calcite/p-c2770291.js +0 -6
- package/dist/calcite/p-c66cce4a.js +0 -6
- package/dist/calcite/p-c82c3a08.entry.js +0 -6
- package/dist/calcite/p-c91e5ce6.system.entry.js +0 -6
- package/dist/calcite/p-cb3633ce.system.entry.js +0 -6
- package/dist/calcite/p-cc881354.entry.js +0 -6
- package/dist/calcite/p-cec925c5.system.entry.js +0 -6
- package/dist/calcite/p-d0ae73bc.system.entry.js +0 -6
- package/dist/calcite/p-d2aad5f9.system.entry.js +0 -6
- package/dist/calcite/p-d441a36b.system.js +0 -6
- package/dist/calcite/p-d668cc57.entry.js +0 -6
- package/dist/calcite/p-d8c1d1bb.system.js +0 -6
- package/dist/calcite/p-d9669187.entry.js +0 -6
- package/dist/calcite/p-da5a9916.system.entry.js +0 -6
- package/dist/calcite/p-ddc498f5.entry.js +0 -6
- package/dist/calcite/p-de040bc0.entry.js +0 -6
- package/dist/calcite/p-e21b549b.js +0 -6
- package/dist/calcite/p-e6034e51.entry.js +0 -6
- package/dist/calcite/p-e64fc8d7.entry.js +0 -6
- package/dist/calcite/p-e6b83b93.entry.js +0 -6
- package/dist/calcite/p-e8698d9f.system.entry.js +0 -6
- package/dist/calcite/p-ea09f02f.system.entry.js +0 -6
- package/dist/calcite/p-eaf8f62d.entry.js +0 -6
- package/dist/calcite/p-ec6942a8.system.entry.js +0 -6
- package/dist/calcite/p-ef8bcab3.entry.js +0 -6
- package/dist/calcite/p-f3ba8a0a.entry.js +0 -6
- package/dist/calcite/p-f5a00782.entry.js +0 -6
- package/dist/calcite/p-f753e964.entry.js +0 -6
- package/dist/calcite/p-f89876d3.system.entry.js +0 -6
- package/dist/calcite/p-fc2aa57a.system.entry.js +0 -6
- package/dist/calcite/p-ffeda3eb.system.entry.js +0 -6
- package/dist/cjs/locale-2f9c939d.js +0 -137
- package/dist/cjs/number-99949cb0.js +0 -85
- package/dist/components/number.js +0 -77
- package/dist/components/resources4.js +0 -16
- package/dist/components/resources5.js +0 -33
- package/dist/components/tooltip-manager.js +0 -172
- package/dist/esm/locale-9c18bf7f.js +0 -132
- package/dist/esm/number-a39356c7.js +0 -77
- package/dist/esm-es5/Heading-f4ee0499.js +0 -6
- package/dist/esm-es5/dom-0dcd3a1e.js +0 -6
- package/dist/esm-es5/form-2b88b33a.js +0 -6
- package/dist/esm-es5/index-221092de.js +0 -6
- package/dist/esm-es5/label-2dac3c62.js +0 -6
- package/dist/esm-es5/locale-9c18bf7f.js +0 -6
- package/dist/esm-es5/number-a39356c7.js +0 -6
- package/dist/esm-es5/resources-762aa55a.js +0 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
* v1.0.0-beta.
|
|
4
|
+
* v1.0.0-beta.84
|
|
5
5
|
*/
|
|
6
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
7
|
-
import { a as getElementDir, f as focusElement, b as getThemeName } from './dom-
|
|
8
|
-
import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './utils-
|
|
9
|
-
import { c as clamp } from './math-
|
|
10
|
-
import { u as updateHostInteraction } from './interactive-
|
|
11
|
-
import { d as debounce, i as isObject } from './debounce-
|
|
12
|
-
import './guid-
|
|
6
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7daa7f57.js';
|
|
7
|
+
import { a as getElementDir, f as focusElement, b as getThemeName } from './dom-0e5130f0.js';
|
|
8
|
+
import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './utils-cf3669f8.js';
|
|
9
|
+
import { c as clamp } from './math-28a370c3.js';
|
|
10
|
+
import { u as updateHostInteraction } from './interactive-26697f71.js';
|
|
11
|
+
import { d as debounce, i as isObject } from './debounce-8620d992.js';
|
|
12
|
+
import './guid-035850cf.js';
|
|
13
13
|
|
|
14
14
|
/** Error message constants. */
|
|
15
15
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -527,1023 +527,995 @@ function hexDouble(num) {
|
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
529
|
|
|
530
|
-
var colorName = {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
530
|
+
var colorName = {
|
|
531
|
+
"aliceblue": [240, 248, 255],
|
|
532
|
+
"antiquewhite": [250, 235, 215],
|
|
533
|
+
"aqua": [0, 255, 255],
|
|
534
|
+
"aquamarine": [127, 255, 212],
|
|
535
|
+
"azure": [240, 255, 255],
|
|
536
|
+
"beige": [245, 245, 220],
|
|
537
|
+
"bisque": [255, 228, 196],
|
|
538
|
+
"black": [0, 0, 0],
|
|
539
|
+
"blanchedalmond": [255, 235, 205],
|
|
540
|
+
"blue": [0, 0, 255],
|
|
541
|
+
"blueviolet": [138, 43, 226],
|
|
542
|
+
"brown": [165, 42, 42],
|
|
543
|
+
"burlywood": [222, 184, 135],
|
|
544
|
+
"cadetblue": [95, 158, 160],
|
|
545
|
+
"chartreuse": [127, 255, 0],
|
|
546
|
+
"chocolate": [210, 105, 30],
|
|
547
|
+
"coral": [255, 127, 80],
|
|
548
|
+
"cornflowerblue": [100, 149, 237],
|
|
549
|
+
"cornsilk": [255, 248, 220],
|
|
550
|
+
"crimson": [220, 20, 60],
|
|
551
|
+
"cyan": [0, 255, 255],
|
|
552
|
+
"darkblue": [0, 0, 139],
|
|
553
|
+
"darkcyan": [0, 139, 139],
|
|
554
|
+
"darkgoldenrod": [184, 134, 11],
|
|
555
|
+
"darkgray": [169, 169, 169],
|
|
556
|
+
"darkgreen": [0, 100, 0],
|
|
557
|
+
"darkgrey": [169, 169, 169],
|
|
558
|
+
"darkkhaki": [189, 183, 107],
|
|
559
|
+
"darkmagenta": [139, 0, 139],
|
|
560
|
+
"darkolivegreen": [85, 107, 47],
|
|
561
|
+
"darkorange": [255, 140, 0],
|
|
562
|
+
"darkorchid": [153, 50, 204],
|
|
563
|
+
"darkred": [139, 0, 0],
|
|
564
|
+
"darksalmon": [233, 150, 122],
|
|
565
|
+
"darkseagreen": [143, 188, 143],
|
|
566
|
+
"darkslateblue": [72, 61, 139],
|
|
567
|
+
"darkslategray": [47, 79, 79],
|
|
568
|
+
"darkslategrey": [47, 79, 79],
|
|
569
|
+
"darkturquoise": [0, 206, 209],
|
|
570
|
+
"darkviolet": [148, 0, 211],
|
|
571
|
+
"deeppink": [255, 20, 147],
|
|
572
|
+
"deepskyblue": [0, 191, 255],
|
|
573
|
+
"dimgray": [105, 105, 105],
|
|
574
|
+
"dimgrey": [105, 105, 105],
|
|
575
|
+
"dodgerblue": [30, 144, 255],
|
|
576
|
+
"firebrick": [178, 34, 34],
|
|
577
|
+
"floralwhite": [255, 250, 240],
|
|
578
|
+
"forestgreen": [34, 139, 34],
|
|
579
|
+
"fuchsia": [255, 0, 255],
|
|
580
|
+
"gainsboro": [220, 220, 220],
|
|
581
|
+
"ghostwhite": [248, 248, 255],
|
|
582
|
+
"gold": [255, 215, 0],
|
|
583
|
+
"goldenrod": [218, 165, 32],
|
|
584
|
+
"gray": [128, 128, 128],
|
|
585
|
+
"green": [0, 128, 0],
|
|
586
|
+
"greenyellow": [173, 255, 47],
|
|
587
|
+
"grey": [128, 128, 128],
|
|
588
|
+
"honeydew": [240, 255, 240],
|
|
589
|
+
"hotpink": [255, 105, 180],
|
|
590
|
+
"indianred": [205, 92, 92],
|
|
591
|
+
"indigo": [75, 0, 130],
|
|
592
|
+
"ivory": [255, 255, 240],
|
|
593
|
+
"khaki": [240, 230, 140],
|
|
594
|
+
"lavender": [230, 230, 250],
|
|
595
|
+
"lavenderblush": [255, 240, 245],
|
|
596
|
+
"lawngreen": [124, 252, 0],
|
|
597
|
+
"lemonchiffon": [255, 250, 205],
|
|
598
|
+
"lightblue": [173, 216, 230],
|
|
599
|
+
"lightcoral": [240, 128, 128],
|
|
600
|
+
"lightcyan": [224, 255, 255],
|
|
601
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
602
|
+
"lightgray": [211, 211, 211],
|
|
603
|
+
"lightgreen": [144, 238, 144],
|
|
604
|
+
"lightgrey": [211, 211, 211],
|
|
605
|
+
"lightpink": [255, 182, 193],
|
|
606
|
+
"lightsalmon": [255, 160, 122],
|
|
607
|
+
"lightseagreen": [32, 178, 170],
|
|
608
|
+
"lightskyblue": [135, 206, 250],
|
|
609
|
+
"lightslategray": [119, 136, 153],
|
|
610
|
+
"lightslategrey": [119, 136, 153],
|
|
611
|
+
"lightsteelblue": [176, 196, 222],
|
|
612
|
+
"lightyellow": [255, 255, 224],
|
|
613
|
+
"lime": [0, 255, 0],
|
|
614
|
+
"limegreen": [50, 205, 50],
|
|
615
|
+
"linen": [250, 240, 230],
|
|
616
|
+
"magenta": [255, 0, 255],
|
|
617
|
+
"maroon": [128, 0, 0],
|
|
618
|
+
"mediumaquamarine": [102, 205, 170],
|
|
619
|
+
"mediumblue": [0, 0, 205],
|
|
620
|
+
"mediumorchid": [186, 85, 211],
|
|
621
|
+
"mediumpurple": [147, 112, 219],
|
|
622
|
+
"mediumseagreen": [60, 179, 113],
|
|
623
|
+
"mediumslateblue": [123, 104, 238],
|
|
624
|
+
"mediumspringgreen": [0, 250, 154],
|
|
625
|
+
"mediumturquoise": [72, 209, 204],
|
|
626
|
+
"mediumvioletred": [199, 21, 133],
|
|
627
|
+
"midnightblue": [25, 25, 112],
|
|
628
|
+
"mintcream": [245, 255, 250],
|
|
629
|
+
"mistyrose": [255, 228, 225],
|
|
630
|
+
"moccasin": [255, 228, 181],
|
|
631
|
+
"navajowhite": [255, 222, 173],
|
|
632
|
+
"navy": [0, 0, 128],
|
|
633
|
+
"oldlace": [253, 245, 230],
|
|
634
|
+
"olive": [128, 128, 0],
|
|
635
|
+
"olivedrab": [107, 142, 35],
|
|
636
|
+
"orange": [255, 165, 0],
|
|
637
|
+
"orangered": [255, 69, 0],
|
|
638
|
+
"orchid": [218, 112, 214],
|
|
639
|
+
"palegoldenrod": [238, 232, 170],
|
|
640
|
+
"palegreen": [152, 251, 152],
|
|
641
|
+
"paleturquoise": [175, 238, 238],
|
|
642
|
+
"palevioletred": [219, 112, 147],
|
|
643
|
+
"papayawhip": [255, 239, 213],
|
|
644
|
+
"peachpuff": [255, 218, 185],
|
|
645
|
+
"peru": [205, 133, 63],
|
|
646
|
+
"pink": [255, 192, 203],
|
|
647
|
+
"plum": [221, 160, 221],
|
|
648
|
+
"powderblue": [176, 224, 230],
|
|
649
|
+
"purple": [128, 0, 128],
|
|
650
|
+
"rebeccapurple": [102, 51, 153],
|
|
651
|
+
"red": [255, 0, 0],
|
|
652
|
+
"rosybrown": [188, 143, 143],
|
|
653
|
+
"royalblue": [65, 105, 225],
|
|
654
|
+
"saddlebrown": [139, 69, 19],
|
|
655
|
+
"salmon": [250, 128, 114],
|
|
656
|
+
"sandybrown": [244, 164, 96],
|
|
657
|
+
"seagreen": [46, 139, 87],
|
|
658
|
+
"seashell": [255, 245, 238],
|
|
659
|
+
"sienna": [160, 82, 45],
|
|
660
|
+
"silver": [192, 192, 192],
|
|
661
|
+
"skyblue": [135, 206, 235],
|
|
662
|
+
"slateblue": [106, 90, 205],
|
|
663
|
+
"slategray": [112, 128, 144],
|
|
664
|
+
"slategrey": [112, 128, 144],
|
|
665
|
+
"snow": [255, 250, 250],
|
|
666
|
+
"springgreen": [0, 255, 127],
|
|
667
|
+
"steelblue": [70, 130, 180],
|
|
668
|
+
"tan": [210, 180, 140],
|
|
669
|
+
"teal": [0, 128, 128],
|
|
670
|
+
"thistle": [216, 191, 216],
|
|
671
|
+
"tomato": [255, 99, 71],
|
|
672
|
+
"turquoise": [64, 224, 208],
|
|
673
|
+
"violet": [238, 130, 238],
|
|
674
|
+
"wheat": [245, 222, 179],
|
|
675
|
+
"white": [255, 255, 255],
|
|
676
|
+
"whitesmoke": [245, 245, 245],
|
|
677
|
+
"yellow": [255, 255, 0],
|
|
678
|
+
"yellowgreen": [154, 205, 50]
|
|
679
679
|
};
|
|
680
680
|
|
|
681
681
|
/* MIT license */
|
|
682
|
-
|
|
683
682
|
/* eslint-disable no-mixed-operators */
|
|
683
|
+
|
|
684
|
+
|
|
684
685
|
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
685
686
|
// values that give correct `typeof` results).
|
|
686
687
|
// do not use box values types (i.e. Number(), String(), etc.)
|
|
687
688
|
|
|
688
689
|
const reverseKeywords = {};
|
|
689
|
-
|
|
690
690
|
for (const key of Object.keys(colorName)) {
|
|
691
|
-
|
|
691
|
+
reverseKeywords[colorName[key]] = key;
|
|
692
692
|
}
|
|
693
693
|
|
|
694
694
|
const convert$1 = {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
xyz: {
|
|
716
|
-
channels: 3,
|
|
717
|
-
labels: 'xyz'
|
|
718
|
-
},
|
|
719
|
-
lab: {
|
|
720
|
-
channels: 3,
|
|
721
|
-
labels: 'lab'
|
|
722
|
-
},
|
|
723
|
-
lch: {
|
|
724
|
-
channels: 3,
|
|
725
|
-
labels: 'lch'
|
|
726
|
-
},
|
|
727
|
-
hex: {
|
|
728
|
-
channels: 1,
|
|
729
|
-
labels: ['hex']
|
|
730
|
-
},
|
|
731
|
-
keyword: {
|
|
732
|
-
channels: 1,
|
|
733
|
-
labels: ['keyword']
|
|
734
|
-
},
|
|
735
|
-
ansi16: {
|
|
736
|
-
channels: 1,
|
|
737
|
-
labels: ['ansi16']
|
|
738
|
-
},
|
|
739
|
-
ansi256: {
|
|
740
|
-
channels: 1,
|
|
741
|
-
labels: ['ansi256']
|
|
742
|
-
},
|
|
743
|
-
hcg: {
|
|
744
|
-
channels: 3,
|
|
745
|
-
labels: ['h', 'c', 'g']
|
|
746
|
-
},
|
|
747
|
-
apple: {
|
|
748
|
-
channels: 3,
|
|
749
|
-
labels: ['r16', 'g16', 'b16']
|
|
750
|
-
},
|
|
751
|
-
gray: {
|
|
752
|
-
channels: 1,
|
|
753
|
-
labels: ['gray']
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
var conversions = convert$1; // Hide .channels and .labels properties
|
|
757
|
-
|
|
695
|
+
rgb: {channels: 3, labels: 'rgb'},
|
|
696
|
+
hsl: {channels: 3, labels: 'hsl'},
|
|
697
|
+
hsv: {channels: 3, labels: 'hsv'},
|
|
698
|
+
hwb: {channels: 3, labels: 'hwb'},
|
|
699
|
+
cmyk: {channels: 4, labels: 'cmyk'},
|
|
700
|
+
xyz: {channels: 3, labels: 'xyz'},
|
|
701
|
+
lab: {channels: 3, labels: 'lab'},
|
|
702
|
+
lch: {channels: 3, labels: 'lch'},
|
|
703
|
+
hex: {channels: 1, labels: ['hex']},
|
|
704
|
+
keyword: {channels: 1, labels: ['keyword']},
|
|
705
|
+
ansi16: {channels: 1, labels: ['ansi16']},
|
|
706
|
+
ansi256: {channels: 1, labels: ['ansi256']},
|
|
707
|
+
hcg: {channels: 3, labels: ['h', 'c', 'g']},
|
|
708
|
+
apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
|
|
709
|
+
gray: {channels: 1, labels: ['gray']}
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
var conversions = convert$1;
|
|
713
|
+
|
|
714
|
+
// Hide .channels and .labels properties
|
|
758
715
|
for (const model of Object.keys(convert$1)) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
716
|
+
if (!('channels' in convert$1[model])) {
|
|
717
|
+
throw new Error('missing channels property: ' + model);
|
|
718
|
+
}
|
|
762
719
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
720
|
+
if (!('labels' in convert$1[model])) {
|
|
721
|
+
throw new Error('missing channel labels property: ' + model);
|
|
722
|
+
}
|
|
766
723
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
724
|
+
if (convert$1[model].labels.length !== convert$1[model].channels) {
|
|
725
|
+
throw new Error('channel and label counts mismatch: ' + model);
|
|
726
|
+
}
|
|
770
727
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
delete convert$1[model].labels;
|
|
777
|
-
Object.defineProperty(convert$1[model], 'channels', {
|
|
778
|
-
value: channels
|
|
779
|
-
});
|
|
780
|
-
Object.defineProperty(convert$1[model], 'labels', {
|
|
781
|
-
value: labels
|
|
782
|
-
});
|
|
728
|
+
const {channels, labels} = convert$1[model];
|
|
729
|
+
delete convert$1[model].channels;
|
|
730
|
+
delete convert$1[model].labels;
|
|
731
|
+
Object.defineProperty(convert$1[model], 'channels', {value: channels});
|
|
732
|
+
Object.defineProperty(convert$1[model], 'labels', {value: labels});
|
|
783
733
|
}
|
|
784
734
|
|
|
785
735
|
convert$1.rgb.hsl = function (rgb) {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
736
|
+
const r = rgb[0] / 255;
|
|
737
|
+
const g = rgb[1] / 255;
|
|
738
|
+
const b = rgb[2] / 255;
|
|
739
|
+
const min = Math.min(r, g, b);
|
|
740
|
+
const max = Math.max(r, g, b);
|
|
741
|
+
const delta = max - min;
|
|
742
|
+
let h;
|
|
743
|
+
let s;
|
|
744
|
+
|
|
745
|
+
if (max === min) {
|
|
746
|
+
h = 0;
|
|
747
|
+
} else if (r === max) {
|
|
748
|
+
h = (g - b) / delta;
|
|
749
|
+
} else if (g === max) {
|
|
750
|
+
h = 2 + (b - r) / delta;
|
|
751
|
+
} else if (b === max) {
|
|
752
|
+
h = 4 + (r - g) / delta;
|
|
753
|
+
}
|
|
804
754
|
|
|
805
|
-
|
|
755
|
+
h = Math.min(h * 60, 360);
|
|
806
756
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
757
|
+
if (h < 0) {
|
|
758
|
+
h += 360;
|
|
759
|
+
}
|
|
810
760
|
|
|
811
|
-
|
|
761
|
+
const l = (min + max) / 2;
|
|
812
762
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
763
|
+
if (max === min) {
|
|
764
|
+
s = 0;
|
|
765
|
+
} else if (l <= 0.5) {
|
|
766
|
+
s = delta / (max + min);
|
|
767
|
+
} else {
|
|
768
|
+
s = delta / (2 - max - min);
|
|
769
|
+
}
|
|
820
770
|
|
|
821
|
-
|
|
771
|
+
return [h, s * 100, l * 100];
|
|
822
772
|
};
|
|
823
773
|
|
|
824
774
|
convert$1.rgb.hsv = function (rgb) {
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
if (diff === 0) {
|
|
841
|
-
h = 0;
|
|
842
|
-
s = 0;
|
|
843
|
-
} else {
|
|
844
|
-
s = diff / v;
|
|
845
|
-
rdif = diffc(r);
|
|
846
|
-
gdif = diffc(g);
|
|
847
|
-
bdif = diffc(b);
|
|
848
|
-
|
|
849
|
-
if (r === v) {
|
|
850
|
-
h = bdif - gdif;
|
|
851
|
-
} else if (g === v) {
|
|
852
|
-
h = 1 / 3 + rdif - bdif;
|
|
853
|
-
} else if (b === v) {
|
|
854
|
-
h = 2 / 3 + gdif - rdif;
|
|
855
|
-
}
|
|
775
|
+
let rdif;
|
|
776
|
+
let gdif;
|
|
777
|
+
let bdif;
|
|
778
|
+
let h;
|
|
779
|
+
let s;
|
|
780
|
+
|
|
781
|
+
const r = rgb[0] / 255;
|
|
782
|
+
const g = rgb[1] / 255;
|
|
783
|
+
const b = rgb[2] / 255;
|
|
784
|
+
const v = Math.max(r, g, b);
|
|
785
|
+
const diff = v - Math.min(r, g, b);
|
|
786
|
+
const diffc = function (c) {
|
|
787
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
788
|
+
};
|
|
856
789
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
790
|
+
if (diff === 0) {
|
|
791
|
+
h = 0;
|
|
792
|
+
s = 0;
|
|
793
|
+
} else {
|
|
794
|
+
s = diff / v;
|
|
795
|
+
rdif = diffc(r);
|
|
796
|
+
gdif = diffc(g);
|
|
797
|
+
bdif = diffc(b);
|
|
798
|
+
|
|
799
|
+
if (r === v) {
|
|
800
|
+
h = bdif - gdif;
|
|
801
|
+
} else if (g === v) {
|
|
802
|
+
h = (1 / 3) + rdif - bdif;
|
|
803
|
+
} else if (b === v) {
|
|
804
|
+
h = (2 / 3) + gdif - rdif;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if (h < 0) {
|
|
808
|
+
h += 1;
|
|
809
|
+
} else if (h > 1) {
|
|
810
|
+
h -= 1;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
863
813
|
|
|
864
|
-
|
|
814
|
+
return [
|
|
815
|
+
h * 360,
|
|
816
|
+
s * 100,
|
|
817
|
+
v * 100
|
|
818
|
+
];
|
|
865
819
|
};
|
|
866
820
|
|
|
867
821
|
convert$1.rgb.hwb = function (rgb) {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
822
|
+
const r = rgb[0];
|
|
823
|
+
const g = rgb[1];
|
|
824
|
+
let b = rgb[2];
|
|
825
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
826
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
827
|
+
|
|
828
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
829
|
+
|
|
830
|
+
return [h, w * 100, b * 100];
|
|
875
831
|
};
|
|
876
832
|
|
|
877
833
|
convert$1.rgb.cmyk = function (rgb) {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
834
|
+
const r = rgb[0] / 255;
|
|
835
|
+
const g = rgb[1] / 255;
|
|
836
|
+
const b = rgb[2] / 255;
|
|
837
|
+
|
|
838
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
839
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
840
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
841
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
842
|
+
|
|
843
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
886
844
|
};
|
|
887
845
|
|
|
888
846
|
function comparativeDistance(x, y) {
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
847
|
+
/*
|
|
848
|
+
See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
|
849
|
+
*/
|
|
850
|
+
return (
|
|
851
|
+
((x[0] - y[0]) ** 2) +
|
|
852
|
+
((x[1] - y[1]) ** 2) +
|
|
853
|
+
((x[2] - y[2]) ** 2)
|
|
854
|
+
);
|
|
893
855
|
}
|
|
894
856
|
|
|
895
857
|
convert$1.rgb.keyword = function (rgb) {
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}
|
|
858
|
+
const reversed = reverseKeywords[rgb];
|
|
859
|
+
if (reversed) {
|
|
860
|
+
return reversed;
|
|
861
|
+
}
|
|
901
862
|
|
|
902
|
-
|
|
903
|
-
|
|
863
|
+
let currentClosestDistance = Infinity;
|
|
864
|
+
let currentClosestKeyword;
|
|
904
865
|
|
|
905
|
-
|
|
906
|
-
|
|
866
|
+
for (const keyword of Object.keys(colorName)) {
|
|
867
|
+
const value = colorName[keyword];
|
|
907
868
|
|
|
908
|
-
|
|
869
|
+
// Compute comparative distance
|
|
870
|
+
const distance = comparativeDistance(rgb, value);
|
|
909
871
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
872
|
+
// Check if its less, if so set as closest
|
|
873
|
+
if (distance < currentClosestDistance) {
|
|
874
|
+
currentClosestDistance = distance;
|
|
875
|
+
currentClosestKeyword = keyword;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
915
878
|
|
|
916
|
-
|
|
879
|
+
return currentClosestKeyword;
|
|
917
880
|
};
|
|
918
881
|
|
|
919
882
|
convert$1.keyword.rgb = function (keyword) {
|
|
920
|
-
|
|
883
|
+
return colorName[keyword];
|
|
921
884
|
};
|
|
922
885
|
|
|
923
886
|
convert$1.rgb.xyz = function (rgb) {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
887
|
+
let r = rgb[0] / 255;
|
|
888
|
+
let g = rgb[1] / 255;
|
|
889
|
+
let b = rgb[2] / 255;
|
|
890
|
+
|
|
891
|
+
// Assume sRGB
|
|
892
|
+
r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
|
|
893
|
+
g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
|
|
894
|
+
b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
|
|
927
895
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
934
|
-
return [x * 100, y * 100, z * 100];
|
|
896
|
+
const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
|
|
897
|
+
const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
|
|
898
|
+
const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
|
|
899
|
+
|
|
900
|
+
return [x * 100, y * 100, z * 100];
|
|
935
901
|
};
|
|
936
902
|
|
|
937
903
|
convert$1.rgb.lab = function (rgb) {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
904
|
+
const xyz = convert$1.rgb.xyz(rgb);
|
|
905
|
+
let x = xyz[0];
|
|
906
|
+
let y = xyz[1];
|
|
907
|
+
let z = xyz[2];
|
|
908
|
+
|
|
909
|
+
x /= 95.047;
|
|
910
|
+
y /= 100;
|
|
911
|
+
z /= 108.883;
|
|
912
|
+
|
|
913
|
+
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
|
914
|
+
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
|
915
|
+
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
|
916
|
+
|
|
917
|
+
const l = (116 * y) - 16;
|
|
918
|
+
const a = 500 * (x - y);
|
|
919
|
+
const b = 200 * (y - z);
|
|
920
|
+
|
|
921
|
+
return [l, a, b];
|
|
952
922
|
};
|
|
953
923
|
|
|
954
924
|
convert$1.hsl.rgb = function (hsl) {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
if (l < 0.5) {
|
|
968
|
-
t2 = l * (1 + s);
|
|
969
|
-
} else {
|
|
970
|
-
t2 = l + s - l * s;
|
|
971
|
-
}
|
|
925
|
+
const h = hsl[0] / 360;
|
|
926
|
+
const s = hsl[1] / 100;
|
|
927
|
+
const l = hsl[2] / 100;
|
|
928
|
+
let t2;
|
|
929
|
+
let t3;
|
|
930
|
+
let val;
|
|
931
|
+
|
|
932
|
+
if (s === 0) {
|
|
933
|
+
val = l * 255;
|
|
934
|
+
return [val, val, val];
|
|
935
|
+
}
|
|
972
936
|
|
|
973
|
-
|
|
974
|
-
|
|
937
|
+
if (l < 0.5) {
|
|
938
|
+
t2 = l * (1 + s);
|
|
939
|
+
} else {
|
|
940
|
+
t2 = l + s - l * s;
|
|
941
|
+
}
|
|
975
942
|
|
|
976
|
-
|
|
977
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
943
|
+
const t1 = 2 * l - t2;
|
|
978
944
|
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
945
|
+
const rgb = [0, 0, 0];
|
|
946
|
+
for (let i = 0; i < 3; i++) {
|
|
947
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
948
|
+
if (t3 < 0) {
|
|
949
|
+
t3++;
|
|
950
|
+
}
|
|
982
951
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
952
|
+
if (t3 > 1) {
|
|
953
|
+
t3--;
|
|
954
|
+
}
|
|
986
955
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
956
|
+
if (6 * t3 < 1) {
|
|
957
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
958
|
+
} else if (2 * t3 < 1) {
|
|
959
|
+
val = t2;
|
|
960
|
+
} else if (3 * t3 < 2) {
|
|
961
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
962
|
+
} else {
|
|
963
|
+
val = t1;
|
|
964
|
+
}
|
|
996
965
|
|
|
997
|
-
|
|
998
|
-
|
|
966
|
+
rgb[i] = val * 255;
|
|
967
|
+
}
|
|
999
968
|
|
|
1000
|
-
|
|
969
|
+
return rgb;
|
|
1001
970
|
};
|
|
1002
971
|
|
|
1003
972
|
convert$1.hsl.hsv = function (hsl) {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
973
|
+
const h = hsl[0];
|
|
974
|
+
let s = hsl[1] / 100;
|
|
975
|
+
let l = hsl[2] / 100;
|
|
976
|
+
let smin = s;
|
|
977
|
+
const lmin = Math.max(l, 0.01);
|
|
978
|
+
|
|
979
|
+
l *= 2;
|
|
980
|
+
s *= (l <= 1) ? l : 2 - l;
|
|
981
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
982
|
+
const v = (l + s) / 2;
|
|
983
|
+
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
|
984
|
+
|
|
985
|
+
return [h, sv * 100, v * 100];
|
|
1015
986
|
};
|
|
1016
987
|
|
|
1017
988
|
convert$1.hsv.rgb = function (hsv) {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
case 5:
|
|
1045
|
-
return [v, p, q];
|
|
1046
|
-
}
|
|
989
|
+
const h = hsv[0] / 60;
|
|
990
|
+
const s = hsv[1] / 100;
|
|
991
|
+
let v = hsv[2] / 100;
|
|
992
|
+
const hi = Math.floor(h) % 6;
|
|
993
|
+
|
|
994
|
+
const f = h - Math.floor(h);
|
|
995
|
+
const p = 255 * v * (1 - s);
|
|
996
|
+
const q = 255 * v * (1 - (s * f));
|
|
997
|
+
const t = 255 * v * (1 - (s * (1 - f)));
|
|
998
|
+
v *= 255;
|
|
999
|
+
|
|
1000
|
+
switch (hi) {
|
|
1001
|
+
case 0:
|
|
1002
|
+
return [v, t, p];
|
|
1003
|
+
case 1:
|
|
1004
|
+
return [q, v, p];
|
|
1005
|
+
case 2:
|
|
1006
|
+
return [p, v, t];
|
|
1007
|
+
case 3:
|
|
1008
|
+
return [p, q, v];
|
|
1009
|
+
case 4:
|
|
1010
|
+
return [t, p, v];
|
|
1011
|
+
case 5:
|
|
1012
|
+
return [v, p, q];
|
|
1013
|
+
}
|
|
1047
1014
|
};
|
|
1048
1015
|
|
|
1049
1016
|
convert$1.hsv.hsl = function (hsv) {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
l = (2 - s) * v;
|
|
1057
|
-
const lmin = (2 - s) * vmin;
|
|
1058
|
-
sl = s * vmin;
|
|
1059
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1060
|
-
sl = sl || 0;
|
|
1061
|
-
l /= 2;
|
|
1062
|
-
return [h, sl * 100, l * 100];
|
|
1063
|
-
}; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
1017
|
+
const h = hsv[0];
|
|
1018
|
+
const s = hsv[1] / 100;
|
|
1019
|
+
const v = hsv[2] / 100;
|
|
1020
|
+
const vmin = Math.max(v, 0.01);
|
|
1021
|
+
let sl;
|
|
1022
|
+
let l;
|
|
1064
1023
|
|
|
1024
|
+
l = (2 - s) * v;
|
|
1025
|
+
const lmin = (2 - s) * vmin;
|
|
1026
|
+
sl = s * vmin;
|
|
1027
|
+
sl /= (lmin <= 1) ? lmin : 2 - lmin;
|
|
1028
|
+
sl = sl || 0;
|
|
1029
|
+
l /= 2;
|
|
1065
1030
|
|
|
1031
|
+
return [h, sl * 100, l * 100];
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
1066
1035
|
convert$1.hwb.rgb = function (hwb) {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1036
|
+
const h = hwb[0] / 360;
|
|
1037
|
+
let wh = hwb[1] / 100;
|
|
1038
|
+
let bl = hwb[2] / 100;
|
|
1039
|
+
const ratio = wh + bl;
|
|
1040
|
+
let f;
|
|
1041
|
+
|
|
1042
|
+
// Wh + bl cant be > 1
|
|
1043
|
+
if (ratio > 1) {
|
|
1044
|
+
wh /= ratio;
|
|
1045
|
+
bl /= ratio;
|
|
1046
|
+
}
|
|
1077
1047
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1048
|
+
const i = Math.floor(6 * h);
|
|
1049
|
+
const v = 1 - bl;
|
|
1050
|
+
f = 6 * h - i;
|
|
1081
1051
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1052
|
+
if ((i & 0x01) !== 0) {
|
|
1053
|
+
f = 1 - f;
|
|
1054
|
+
}
|
|
1085
1055
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
let r;
|
|
1089
|
-
let g;
|
|
1090
|
-
let b;
|
|
1091
|
-
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
|
1092
|
-
|
|
1093
|
-
switch (i) {
|
|
1094
|
-
default:
|
|
1095
|
-
case 6:
|
|
1096
|
-
case 0:
|
|
1097
|
-
r = v;
|
|
1098
|
-
g = n;
|
|
1099
|
-
b = wh;
|
|
1100
|
-
break;
|
|
1101
|
-
|
|
1102
|
-
case 1:
|
|
1103
|
-
r = n;
|
|
1104
|
-
g = v;
|
|
1105
|
-
b = wh;
|
|
1106
|
-
break;
|
|
1107
|
-
|
|
1108
|
-
case 2:
|
|
1109
|
-
r = wh;
|
|
1110
|
-
g = v;
|
|
1111
|
-
b = n;
|
|
1112
|
-
break;
|
|
1113
|
-
|
|
1114
|
-
case 3:
|
|
1115
|
-
r = wh;
|
|
1116
|
-
g = n;
|
|
1117
|
-
b = v;
|
|
1118
|
-
break;
|
|
1119
|
-
|
|
1120
|
-
case 4:
|
|
1121
|
-
r = n;
|
|
1122
|
-
g = wh;
|
|
1123
|
-
b = v;
|
|
1124
|
-
break;
|
|
1125
|
-
|
|
1126
|
-
case 5:
|
|
1127
|
-
r = v;
|
|
1128
|
-
g = wh;
|
|
1129
|
-
b = n;
|
|
1130
|
-
break;
|
|
1131
|
-
}
|
|
1132
|
-
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
|
1056
|
+
const n = wh + f * (v - wh); // Linear interpolation
|
|
1133
1057
|
|
|
1058
|
+
let r;
|
|
1059
|
+
let g;
|
|
1060
|
+
let b;
|
|
1061
|
+
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
|
1062
|
+
switch (i) {
|
|
1063
|
+
default:
|
|
1064
|
+
case 6:
|
|
1065
|
+
case 0: r = v; g = n; b = wh; break;
|
|
1066
|
+
case 1: r = n; g = v; b = wh; break;
|
|
1067
|
+
case 2: r = wh; g = v; b = n; break;
|
|
1068
|
+
case 3: r = wh; g = n; b = v; break;
|
|
1069
|
+
case 4: r = n; g = wh; b = v; break;
|
|
1070
|
+
case 5: r = v; g = wh; b = n; break;
|
|
1071
|
+
}
|
|
1072
|
+
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
|
1134
1073
|
|
|
1135
|
-
|
|
1074
|
+
return [r * 255, g * 255, b * 255];
|
|
1136
1075
|
};
|
|
1137
1076
|
|
|
1138
1077
|
convert$1.cmyk.rgb = function (cmyk) {
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1078
|
+
const c = cmyk[0] / 100;
|
|
1079
|
+
const m = cmyk[1] / 100;
|
|
1080
|
+
const y = cmyk[2] / 100;
|
|
1081
|
+
const k = cmyk[3] / 100;
|
|
1082
|
+
|
|
1083
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1084
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1085
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1086
|
+
|
|
1087
|
+
return [r * 255, g * 255, b * 255];
|
|
1147
1088
|
};
|
|
1148
1089
|
|
|
1149
1090
|
convert$1.xyz.rgb = function (xyz) {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1091
|
+
const x = xyz[0] / 100;
|
|
1092
|
+
const y = xyz[1] / 100;
|
|
1093
|
+
const z = xyz[2] / 100;
|
|
1094
|
+
let r;
|
|
1095
|
+
let g;
|
|
1096
|
+
let b;
|
|
1097
|
+
|
|
1098
|
+
r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
|
|
1099
|
+
g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
|
|
1100
|
+
b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
|
|
1101
|
+
|
|
1102
|
+
// Assume sRGB
|
|
1103
|
+
r = r > 0.0031308
|
|
1104
|
+
? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
|
|
1105
|
+
: r * 12.92;
|
|
1106
|
+
|
|
1107
|
+
g = g > 0.0031308
|
|
1108
|
+
? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
|
|
1109
|
+
: g * 12.92;
|
|
1110
|
+
|
|
1111
|
+
b = b > 0.0031308
|
|
1112
|
+
? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
|
|
1113
|
+
: b * 12.92;
|
|
1114
|
+
|
|
1115
|
+
r = Math.min(Math.max(0, r), 1);
|
|
1116
|
+
g = Math.min(Math.max(0, g), 1);
|
|
1117
|
+
b = Math.min(Math.max(0, b), 1);
|
|
1118
|
+
|
|
1119
|
+
return [r * 255, g * 255, b * 255];
|
|
1167
1120
|
};
|
|
1168
1121
|
|
|
1169
1122
|
convert$1.xyz.lab = function (xyz) {
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1123
|
+
let x = xyz[0];
|
|
1124
|
+
let y = xyz[1];
|
|
1125
|
+
let z = xyz[2];
|
|
1126
|
+
|
|
1127
|
+
x /= 95.047;
|
|
1128
|
+
y /= 100;
|
|
1129
|
+
z /= 108.883;
|
|
1130
|
+
|
|
1131
|
+
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
|
1132
|
+
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
|
1133
|
+
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
|
1134
|
+
|
|
1135
|
+
const l = (116 * y) - 16;
|
|
1136
|
+
const a = 500 * (x - y);
|
|
1137
|
+
const b = 200 * (y - z);
|
|
1138
|
+
|
|
1139
|
+
return [l, a, b];
|
|
1183
1140
|
};
|
|
1184
1141
|
|
|
1185
1142
|
convert$1.lab.xyz = function (lab) {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1143
|
+
const l = lab[0];
|
|
1144
|
+
const a = lab[1];
|
|
1145
|
+
const b = lab[2];
|
|
1146
|
+
let x;
|
|
1147
|
+
let y;
|
|
1148
|
+
let z;
|
|
1149
|
+
|
|
1150
|
+
y = (l + 16) / 116;
|
|
1151
|
+
x = a / 500 + y;
|
|
1152
|
+
z = y - b / 200;
|
|
1153
|
+
|
|
1154
|
+
const y2 = y ** 3;
|
|
1155
|
+
const x2 = x ** 3;
|
|
1156
|
+
const z2 = z ** 3;
|
|
1157
|
+
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1158
|
+
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1159
|
+
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1160
|
+
|
|
1161
|
+
x *= 95.047;
|
|
1162
|
+
y *= 100;
|
|
1163
|
+
z *= 108.883;
|
|
1164
|
+
|
|
1165
|
+
return [x, y, z];
|
|
1205
1166
|
};
|
|
1206
1167
|
|
|
1207
1168
|
convert$1.lab.lch = function (lab) {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1169
|
+
const l = lab[0];
|
|
1170
|
+
const a = lab[1];
|
|
1171
|
+
const b = lab[2];
|
|
1172
|
+
let h;
|
|
1173
|
+
|
|
1174
|
+
const hr = Math.atan2(b, a);
|
|
1175
|
+
h = hr * 360 / 2 / Math.PI;
|
|
1176
|
+
|
|
1177
|
+
if (h < 0) {
|
|
1178
|
+
h += 360;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
const c = Math.sqrt(a * a + b * b);
|
|
1218
1182
|
|
|
1219
|
-
|
|
1220
|
-
return [l, c, h];
|
|
1183
|
+
return [l, c, h];
|
|
1221
1184
|
};
|
|
1222
1185
|
|
|
1223
1186
|
convert$1.lch.lab = function (lch) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1187
|
+
const l = lch[0];
|
|
1188
|
+
const c = lch[1];
|
|
1189
|
+
const h = lch[2];
|
|
1190
|
+
|
|
1191
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
1192
|
+
const a = c * Math.cos(hr);
|
|
1193
|
+
const b = c * Math.sin(hr);
|
|
1194
|
+
|
|
1195
|
+
return [l, a, b];
|
|
1231
1196
|
};
|
|
1232
1197
|
|
|
1233
1198
|
convert$1.rgb.ansi16 = function (args, saturation = null) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1199
|
+
const [r, g, b] = args;
|
|
1200
|
+
let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
|
|
1236
1201
|
|
|
1237
|
-
|
|
1202
|
+
value = Math.round(value / 50);
|
|
1238
1203
|
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1204
|
+
if (value === 0) {
|
|
1205
|
+
return 30;
|
|
1206
|
+
}
|
|
1242
1207
|
|
|
1243
|
-
|
|
1208
|
+
let ansi = 30
|
|
1209
|
+
+ ((Math.round(b / 255) << 2)
|
|
1210
|
+
| (Math.round(g / 255) << 1)
|
|
1211
|
+
| Math.round(r / 255));
|
|
1244
1212
|
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1213
|
+
if (value === 2) {
|
|
1214
|
+
ansi += 60;
|
|
1215
|
+
}
|
|
1248
1216
|
|
|
1249
|
-
|
|
1217
|
+
return ansi;
|
|
1250
1218
|
};
|
|
1251
1219
|
|
|
1252
1220
|
convert$1.hsv.ansi16 = function (args) {
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1221
|
+
// Optimization here; we already know the value and don't need to get
|
|
1222
|
+
// it converted for us.
|
|
1223
|
+
return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
|
|
1256
1224
|
};
|
|
1257
1225
|
|
|
1258
1226
|
convert$1.rgb.ansi256 = function (args) {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1227
|
+
const r = args[0];
|
|
1228
|
+
const g = args[1];
|
|
1229
|
+
const b = args[2];
|
|
1230
|
+
|
|
1231
|
+
// We use the extended greyscale palette here, with the exception of
|
|
1232
|
+
// black and white. normal palette only has 4 greyscale shades.
|
|
1233
|
+
if (r === g && g === b) {
|
|
1234
|
+
if (r < 8) {
|
|
1235
|
+
return 16;
|
|
1236
|
+
}
|
|
1268
1237
|
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1238
|
+
if (r > 248) {
|
|
1239
|
+
return 231;
|
|
1240
|
+
}
|
|
1272
1241
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1242
|
+
return Math.round(((r - 8) / 247) * 24) + 232;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
const ansi = 16
|
|
1246
|
+
+ (36 * Math.round(r / 255 * 5))
|
|
1247
|
+
+ (6 * Math.round(g / 255 * 5))
|
|
1248
|
+
+ Math.round(b / 255 * 5);
|
|
1275
1249
|
|
|
1276
|
-
|
|
1277
|
-
return ansi;
|
|
1250
|
+
return ansi;
|
|
1278
1251
|
};
|
|
1279
1252
|
|
|
1280
1253
|
convert$1.ansi16.rgb = function (args) {
|
|
1281
|
-
|
|
1254
|
+
let color = args % 10;
|
|
1282
1255
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1256
|
+
// Handle greyscale
|
|
1257
|
+
if (color === 0 || color === 7) {
|
|
1258
|
+
if (args > 50) {
|
|
1259
|
+
color += 3.5;
|
|
1260
|
+
}
|
|
1287
1261
|
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1262
|
+
color = color / 10.5 * 255;
|
|
1263
|
+
|
|
1264
|
+
return [color, color, color];
|
|
1265
|
+
}
|
|
1291
1266
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1267
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
1268
|
+
const r = ((color & 1) * mult) * 255;
|
|
1269
|
+
const g = (((color >> 1) & 1) * mult) * 255;
|
|
1270
|
+
const b = (((color >> 2) & 1) * mult) * 255;
|
|
1271
|
+
|
|
1272
|
+
return [r, g, b];
|
|
1297
1273
|
};
|
|
1298
1274
|
|
|
1299
1275
|
convert$1.ansi256.rgb = function (args) {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1276
|
+
// Handle greyscale
|
|
1277
|
+
if (args >= 232) {
|
|
1278
|
+
const c = (args - 232) * 10 + 8;
|
|
1279
|
+
return [c, c, c];
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
args -= 16;
|
|
1305
1283
|
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1284
|
+
let rem;
|
|
1285
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
1286
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1287
|
+
const b = (rem % 6) / 5 * 255;
|
|
1288
|
+
|
|
1289
|
+
return [r, g, b];
|
|
1312
1290
|
};
|
|
1313
1291
|
|
|
1314
1292
|
convert$1.rgb.hex = function (args) {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1293
|
+
const integer = ((Math.round(args[0]) & 0xFF) << 16)
|
|
1294
|
+
+ ((Math.round(args[1]) & 0xFF) << 8)
|
|
1295
|
+
+ (Math.round(args[2]) & 0xFF);
|
|
1296
|
+
|
|
1297
|
+
const string = integer.toString(16).toUpperCase();
|
|
1298
|
+
return '000000'.substring(string.length) + string;
|
|
1318
1299
|
};
|
|
1319
1300
|
|
|
1320
1301
|
convert$1.hex.rgb = function (args) {
|
|
1321
|
-
|
|
1302
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1303
|
+
if (!match) {
|
|
1304
|
+
return [0, 0, 0];
|
|
1305
|
+
}
|
|
1322
1306
|
|
|
1323
|
-
|
|
1324
|
-
return [0, 0, 0];
|
|
1325
|
-
}
|
|
1307
|
+
let colorString = match[0];
|
|
1326
1308
|
|
|
1327
|
-
|
|
1309
|
+
if (match[0].length === 3) {
|
|
1310
|
+
colorString = colorString.split('').map(char => {
|
|
1311
|
+
return char + char;
|
|
1312
|
+
}).join('');
|
|
1313
|
+
}
|
|
1328
1314
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1315
|
+
const integer = parseInt(colorString, 16);
|
|
1316
|
+
const r = (integer >> 16) & 0xFF;
|
|
1317
|
+
const g = (integer >> 8) & 0xFF;
|
|
1318
|
+
const b = integer & 0xFF;
|
|
1334
1319
|
|
|
1335
|
-
|
|
1336
|
-
const r = integer >> 16 & 0xFF;
|
|
1337
|
-
const g = integer >> 8 & 0xFF;
|
|
1338
|
-
const b = integer & 0xFF;
|
|
1339
|
-
return [r, g, b];
|
|
1320
|
+
return [r, g, b];
|
|
1340
1321
|
};
|
|
1341
1322
|
|
|
1342
1323
|
convert$1.rgb.hcg = function (rgb) {
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1324
|
+
const r = rgb[0] / 255;
|
|
1325
|
+
const g = rgb[1] / 255;
|
|
1326
|
+
const b = rgb[2] / 255;
|
|
1327
|
+
const max = Math.max(Math.max(r, g), b);
|
|
1328
|
+
const min = Math.min(Math.min(r, g), b);
|
|
1329
|
+
const chroma = (max - min);
|
|
1330
|
+
let grayscale;
|
|
1331
|
+
let hue;
|
|
1332
|
+
|
|
1333
|
+
if (chroma < 1) {
|
|
1334
|
+
grayscale = min / (1 - chroma);
|
|
1335
|
+
} else {
|
|
1336
|
+
grayscale = 0;
|
|
1337
|
+
}
|
|
1357
1338
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1339
|
+
if (chroma <= 0) {
|
|
1340
|
+
hue = 0;
|
|
1341
|
+
} else
|
|
1342
|
+
if (max === r) {
|
|
1343
|
+
hue = ((g - b) / chroma) % 6;
|
|
1344
|
+
} else
|
|
1345
|
+
if (max === g) {
|
|
1346
|
+
hue = 2 + (b - r) / chroma;
|
|
1347
|
+
} else {
|
|
1348
|
+
hue = 4 + (r - g) / chroma;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
hue /= 6;
|
|
1352
|
+
hue %= 1;
|
|
1367
1353
|
|
|
1368
|
-
|
|
1369
|
-
hue %= 1;
|
|
1370
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1354
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1371
1355
|
};
|
|
1372
1356
|
|
|
1373
1357
|
convert$1.hsl.hcg = function (hsl) {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
|
|
1377
|
-
let f = 0;
|
|
1358
|
+
const s = hsl[1] / 100;
|
|
1359
|
+
const l = hsl[2] / 100;
|
|
1378
1360
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1361
|
+
const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
|
|
1362
|
+
|
|
1363
|
+
let f = 0;
|
|
1364
|
+
if (c < 1.0) {
|
|
1365
|
+
f = (l - 0.5 * c) / (1.0 - c);
|
|
1366
|
+
}
|
|
1382
1367
|
|
|
1383
|
-
|
|
1368
|
+
return [hsl[0], c * 100, f * 100];
|
|
1384
1369
|
};
|
|
1385
1370
|
|
|
1386
1371
|
convert$1.hsv.hcg = function (hsv) {
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
const c = s * v;
|
|
1390
|
-
let f = 0;
|
|
1372
|
+
const s = hsv[1] / 100;
|
|
1373
|
+
const v = hsv[2] / 100;
|
|
1391
1374
|
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1375
|
+
const c = s * v;
|
|
1376
|
+
let f = 0;
|
|
1395
1377
|
|
|
1396
|
-
|
|
1378
|
+
if (c < 1.0) {
|
|
1379
|
+
f = (v - c) / (1 - c);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
return [hsv[0], c * 100, f * 100];
|
|
1397
1383
|
};
|
|
1398
1384
|
|
|
1399
1385
|
convert$1.hcg.rgb = function (hcg) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1386
|
+
const h = hcg[0] / 360;
|
|
1387
|
+
const c = hcg[1] / 100;
|
|
1388
|
+
const g = hcg[2] / 100;
|
|
1403
1389
|
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1390
|
+
if (c === 0.0) {
|
|
1391
|
+
return [g * 255, g * 255, g * 255];
|
|
1392
|
+
}
|
|
1407
1393
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
pure[1] = 1;
|
|
1431
|
-
pure[2] = v;
|
|
1432
|
-
break;
|
|
1433
|
-
|
|
1434
|
-
case 3:
|
|
1435
|
-
pure[0] = 0;
|
|
1436
|
-
pure[1] = w;
|
|
1437
|
-
pure[2] = 1;
|
|
1438
|
-
break;
|
|
1439
|
-
|
|
1440
|
-
case 4:
|
|
1441
|
-
pure[0] = v;
|
|
1442
|
-
pure[1] = 0;
|
|
1443
|
-
pure[2] = 1;
|
|
1444
|
-
break;
|
|
1445
|
-
|
|
1446
|
-
default:
|
|
1447
|
-
pure[0] = 1;
|
|
1448
|
-
pure[1] = 0;
|
|
1449
|
-
pure[2] = w;
|
|
1450
|
-
}
|
|
1451
|
-
/* eslint-enable max-statements-per-line */
|
|
1394
|
+
const pure = [0, 0, 0];
|
|
1395
|
+
const hi = (h % 1) * 6;
|
|
1396
|
+
const v = hi % 1;
|
|
1397
|
+
const w = 1 - v;
|
|
1398
|
+
let mg = 0;
|
|
1399
|
+
|
|
1400
|
+
/* eslint-disable max-statements-per-line */
|
|
1401
|
+
switch (Math.floor(hi)) {
|
|
1402
|
+
case 0:
|
|
1403
|
+
pure[0] = 1; pure[1] = v; pure[2] = 0; break;
|
|
1404
|
+
case 1:
|
|
1405
|
+
pure[0] = w; pure[1] = 1; pure[2] = 0; break;
|
|
1406
|
+
case 2:
|
|
1407
|
+
pure[0] = 0; pure[1] = 1; pure[2] = v; break;
|
|
1408
|
+
case 3:
|
|
1409
|
+
pure[0] = 0; pure[1] = w; pure[2] = 1; break;
|
|
1410
|
+
case 4:
|
|
1411
|
+
pure[0] = v; pure[1] = 0; pure[2] = 1; break;
|
|
1412
|
+
default:
|
|
1413
|
+
pure[0] = 1; pure[1] = 0; pure[2] = w;
|
|
1414
|
+
}
|
|
1415
|
+
/* eslint-enable max-statements-per-line */
|
|
1452
1416
|
|
|
1417
|
+
mg = (1.0 - c) * g;
|
|
1453
1418
|
|
|
1454
|
-
|
|
1455
|
-
|
|
1419
|
+
return [
|
|
1420
|
+
(c * pure[0] + mg) * 255,
|
|
1421
|
+
(c * pure[1] + mg) * 255,
|
|
1422
|
+
(c * pure[2] + mg) * 255
|
|
1423
|
+
];
|
|
1456
1424
|
};
|
|
1457
1425
|
|
|
1458
1426
|
convert$1.hcg.hsv = function (hcg) {
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
const v = c + g * (1.0 - c);
|
|
1462
|
-
let f = 0;
|
|
1427
|
+
const c = hcg[1] / 100;
|
|
1428
|
+
const g = hcg[2] / 100;
|
|
1463
1429
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}
|
|
1430
|
+
const v = c + g * (1.0 - c);
|
|
1431
|
+
let f = 0;
|
|
1467
1432
|
|
|
1468
|
-
|
|
1433
|
+
if (v > 0.0) {
|
|
1434
|
+
f = c / v;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
return [hcg[0], f * 100, v * 100];
|
|
1469
1438
|
};
|
|
1470
1439
|
|
|
1471
1440
|
convert$1.hcg.hsl = function (hcg) {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
if (l > 0.0 && l < 0.5) {
|
|
1478
|
-
s = c / (2 * l);
|
|
1479
|
-
} else if (l >= 0.5 && l < 1.0) {
|
|
1480
|
-
s = c / (2 * (1 - l));
|
|
1481
|
-
}
|
|
1441
|
+
const c = hcg[1] / 100;
|
|
1442
|
+
const g = hcg[2] / 100;
|
|
1443
|
+
|
|
1444
|
+
const l = g * (1.0 - c) + 0.5 * c;
|
|
1445
|
+
let s = 0;
|
|
1482
1446
|
|
|
1483
|
-
|
|
1447
|
+
if (l > 0.0 && l < 0.5) {
|
|
1448
|
+
s = c / (2 * l);
|
|
1449
|
+
} else
|
|
1450
|
+
if (l >= 0.5 && l < 1.0) {
|
|
1451
|
+
s = c / (2 * (1 - l));
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
return [hcg[0], s * 100, l * 100];
|
|
1484
1455
|
};
|
|
1485
1456
|
|
|
1486
1457
|
convert$1.hcg.hwb = function (hcg) {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1458
|
+
const c = hcg[1] / 100;
|
|
1459
|
+
const g = hcg[2] / 100;
|
|
1460
|
+
const v = c + g * (1.0 - c);
|
|
1461
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
1491
1462
|
};
|
|
1492
1463
|
|
|
1493
1464
|
convert$1.hwb.hcg = function (hwb) {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1465
|
+
const w = hwb[1] / 100;
|
|
1466
|
+
const b = hwb[2] / 100;
|
|
1467
|
+
const v = 1 - b;
|
|
1468
|
+
const c = v - w;
|
|
1469
|
+
let g = 0;
|
|
1470
|
+
|
|
1471
|
+
if (c < 1) {
|
|
1472
|
+
g = (v - c) / (1 - c);
|
|
1473
|
+
}
|
|
1503
1474
|
|
|
1504
|
-
|
|
1475
|
+
return [hwb[0], c * 100, g * 100];
|
|
1505
1476
|
};
|
|
1506
1477
|
|
|
1507
1478
|
convert$1.apple.rgb = function (apple) {
|
|
1508
|
-
|
|
1479
|
+
return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
|
|
1509
1480
|
};
|
|
1510
1481
|
|
|
1511
1482
|
convert$1.rgb.apple = function (rgb) {
|
|
1512
|
-
|
|
1483
|
+
return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
|
|
1513
1484
|
};
|
|
1514
1485
|
|
|
1515
1486
|
convert$1.gray.rgb = function (args) {
|
|
1516
|
-
|
|
1487
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
1517
1488
|
};
|
|
1518
1489
|
|
|
1519
1490
|
convert$1.gray.hsl = function (args) {
|
|
1520
|
-
|
|
1491
|
+
return [0, 0, args[0]];
|
|
1521
1492
|
};
|
|
1522
1493
|
|
|
1523
1494
|
convert$1.gray.hsv = convert$1.gray.hsl;
|
|
1524
1495
|
|
|
1525
1496
|
convert$1.gray.hwb = function (gray) {
|
|
1526
|
-
|
|
1497
|
+
return [0, 100, gray[0]];
|
|
1527
1498
|
};
|
|
1528
1499
|
|
|
1529
1500
|
convert$1.gray.cmyk = function (gray) {
|
|
1530
|
-
|
|
1501
|
+
return [0, 0, 0, gray[0]];
|
|
1531
1502
|
};
|
|
1532
1503
|
|
|
1533
1504
|
convert$1.gray.lab = function (gray) {
|
|
1534
|
-
|
|
1505
|
+
return [gray[0], 0, 0];
|
|
1535
1506
|
};
|
|
1536
1507
|
|
|
1537
1508
|
convert$1.gray.hex = function (gray) {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1509
|
+
const val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
|
1510
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
1511
|
+
|
|
1512
|
+
const string = integer.toString(16).toUpperCase();
|
|
1513
|
+
return '000000'.substring(string.length) + string;
|
|
1542
1514
|
};
|
|
1543
1515
|
|
|
1544
1516
|
convert$1.rgb.gray = function (rgb) {
|
|
1545
|
-
|
|
1546
|
-
|
|
1517
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
1518
|
+
return [val / 255 * 100];
|
|
1547
1519
|
};
|
|
1548
1520
|
|
|
1549
1521
|
/*
|
|
@@ -1558,646 +1530,658 @@ convert$1.rgb.gray = function (rgb) {
|
|
|
1558
1530
|
*/
|
|
1559
1531
|
|
|
1560
1532
|
function buildGraph() {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
return graph;
|
|
1575
|
-
} // https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1533
|
+
const graph = {};
|
|
1534
|
+
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
1535
|
+
const models = Object.keys(conversions);
|
|
1536
|
+
|
|
1537
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1538
|
+
graph[models[i]] = {
|
|
1539
|
+
// http://jsperf.com/1-vs-infinity
|
|
1540
|
+
// micro-opt, but this is simple.
|
|
1541
|
+
distance: -1,
|
|
1542
|
+
parent: null
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1576
1545
|
|
|
1546
|
+
return graph;
|
|
1547
|
+
}
|
|
1577
1548
|
|
|
1549
|
+
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1578
1550
|
function deriveBFS(fromModel) {
|
|
1579
|
-
|
|
1580
|
-
|
|
1551
|
+
const graph = buildGraph();
|
|
1552
|
+
const queue = [fromModel]; // Unshift -> queue -> pop
|
|
1581
1553
|
|
|
1582
|
-
|
|
1554
|
+
graph[fromModel].distance = 0;
|
|
1583
1555
|
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1556
|
+
while (queue.length) {
|
|
1557
|
+
const current = queue.pop();
|
|
1558
|
+
const adjacents = Object.keys(conversions[current]);
|
|
1587
1559
|
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1560
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1561
|
+
const adjacent = adjacents[i];
|
|
1562
|
+
const node = graph[adjacent];
|
|
1591
1563
|
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1564
|
+
if (node.distance === -1) {
|
|
1565
|
+
node.distance = graph[current].distance + 1;
|
|
1566
|
+
node.parent = current;
|
|
1567
|
+
queue.unshift(adjacent);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1599
1571
|
|
|
1600
|
-
|
|
1572
|
+
return graph;
|
|
1601
1573
|
}
|
|
1602
1574
|
|
|
1603
1575
|
function link(from, to) {
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1576
|
+
return function (args) {
|
|
1577
|
+
return to(from(args));
|
|
1578
|
+
};
|
|
1607
1579
|
}
|
|
1608
1580
|
|
|
1609
1581
|
function wrapConversion(toModel, graph) {
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1582
|
+
const path = [graph[toModel].parent, toModel];
|
|
1583
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
1584
|
+
|
|
1585
|
+
let cur = graph[toModel].parent;
|
|
1586
|
+
while (graph[cur].parent) {
|
|
1587
|
+
path.unshift(graph[cur].parent);
|
|
1588
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1589
|
+
cur = graph[cur].parent;
|
|
1590
|
+
}
|
|
1619
1591
|
|
|
1620
|
-
|
|
1621
|
-
|
|
1592
|
+
fn.conversion = path;
|
|
1593
|
+
return fn;
|
|
1622
1594
|
}
|
|
1623
1595
|
|
|
1624
1596
|
var route = function (fromModel) {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
const models = Object.keys(graph);
|
|
1597
|
+
const graph = deriveBFS(fromModel);
|
|
1598
|
+
const conversion = {};
|
|
1628
1599
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1600
|
+
const models = Object.keys(graph);
|
|
1601
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1602
|
+
const toModel = models[i];
|
|
1603
|
+
const node = graph[toModel];
|
|
1632
1604
|
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1605
|
+
if (node.parent === null) {
|
|
1606
|
+
// No possible conversion, or this node is the source model.
|
|
1607
|
+
continue;
|
|
1608
|
+
}
|
|
1637
1609
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1610
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1611
|
+
}
|
|
1640
1612
|
|
|
1641
|
-
|
|
1613
|
+
return conversion;
|
|
1642
1614
|
};
|
|
1643
1615
|
|
|
1644
1616
|
const convert = {};
|
|
1617
|
+
|
|
1645
1618
|
const models = Object.keys(conversions);
|
|
1646
1619
|
|
|
1647
1620
|
function wrapRaw(fn) {
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
if (arg0.length > 1) {
|
|
1656
|
-
args = arg0;
|
|
1657
|
-
}
|
|
1621
|
+
const wrappedFn = function (...args) {
|
|
1622
|
+
const arg0 = args[0];
|
|
1623
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1624
|
+
return arg0;
|
|
1625
|
+
}
|
|
1658
1626
|
|
|
1659
|
-
|
|
1660
|
-
|
|
1627
|
+
if (arg0.length > 1) {
|
|
1628
|
+
args = arg0;
|
|
1629
|
+
}
|
|
1661
1630
|
|
|
1631
|
+
return fn(args);
|
|
1632
|
+
};
|
|
1662
1633
|
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1634
|
+
// Preserve .conversion property if there is one
|
|
1635
|
+
if ('conversion' in fn) {
|
|
1636
|
+
wrappedFn.conversion = fn.conversion;
|
|
1637
|
+
}
|
|
1666
1638
|
|
|
1667
|
-
|
|
1639
|
+
return wrappedFn;
|
|
1668
1640
|
}
|
|
1669
1641
|
|
|
1670
1642
|
function wrapRounded(fn) {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
if (arg0 === undefined || arg0 === null) {
|
|
1675
|
-
return arg0;
|
|
1676
|
-
}
|
|
1643
|
+
const wrappedFn = function (...args) {
|
|
1644
|
+
const arg0 = args[0];
|
|
1677
1645
|
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1646
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1647
|
+
return arg0;
|
|
1648
|
+
}
|
|
1681
1649
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1650
|
+
if (arg0.length > 1) {
|
|
1651
|
+
args = arg0;
|
|
1652
|
+
}
|
|
1685
1653
|
|
|
1686
|
-
|
|
1687
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
1688
|
-
result[i] = Math.round(result[i]);
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1654
|
+
const result = fn(args);
|
|
1691
1655
|
|
|
1692
|
-
|
|
1693
|
-
|
|
1656
|
+
// We're assuming the result is an array here.
|
|
1657
|
+
// see notice in conversions.js; don't use box types
|
|
1658
|
+
// in conversion functions.
|
|
1659
|
+
if (typeof result === 'object') {
|
|
1660
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
1661
|
+
result[i] = Math.round(result[i]);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1694
1664
|
|
|
1665
|
+
return result;
|
|
1666
|
+
};
|
|
1695
1667
|
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1668
|
+
// Preserve .conversion property if there is one
|
|
1669
|
+
if ('conversion' in fn) {
|
|
1670
|
+
wrappedFn.conversion = fn.conversion;
|
|
1671
|
+
}
|
|
1699
1672
|
|
|
1700
|
-
|
|
1673
|
+
return wrappedFn;
|
|
1701
1674
|
}
|
|
1702
1675
|
|
|
1703
1676
|
models.forEach(fromModel => {
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1677
|
+
convert[fromModel] = {};
|
|
1678
|
+
|
|
1679
|
+
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
|
1680
|
+
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
|
1681
|
+
|
|
1682
|
+
const routes = route(fromModel);
|
|
1683
|
+
const routeModels = Object.keys(routes);
|
|
1684
|
+
|
|
1685
|
+
routeModels.forEach(toModel => {
|
|
1686
|
+
const fn = routes[toModel];
|
|
1687
|
+
|
|
1688
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1689
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1690
|
+
});
|
|
1718
1691
|
});
|
|
1692
|
+
|
|
1719
1693
|
var colorConvert = convert;
|
|
1720
1694
|
|
|
1721
|
-
const skippedModels = [
|
|
1722
|
-
|
|
1723
|
-
'
|
|
1724
|
-
'hex'];
|
|
1725
|
-
const hashedModelKeys = {};
|
|
1695
|
+
const skippedModels = [
|
|
1696
|
+
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
1697
|
+
'keyword',
|
|
1726
1698
|
|
|
1699
|
+
// Gray conflicts with some method names, and has its own method defined.
|
|
1700
|
+
'gray',
|
|
1701
|
+
|
|
1702
|
+
// Shouldn't really be in color-convert either...
|
|
1703
|
+
'hex',
|
|
1704
|
+
];
|
|
1705
|
+
|
|
1706
|
+
const hashedModelKeys = {};
|
|
1727
1707
|
for (const model of Object.keys(colorConvert)) {
|
|
1728
|
-
|
|
1708
|
+
hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
|
|
1729
1709
|
}
|
|
1730
1710
|
|
|
1731
1711
|
const limiters = {};
|
|
1732
1712
|
|
|
1733
1713
|
function Color(object, model) {
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
if (model && model in skippedModels) {
|
|
1739
|
-
model = null;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
if (model && !(model in colorConvert)) {
|
|
1743
|
-
throw new Error('Unknown model: ' + model);
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
let i;
|
|
1747
|
-
let channels;
|
|
1748
|
-
|
|
1749
|
-
if (object == null) {
|
|
1750
|
-
// eslint-disable-line no-eq-null,eqeqeq
|
|
1751
|
-
this.model = 'rgb';
|
|
1752
|
-
this.color = [0, 0, 0];
|
|
1753
|
-
this.valpha = 1;
|
|
1754
|
-
} else if (object instanceof Color) {
|
|
1755
|
-
this.model = object.model;
|
|
1756
|
-
this.color = [...object.color];
|
|
1757
|
-
this.valpha = object.valpha;
|
|
1758
|
-
} else if (typeof object === 'string') {
|
|
1759
|
-
const result = colorString.get(object);
|
|
1760
|
-
|
|
1761
|
-
if (result === null) {
|
|
1762
|
-
throw new Error('Unable to parse color from string: ' + object);
|
|
1763
|
-
}
|
|
1714
|
+
if (!(this instanceof Color)) {
|
|
1715
|
+
return new Color(object, model);
|
|
1716
|
+
}
|
|
1764
1717
|
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
|
|
1769
|
-
} else if (object.length > 0) {
|
|
1770
|
-
this.model = model || 'rgb';
|
|
1771
|
-
channels = colorConvert[this.model].channels;
|
|
1772
|
-
const newArray = Array.prototype.slice.call(object, 0, channels);
|
|
1773
|
-
this.color = zeroArray(newArray, channels);
|
|
1774
|
-
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
|
|
1775
|
-
} else if (typeof object === 'number') {
|
|
1776
|
-
// This is always RGB - can be converted later on.
|
|
1777
|
-
this.model = 'rgb';
|
|
1778
|
-
this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
|
|
1779
|
-
this.valpha = 1;
|
|
1780
|
-
} else {
|
|
1781
|
-
this.valpha = 1;
|
|
1782
|
-
const keys = Object.keys(object);
|
|
1783
|
-
|
|
1784
|
-
if ('alpha' in object) {
|
|
1785
|
-
keys.splice(keys.indexOf('alpha'), 1);
|
|
1786
|
-
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
|
|
1787
|
-
}
|
|
1718
|
+
if (model && model in skippedModels) {
|
|
1719
|
+
model = null;
|
|
1720
|
+
}
|
|
1788
1721
|
|
|
1789
|
-
|
|
1722
|
+
if (model && !(model in colorConvert)) {
|
|
1723
|
+
throw new Error('Unknown model: ' + model);
|
|
1724
|
+
}
|
|
1790
1725
|
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1726
|
+
let i;
|
|
1727
|
+
let channels;
|
|
1728
|
+
|
|
1729
|
+
if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
|
|
1730
|
+
this.model = 'rgb';
|
|
1731
|
+
this.color = [0, 0, 0];
|
|
1732
|
+
this.valpha = 1;
|
|
1733
|
+
} else if (object instanceof Color) {
|
|
1734
|
+
this.model = object.model;
|
|
1735
|
+
this.color = [...object.color];
|
|
1736
|
+
this.valpha = object.valpha;
|
|
1737
|
+
} else if (typeof object === 'string') {
|
|
1738
|
+
const result = colorString.get(object);
|
|
1739
|
+
if (result === null) {
|
|
1740
|
+
throw new Error('Unable to parse color from string: ' + object);
|
|
1741
|
+
}
|
|
1794
1742
|
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1743
|
+
this.model = result.model;
|
|
1744
|
+
channels = colorConvert[this.model].channels;
|
|
1745
|
+
this.color = result.value.slice(0, channels);
|
|
1746
|
+
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
|
|
1747
|
+
} else if (object.length > 0) {
|
|
1748
|
+
this.model = model || 'rgb';
|
|
1749
|
+
channels = colorConvert[this.model].channels;
|
|
1750
|
+
const newArray = Array.prototype.slice.call(object, 0, channels);
|
|
1751
|
+
this.color = zeroArray(newArray, channels);
|
|
1752
|
+
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
|
|
1753
|
+
} else if (typeof object === 'number') {
|
|
1754
|
+
// This is always RGB - can be converted later on.
|
|
1755
|
+
this.model = 'rgb';
|
|
1756
|
+
this.color = [
|
|
1757
|
+
(object >> 16) & 0xFF,
|
|
1758
|
+
(object >> 8) & 0xFF,
|
|
1759
|
+
object & 0xFF,
|
|
1760
|
+
];
|
|
1761
|
+
this.valpha = 1;
|
|
1762
|
+
} else {
|
|
1763
|
+
this.valpha = 1;
|
|
1800
1764
|
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1765
|
+
const keys = Object.keys(object);
|
|
1766
|
+
if ('alpha' in object) {
|
|
1767
|
+
keys.splice(keys.indexOf('alpha'), 1);
|
|
1768
|
+
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
|
|
1769
|
+
}
|
|
1804
1770
|
|
|
1805
|
-
|
|
1806
|
-
|
|
1771
|
+
const hashedKeys = keys.sort().join('');
|
|
1772
|
+
if (!(hashedKeys in hashedModelKeys)) {
|
|
1773
|
+
throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
|
|
1774
|
+
}
|
|
1807
1775
|
|
|
1776
|
+
this.model = hashedModelKeys[hashedKeys];
|
|
1808
1777
|
|
|
1809
|
-
|
|
1810
|
-
|
|
1778
|
+
const {labels} = colorConvert[this.model];
|
|
1779
|
+
const color = [];
|
|
1780
|
+
for (i = 0; i < labels.length; i++) {
|
|
1781
|
+
color.push(object[labels[i]]);
|
|
1782
|
+
}
|
|
1811
1783
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1784
|
+
this.color = zeroArray(color);
|
|
1785
|
+
}
|
|
1814
1786
|
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1787
|
+
// Perform limitations (clamping, etc.)
|
|
1788
|
+
if (limiters[this.model]) {
|
|
1789
|
+
channels = colorConvert[this.model].channels;
|
|
1790
|
+
for (i = 0; i < channels; i++) {
|
|
1791
|
+
const limit = limiters[this.model][i];
|
|
1792
|
+
if (limit) {
|
|
1793
|
+
this.color[i] = limit(this.color[i]);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1820
1797
|
|
|
1821
|
-
|
|
1798
|
+
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
1822
1799
|
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1800
|
+
if (Object.freeze) {
|
|
1801
|
+
Object.freeze(this);
|
|
1802
|
+
}
|
|
1826
1803
|
}
|
|
1827
1804
|
|
|
1828
1805
|
Color.prototype = {
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
for (let i = 0; i < channels; i++) {
|
|
1864
|
-
result[labels[i]] = this.color[i];
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
if (this.valpha !== 1) {
|
|
1868
|
-
result.alpha = this.valpha;
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
return result;
|
|
1872
|
-
},
|
|
1806
|
+
toString() {
|
|
1807
|
+
return this.string();
|
|
1808
|
+
},
|
|
1809
|
+
|
|
1810
|
+
toJSON() {
|
|
1811
|
+
return this[this.model]();
|
|
1812
|
+
},
|
|
1813
|
+
|
|
1814
|
+
string(places) {
|
|
1815
|
+
let self = this.model in colorString.to ? this : this.rgb();
|
|
1816
|
+
self = self.round(typeof places === 'number' ? places : 1);
|
|
1817
|
+
const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
|
|
1818
|
+
return colorString.to[self.model](args);
|
|
1819
|
+
},
|
|
1820
|
+
|
|
1821
|
+
percentString(places) {
|
|
1822
|
+
const self = this.rgb().round(typeof places === 'number' ? places : 1);
|
|
1823
|
+
const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
|
|
1824
|
+
return colorString.to.rgb.percent(args);
|
|
1825
|
+
},
|
|
1826
|
+
|
|
1827
|
+
array() {
|
|
1828
|
+
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
1829
|
+
},
|
|
1830
|
+
|
|
1831
|
+
object() {
|
|
1832
|
+
const result = {};
|
|
1833
|
+
const {channels} = colorConvert[this.model];
|
|
1834
|
+
const {labels} = colorConvert[this.model];
|
|
1835
|
+
|
|
1836
|
+
for (let i = 0; i < channels; i++) {
|
|
1837
|
+
result[labels[i]] = this.color[i];
|
|
1838
|
+
}
|
|
1873
1839
|
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
rgb[1] /= 255;
|
|
1878
|
-
rgb[2] /= 255;
|
|
1840
|
+
if (this.valpha !== 1) {
|
|
1841
|
+
result.alpha = this.valpha;
|
|
1842
|
+
}
|
|
1879
1843
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
}
|
|
1844
|
+
return result;
|
|
1845
|
+
},
|
|
1883
1846
|
|
|
1884
|
-
|
|
1885
|
-
|
|
1847
|
+
unitArray() {
|
|
1848
|
+
const rgb = this.rgb().color;
|
|
1849
|
+
rgb[0] /= 255;
|
|
1850
|
+
rgb[1] /= 255;
|
|
1851
|
+
rgb[2] /= 255;
|
|
1886
1852
|
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
rgb.g /= 255;
|
|
1891
|
-
rgb.b /= 255;
|
|
1853
|
+
if (this.valpha !== 1) {
|
|
1854
|
+
rgb.push(this.valpha);
|
|
1855
|
+
}
|
|
1892
1856
|
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
}
|
|
1857
|
+
return rgb;
|
|
1858
|
+
},
|
|
1896
1859
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1860
|
+
unitObject() {
|
|
1861
|
+
const rgb = this.rgb().object();
|
|
1862
|
+
rgb.r /= 255;
|
|
1863
|
+
rgb.g /= 255;
|
|
1864
|
+
rgb.b /= 255;
|
|
1899
1865
|
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
},
|
|
1866
|
+
if (this.valpha !== 1) {
|
|
1867
|
+
rgb.alpha = this.valpha;
|
|
1868
|
+
}
|
|
1904
1869
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
1908
|
-
}
|
|
1870
|
+
return rgb;
|
|
1871
|
+
},
|
|
1909
1872
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1873
|
+
round(places) {
|
|
1874
|
+
places = Math.max(places || 0, 0);
|
|
1875
|
+
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
|
|
1876
|
+
},
|
|
1912
1877
|
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
|
|
1918
|
-
saturationl: getset('hsl', 1, maxfn(100)),
|
|
1919
|
-
lightness: getset('hsl', 2, maxfn(100)),
|
|
1920
|
-
saturationv: getset('hsv', 1, maxfn(100)),
|
|
1921
|
-
value: getset('hsv', 2, maxfn(100)),
|
|
1922
|
-
chroma: getset('hcg', 1, maxfn(100)),
|
|
1923
|
-
gray: getset('hcg', 2, maxfn(100)),
|
|
1924
|
-
white: getset('hwb', 1, maxfn(100)),
|
|
1925
|
-
wblack: getset('hwb', 2, maxfn(100)),
|
|
1926
|
-
cyan: getset('cmyk', 0, maxfn(100)),
|
|
1927
|
-
magenta: getset('cmyk', 1, maxfn(100)),
|
|
1928
|
-
yellow: getset('cmyk', 2, maxfn(100)),
|
|
1929
|
-
black: getset('cmyk', 3, maxfn(100)),
|
|
1930
|
-
x: getset('xyz', 0, maxfn(95.047)),
|
|
1931
|
-
y: getset('xyz', 1, maxfn(100)),
|
|
1932
|
-
z: getset('xyz', 2, maxfn(108.833)),
|
|
1933
|
-
l: getset('lab', 0, maxfn(100)),
|
|
1934
|
-
a: getset('lab', 1),
|
|
1935
|
-
b: getset('lab', 2),
|
|
1936
|
-
|
|
1937
|
-
keyword(value) {
|
|
1938
|
-
if (value !== undefined) {
|
|
1939
|
-
return new Color(value);
|
|
1940
|
-
}
|
|
1878
|
+
alpha(value) {
|
|
1879
|
+
if (value !== undefined) {
|
|
1880
|
+
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
1881
|
+
}
|
|
1941
1882
|
|
|
1942
|
-
|
|
1943
|
-
|
|
1883
|
+
return this.valpha;
|
|
1884
|
+
},
|
|
1944
1885
|
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1886
|
+
// Rgb
|
|
1887
|
+
red: getset('rgb', 0, maxfn(255)),
|
|
1888
|
+
green: getset('rgb', 1, maxfn(255)),
|
|
1889
|
+
blue: getset('rgb', 2, maxfn(255)),
|
|
1949
1890
|
|
|
1950
|
-
|
|
1951
|
-
},
|
|
1891
|
+
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
|
|
1952
1892
|
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
return new Color(value);
|
|
1956
|
-
}
|
|
1893
|
+
saturationl: getset('hsl', 1, maxfn(100)),
|
|
1894
|
+
lightness: getset('hsl', 2, maxfn(100)),
|
|
1957
1895
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1896
|
+
saturationv: getset('hsv', 1, maxfn(100)),
|
|
1897
|
+
value: getset('hsv', 2, maxfn(100)),
|
|
1960
1898
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
}
|
|
1899
|
+
chroma: getset('hcg', 1, maxfn(100)),
|
|
1900
|
+
gray: getset('hcg', 2, maxfn(100)),
|
|
1964
1901
|
|
|
1965
|
-
|
|
1966
|
-
|
|
1902
|
+
white: getset('hwb', 1, maxfn(100)),
|
|
1903
|
+
wblack: getset('hwb', 2, maxfn(100)),
|
|
1967
1904
|
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1905
|
+
cyan: getset('cmyk', 0, maxfn(100)),
|
|
1906
|
+
magenta: getset('cmyk', 1, maxfn(100)),
|
|
1907
|
+
yellow: getset('cmyk', 2, maxfn(100)),
|
|
1908
|
+
black: getset('cmyk', 3, maxfn(100)),
|
|
1972
1909
|
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
const lum = [];
|
|
1910
|
+
x: getset('xyz', 0, maxfn(95.047)),
|
|
1911
|
+
y: getset('xyz', 1, maxfn(100)),
|
|
1912
|
+
z: getset('xyz', 2, maxfn(108.833)),
|
|
1977
1913
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
}
|
|
1914
|
+
l: getset('lab', 0, maxfn(100)),
|
|
1915
|
+
a: getset('lab', 1),
|
|
1916
|
+
b: getset('lab', 2),
|
|
1982
1917
|
|
|
1983
|
-
|
|
1984
|
-
|
|
1918
|
+
keyword(value) {
|
|
1919
|
+
if (value !== undefined) {
|
|
1920
|
+
return new Color(value);
|
|
1921
|
+
}
|
|
1985
1922
|
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
const lum1 = this.luminosity();
|
|
1989
|
-
const lum2 = color2.luminosity();
|
|
1923
|
+
return colorConvert[this.model].keyword(this.color);
|
|
1924
|
+
},
|
|
1990
1925
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1926
|
+
hex(value) {
|
|
1927
|
+
if (value !== undefined) {
|
|
1928
|
+
return new Color(value);
|
|
1929
|
+
}
|
|
1994
1930
|
|
|
1995
|
-
|
|
1996
|
-
|
|
1931
|
+
return colorString.to.hex(this.rgb().round().color);
|
|
1932
|
+
},
|
|
1997
1933
|
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
1934
|
+
hexa(value) {
|
|
1935
|
+
if (value !== undefined) {
|
|
1936
|
+
return new Color(value);
|
|
1937
|
+
}
|
|
2001
1938
|
|
|
2002
|
-
|
|
2003
|
-
return 'AAA';
|
|
2004
|
-
}
|
|
1939
|
+
const rgbArray = this.rgb().round().color;
|
|
2005
1940
|
|
|
2006
|
-
|
|
2007
|
-
|
|
1941
|
+
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
1942
|
+
if (alphaHex.length === 1) {
|
|
1943
|
+
alphaHex = '0' + alphaHex;
|
|
1944
|
+
}
|
|
2008
1945
|
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
const rgb = this.rgb().color;
|
|
2012
|
-
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
|
|
2013
|
-
return yiq < 128;
|
|
2014
|
-
},
|
|
1946
|
+
return colorString.to.hex(rgbArray) + alphaHex;
|
|
1947
|
+
},
|
|
2015
1948
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
1949
|
+
rgbNumber() {
|
|
1950
|
+
const rgb = this.rgb().color;
|
|
1951
|
+
return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
|
|
1952
|
+
},
|
|
2019
1953
|
|
|
2020
|
-
|
|
2021
|
-
|
|
1954
|
+
luminosity() {
|
|
1955
|
+
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
1956
|
+
const rgb = this.rgb().color;
|
|
2022
1957
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
1958
|
+
const lum = [];
|
|
1959
|
+
for (const [i, element] of rgb.entries()) {
|
|
1960
|
+
const chan = element / 255;
|
|
1961
|
+
lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
|
|
1962
|
+
}
|
|
2026
1963
|
|
|
2027
|
-
|
|
2028
|
-
|
|
1964
|
+
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
1965
|
+
},
|
|
2029
1966
|
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
},
|
|
1967
|
+
contrast(color2) {
|
|
1968
|
+
// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
1969
|
+
const lum1 = this.luminosity();
|
|
1970
|
+
const lum2 = color2.luminosity();
|
|
2035
1971
|
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
return hsl;
|
|
2040
|
-
},
|
|
1972
|
+
if (lum1 > lum2) {
|
|
1973
|
+
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
1974
|
+
}
|
|
2041
1975
|
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
hsl.color[1] += hsl.color[1] * ratio;
|
|
2045
|
-
return hsl;
|
|
2046
|
-
},
|
|
1976
|
+
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
1977
|
+
},
|
|
2047
1978
|
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
1979
|
+
level(color2) {
|
|
1980
|
+
// https://www.w3.org/TR/WCAG/#contrast-enhanced
|
|
1981
|
+
const contrastRatio = this.contrast(color2);
|
|
1982
|
+
if (contrastRatio >= 7) {
|
|
1983
|
+
return 'AAA';
|
|
1984
|
+
}
|
|
2053
1985
|
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
hwb.color[1] += hwb.color[1] * ratio;
|
|
2057
|
-
return hwb;
|
|
2058
|
-
},
|
|
1986
|
+
return (contrastRatio >= 4.5) ? 'AA' : '';
|
|
1987
|
+
},
|
|
2059
1988
|
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
1989
|
+
isDark() {
|
|
1990
|
+
// YIQ equation from http://24ways.org/2010/calculating-color-contrast
|
|
1991
|
+
const rgb = this.rgb().color;
|
|
1992
|
+
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
|
|
1993
|
+
return yiq < 128;
|
|
1994
|
+
},
|
|
2065
1995
|
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
2070
|
-
return Color.rgb(value, value, value);
|
|
2071
|
-
},
|
|
1996
|
+
isLight() {
|
|
1997
|
+
return !this.isDark();
|
|
1998
|
+
},
|
|
2072
1999
|
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2000
|
+
negate() {
|
|
2001
|
+
const rgb = this.rgb();
|
|
2002
|
+
for (let i = 0; i < 3; i++) {
|
|
2003
|
+
rgb.color[i] = 255 - rgb.color[i];
|
|
2004
|
+
}
|
|
2076
2005
|
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2006
|
+
return rgb;
|
|
2007
|
+
},
|
|
2008
|
+
|
|
2009
|
+
lighten(ratio) {
|
|
2010
|
+
const hsl = this.hsl();
|
|
2011
|
+
hsl.color[2] += hsl.color[2] * ratio;
|
|
2012
|
+
return hsl;
|
|
2013
|
+
},
|
|
2014
|
+
|
|
2015
|
+
darken(ratio) {
|
|
2016
|
+
const hsl = this.hsl();
|
|
2017
|
+
hsl.color[2] -= hsl.color[2] * ratio;
|
|
2018
|
+
return hsl;
|
|
2019
|
+
},
|
|
2020
|
+
|
|
2021
|
+
saturate(ratio) {
|
|
2022
|
+
const hsl = this.hsl();
|
|
2023
|
+
hsl.color[1] += hsl.color[1] * ratio;
|
|
2024
|
+
return hsl;
|
|
2025
|
+
},
|
|
2026
|
+
|
|
2027
|
+
desaturate(ratio) {
|
|
2028
|
+
const hsl = this.hsl();
|
|
2029
|
+
hsl.color[1] -= hsl.color[1] * ratio;
|
|
2030
|
+
return hsl;
|
|
2031
|
+
},
|
|
2032
|
+
|
|
2033
|
+
whiten(ratio) {
|
|
2034
|
+
const hwb = this.hwb();
|
|
2035
|
+
hwb.color[1] += hwb.color[1] * ratio;
|
|
2036
|
+
return hwb;
|
|
2037
|
+
},
|
|
2038
|
+
|
|
2039
|
+
blacken(ratio) {
|
|
2040
|
+
const hwb = this.hwb();
|
|
2041
|
+
hwb.color[2] += hwb.color[2] * ratio;
|
|
2042
|
+
return hwb;
|
|
2043
|
+
},
|
|
2044
|
+
|
|
2045
|
+
grayscale() {
|
|
2046
|
+
// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
|
|
2047
|
+
const rgb = this.rgb().color;
|
|
2048
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
2049
|
+
return Color.rgb(value, value, value);
|
|
2050
|
+
},
|
|
2051
|
+
|
|
2052
|
+
fade(ratio) {
|
|
2053
|
+
return this.alpha(this.valpha - (this.valpha * ratio));
|
|
2054
|
+
},
|
|
2055
|
+
|
|
2056
|
+
opaquer(ratio) {
|
|
2057
|
+
return this.alpha(this.valpha + (this.valpha * ratio));
|
|
2058
|
+
},
|
|
2059
|
+
|
|
2060
|
+
rotate(degrees) {
|
|
2061
|
+
const hsl = this.hsl();
|
|
2062
|
+
let hue = hsl.color[0];
|
|
2063
|
+
hue = (hue + degrees) % 360;
|
|
2064
|
+
hue = hue < 0 ? 360 + hue : hue;
|
|
2065
|
+
hsl.color[0] = hue;
|
|
2066
|
+
return hsl;
|
|
2067
|
+
},
|
|
2068
|
+
|
|
2069
|
+
mix(mixinColor, weight) {
|
|
2070
|
+
// Ported from sass implementation in C
|
|
2071
|
+
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
|
|
2072
|
+
if (!mixinColor || !mixinColor.rgb) {
|
|
2073
|
+
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
2074
|
+
}
|
|
2080
2075
|
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
hue = (hue + degrees) % 360;
|
|
2085
|
-
hue = hue < 0 ? 360 + hue : hue;
|
|
2086
|
-
hsl.color[0] = hue;
|
|
2087
|
-
return hsl;
|
|
2088
|
-
},
|
|
2076
|
+
const color1 = mixinColor.rgb();
|
|
2077
|
+
const color2 = this.rgb();
|
|
2078
|
+
const p = weight === undefined ? 0.5 : weight;
|
|
2089
2079
|
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
|
|
2093
|
-
if (!mixinColor || !mixinColor.rgb) {
|
|
2094
|
-
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
2095
|
-
}
|
|
2080
|
+
const w = 2 * p - 1;
|
|
2081
|
+
const a = color1.alpha() - color2.alpha();
|
|
2096
2082
|
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
const p = weight === undefined ? 0.5 : weight;
|
|
2100
|
-
const w = 2 * p - 1;
|
|
2101
|
-
const a = color1.alpha() - color2.alpha();
|
|
2102
|
-
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
2103
|
-
const w2 = 1 - w1;
|
|
2104
|
-
return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
|
|
2105
|
-
}
|
|
2083
|
+
const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
2084
|
+
const w2 = 1 - w1;
|
|
2106
2085
|
|
|
2107
|
-
|
|
2086
|
+
return Color.rgb(
|
|
2087
|
+
w1 * color1.red() + w2 * color2.red(),
|
|
2088
|
+
w1 * color1.green() + w2 * color2.green(),
|
|
2089
|
+
w1 * color1.blue() + w2 * color2.blue(),
|
|
2090
|
+
color1.alpha() * p + color2.alpha() * (1 - p));
|
|
2091
|
+
},
|
|
2092
|
+
};
|
|
2108
2093
|
|
|
2094
|
+
// Model conversion methods and static constructors
|
|
2109
2095
|
for (const model of Object.keys(colorConvert)) {
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
const {
|
|
2115
|
-
channels
|
|
2116
|
-
} = colorConvert[model]; // Conversion methods
|
|
2117
|
-
|
|
2118
|
-
Color.prototype[model] = function (...args) {
|
|
2119
|
-
if (this.model === model) {
|
|
2120
|
-
return new Color(this);
|
|
2121
|
-
}
|
|
2096
|
+
if (skippedModels.includes(model)) {
|
|
2097
|
+
continue;
|
|
2098
|
+
}
|
|
2122
2099
|
|
|
2123
|
-
|
|
2124
|
-
return new Color(args, model);
|
|
2125
|
-
}
|
|
2100
|
+
const {channels} = colorConvert[model];
|
|
2126
2101
|
|
|
2127
|
-
|
|
2128
|
-
|
|
2102
|
+
// Conversion methods
|
|
2103
|
+
Color.prototype[model] = function (...args) {
|
|
2104
|
+
if (this.model === model) {
|
|
2105
|
+
return new Color(this);
|
|
2106
|
+
}
|
|
2129
2107
|
|
|
2108
|
+
if (args.length > 0) {
|
|
2109
|
+
return new Color(args, model);
|
|
2110
|
+
}
|
|
2130
2111
|
|
|
2131
|
-
|
|
2132
|
-
|
|
2112
|
+
return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
|
|
2113
|
+
};
|
|
2133
2114
|
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2115
|
+
// 'static' construction methods
|
|
2116
|
+
Color[model] = function (...args) {
|
|
2117
|
+
let color = args[0];
|
|
2118
|
+
if (typeof color === 'number') {
|
|
2119
|
+
color = zeroArray(args, channels);
|
|
2120
|
+
}
|
|
2137
2121
|
|
|
2138
|
-
|
|
2139
|
-
|
|
2122
|
+
return new Color(color, model);
|
|
2123
|
+
};
|
|
2140
2124
|
}
|
|
2141
2125
|
|
|
2142
2126
|
function roundTo(number, places) {
|
|
2143
|
-
|
|
2127
|
+
return Number(number.toFixed(places));
|
|
2144
2128
|
}
|
|
2145
2129
|
|
|
2146
2130
|
function roundToPlace(places) {
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2131
|
+
return function (number) {
|
|
2132
|
+
return roundTo(number, places);
|
|
2133
|
+
};
|
|
2150
2134
|
}
|
|
2151
2135
|
|
|
2152
2136
|
function getset(model, channel, modifier) {
|
|
2153
|
-
|
|
2137
|
+
model = Array.isArray(model) ? model : [model];
|
|
2154
2138
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2139
|
+
for (const m of model) {
|
|
2140
|
+
(limiters[m] || (limiters[m] = []))[channel] = modifier;
|
|
2141
|
+
}
|
|
2158
2142
|
|
|
2159
|
-
|
|
2160
|
-
return function (value) {
|
|
2161
|
-
let result;
|
|
2143
|
+
model = model[0];
|
|
2162
2144
|
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
value = modifier(value);
|
|
2166
|
-
}
|
|
2145
|
+
return function (value) {
|
|
2146
|
+
let result;
|
|
2167
2147
|
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2148
|
+
if (value !== undefined) {
|
|
2149
|
+
if (modifier) {
|
|
2150
|
+
value = modifier(value);
|
|
2151
|
+
}
|
|
2172
2152
|
|
|
2173
|
-
|
|
2153
|
+
result = this[model]();
|
|
2154
|
+
result.color[channel] = value;
|
|
2155
|
+
return result;
|
|
2156
|
+
}
|
|
2174
2157
|
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2158
|
+
result = this[model]().color[channel];
|
|
2159
|
+
if (modifier) {
|
|
2160
|
+
result = modifier(result);
|
|
2161
|
+
}
|
|
2178
2162
|
|
|
2179
|
-
|
|
2180
|
-
|
|
2163
|
+
return result;
|
|
2164
|
+
};
|
|
2181
2165
|
}
|
|
2182
2166
|
|
|
2183
2167
|
function maxfn(max) {
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2168
|
+
return function (v) {
|
|
2169
|
+
return Math.max(0, Math.min(max, v));
|
|
2170
|
+
};
|
|
2187
2171
|
}
|
|
2188
2172
|
|
|
2189
2173
|
function assertArray(value) {
|
|
2190
|
-
|
|
2174
|
+
return Array.isArray(value) ? value : [value];
|
|
2191
2175
|
}
|
|
2192
2176
|
|
|
2193
2177
|
function zeroArray(array, length) {
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2178
|
+
for (let i = 0; i < length; i++) {
|
|
2179
|
+
if (typeof array[i] !== 'number') {
|
|
2180
|
+
array[i] = 0;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2199
2183
|
|
|
2200
|
-
|
|
2184
|
+
return array;
|
|
2201
2185
|
}
|
|
2202
2186
|
|
|
2203
2187
|
var color = Color;
|
|
@@ -2303,7 +2287,7 @@ const DIMENSIONS = {
|
|
|
2303
2287
|
}
|
|
2304
2288
|
};
|
|
2305
2289
|
|
|
2306
|
-
const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;
|
|
2290
|
+
const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{margin-bottom:-16px;-ms-touch-action:none;touch-action:none}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.section{padding:0 12px 12px}.section:first-of-type{padding-top:12px}.color-hex-options,.section--split{-ms-flex-positive:1;flex-grow:1}.header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{padding-top:12px}.channels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.channel{width:31%}.saved-colors{padding-top:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;width:100%}.saved-colors-buttons{display:-ms-flexbox;display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{-webkit-transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
|
|
2307
2291
|
|
|
2308
2292
|
const throttleFor60FpsInMs = 16;
|
|
2309
2293
|
const defaultValue = normalizeHex(DEFAULT_COLOR$1.hex());
|
|
@@ -2340,6 +2324,7 @@ const ColorPicker = class {
|
|
|
2340
2324
|
* The format of the value property.
|
|
2341
2325
|
*
|
|
2342
2326
|
* When "auto", the format will be inferred from `value` when set.
|
|
2327
|
+
*
|
|
2343
2328
|
* @default "auto"
|
|
2344
2329
|
*/
|
|
2345
2330
|
this.format = defaultFormat;
|
|
@@ -2349,80 +2334,117 @@ const ColorPicker = class {
|
|
|
2349
2334
|
this.hideChannels = false;
|
|
2350
2335
|
/** When true, hides the saved colors section */
|
|
2351
2336
|
this.hideSaved = false;
|
|
2352
|
-
/**
|
|
2337
|
+
/**
|
|
2338
|
+
* Label used for the blue channel
|
|
2339
|
+
*
|
|
2353
2340
|
* @default "B"
|
|
2354
2341
|
*/
|
|
2355
2342
|
this.intlB = TEXT.b;
|
|
2356
|
-
/**
|
|
2343
|
+
/**
|
|
2344
|
+
* Label used for the blue channel description
|
|
2345
|
+
*
|
|
2357
2346
|
* @default "Blue"
|
|
2358
2347
|
*/
|
|
2359
2348
|
this.intlBlue = TEXT.blue;
|
|
2360
|
-
/**
|
|
2349
|
+
/**
|
|
2350
|
+
* Label used for the delete color button.
|
|
2351
|
+
*
|
|
2361
2352
|
* @default "Delete color"
|
|
2362
2353
|
*/
|
|
2363
2354
|
this.intlDeleteColor = TEXT.deleteColor;
|
|
2364
|
-
/**
|
|
2355
|
+
/**
|
|
2356
|
+
* Label used for the green channel
|
|
2357
|
+
*
|
|
2365
2358
|
* @default "G"
|
|
2366
2359
|
*/
|
|
2367
2360
|
this.intlG = TEXT.g;
|
|
2368
|
-
/**
|
|
2361
|
+
/**
|
|
2362
|
+
* Label used for the green channel description
|
|
2363
|
+
*
|
|
2369
2364
|
* @default "Green"
|
|
2370
2365
|
*/
|
|
2371
2366
|
this.intlGreen = TEXT.green;
|
|
2372
|
-
/**
|
|
2367
|
+
/**
|
|
2368
|
+
* Label used for the hue channel
|
|
2369
|
+
*
|
|
2373
2370
|
* @default "H"
|
|
2374
2371
|
*/
|
|
2375
2372
|
this.intlH = TEXT.h;
|
|
2376
|
-
/**
|
|
2373
|
+
/**
|
|
2374
|
+
* Label used for the HSV mode
|
|
2375
|
+
*
|
|
2377
2376
|
* @default "HSV"
|
|
2378
2377
|
*/
|
|
2379
2378
|
this.intlHsv = TEXT.hsv;
|
|
2380
|
-
/**
|
|
2379
|
+
/**
|
|
2380
|
+
* Label used for the hex input
|
|
2381
|
+
*
|
|
2381
2382
|
* @default "Hex"
|
|
2382
2383
|
*/
|
|
2383
2384
|
this.intlHex = TEXT.hex;
|
|
2384
|
-
/**
|
|
2385
|
+
/**
|
|
2386
|
+
* Label used for the hue channel description
|
|
2387
|
+
*
|
|
2385
2388
|
* @default "Hue"
|
|
2386
2389
|
*/
|
|
2387
2390
|
this.intlHue = TEXT.hue;
|
|
2388
2391
|
/**
|
|
2389
2392
|
* Label used for the hex input when there is no color selected.
|
|
2393
|
+
*
|
|
2390
2394
|
* @default "No color"
|
|
2391
2395
|
*/
|
|
2392
2396
|
this.intlNoColor = TEXT.noColor;
|
|
2393
|
-
/**
|
|
2397
|
+
/**
|
|
2398
|
+
* Label used for the red channel
|
|
2399
|
+
*
|
|
2394
2400
|
* @default "R"
|
|
2395
2401
|
*/
|
|
2396
2402
|
this.intlR = TEXT.r;
|
|
2397
|
-
/**
|
|
2403
|
+
/**
|
|
2404
|
+
* Label used for the red channel description
|
|
2405
|
+
*
|
|
2398
2406
|
* @default "Red"
|
|
2399
2407
|
*/
|
|
2400
2408
|
this.intlRed = TEXT.red;
|
|
2401
|
-
/**
|
|
2409
|
+
/**
|
|
2410
|
+
* Label used for the RGB mode
|
|
2411
|
+
*
|
|
2402
2412
|
* @default "RGB"
|
|
2403
2413
|
*/
|
|
2404
2414
|
this.intlRgb = TEXT.rgb;
|
|
2405
|
-
/**
|
|
2415
|
+
/**
|
|
2416
|
+
* Label used for the saturation channel
|
|
2417
|
+
*
|
|
2406
2418
|
* @default "S"
|
|
2407
2419
|
*/
|
|
2408
2420
|
this.intlS = TEXT.s;
|
|
2409
|
-
/**
|
|
2421
|
+
/**
|
|
2422
|
+
* Label used for the saturation channel description
|
|
2423
|
+
*
|
|
2410
2424
|
* @default "Saturation"
|
|
2411
2425
|
*/
|
|
2412
2426
|
this.intlSaturation = TEXT.saturation;
|
|
2413
|
-
/**
|
|
2427
|
+
/**
|
|
2428
|
+
* Label used for the save color button.
|
|
2429
|
+
*
|
|
2414
2430
|
* @default "Save color"
|
|
2415
2431
|
*/
|
|
2416
2432
|
this.intlSaveColor = TEXT.saveColor;
|
|
2417
|
-
/**
|
|
2433
|
+
/**
|
|
2434
|
+
* Label used for the saved colors section
|
|
2435
|
+
*
|
|
2418
2436
|
* @default "Saved"
|
|
2419
2437
|
*/
|
|
2420
2438
|
this.intlSaved = TEXT.saved;
|
|
2421
|
-
/**
|
|
2439
|
+
/**
|
|
2440
|
+
* Label used for the value channel
|
|
2441
|
+
*
|
|
2422
2442
|
* @default "V"
|
|
2423
2443
|
*/
|
|
2424
2444
|
this.intlV = TEXT.v;
|
|
2425
|
-
/**
|
|
2445
|
+
/**
|
|
2446
|
+
* Label used for the
|
|
2447
|
+
*
|
|
2426
2448
|
* @default "Value"
|
|
2427
2449
|
*/
|
|
2428
2450
|
this.intlValue = TEXT.value;
|
|
@@ -2437,6 +2459,7 @@ const ColorPicker = class {
|
|
|
2437
2459
|
* a RGB, HSL or HSV object.
|
|
2438
2460
|
*
|
|
2439
2461
|
* The type will be preserved as the color is updated.
|
|
2462
|
+
*
|
|
2440
2463
|
* @default "#007ac2"
|
|
2441
2464
|
* @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
|
|
2442
2465
|
*/
|
|
@@ -2544,7 +2567,7 @@ const ColorPicker = class {
|
|
|
2544
2567
|
this.handleSavedColorSelect(event);
|
|
2545
2568
|
}
|
|
2546
2569
|
};
|
|
2547
|
-
this.
|
|
2570
|
+
this.handleColorFieldAndSliderPointerLeave = () => {
|
|
2548
2571
|
this.colorFieldAndSliderInteractive = false;
|
|
2549
2572
|
this.colorFieldAndSliderHovered = false;
|
|
2550
2573
|
if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
|
|
@@ -2553,27 +2576,28 @@ const ColorPicker = class {
|
|
|
2553
2576
|
this.drawColorFieldAndSlider();
|
|
2554
2577
|
}
|
|
2555
2578
|
};
|
|
2556
|
-
this.
|
|
2579
|
+
this.handleColorFieldAndSliderPointerDown = (event) => {
|
|
2580
|
+
var _a, _b;
|
|
2557
2581
|
const { offsetX, offsetY } = event;
|
|
2558
2582
|
const region = this.getCanvasRegion(offsetY);
|
|
2559
2583
|
if (region === "color-field") {
|
|
2560
2584
|
this.hueThumbState = "drag";
|
|
2561
2585
|
this.captureColorFieldColor(offsetX, offsetY);
|
|
2562
|
-
this.colorFieldScopeNode.focus();
|
|
2586
|
+
(_a = this.colorFieldScopeNode) === null || _a === void 0 ? void 0 : _a.focus();
|
|
2563
2587
|
}
|
|
2564
2588
|
else if (region === "slider") {
|
|
2565
2589
|
this.sliderThumbState = "drag";
|
|
2566
2590
|
this.captureHueSliderColor(offsetX);
|
|
2567
|
-
this.hueScopeNode.focus();
|
|
2591
|
+
(_b = this.hueScopeNode) === null || _b === void 0 ? void 0 : _b.focus();
|
|
2568
2592
|
}
|
|
2569
2593
|
// prevent text selection outside of color field & slider area
|
|
2570
2594
|
event.preventDefault();
|
|
2571
|
-
document.addEventListener("
|
|
2572
|
-
document.addEventListener("
|
|
2595
|
+
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
2596
|
+
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
2573
2597
|
this.activeColorFieldAndSliderRect =
|
|
2574
2598
|
this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
|
|
2575
2599
|
};
|
|
2576
|
-
this.
|
|
2600
|
+
this.globalPointerUpHandler = () => {
|
|
2577
2601
|
const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
2578
2602
|
this.hueThumbState = "idle";
|
|
2579
2603
|
this.sliderThumbState = "idle";
|
|
@@ -2583,7 +2607,7 @@ const ColorPicker = class {
|
|
|
2583
2607
|
this.calciteColorPickerChange.emit();
|
|
2584
2608
|
}
|
|
2585
2609
|
};
|
|
2586
|
-
this.
|
|
2610
|
+
this.globalPointerMoveHandler = (event) => {
|
|
2587
2611
|
const { el, dimensions } = this;
|
|
2588
2612
|
const sliderThumbDragging = this.sliderThumbState === "drag";
|
|
2589
2613
|
const hueThumbDragging = this.hueThumbState === "drag";
|
|
@@ -2610,7 +2634,7 @@ const ColorPicker = class {
|
|
|
2610
2634
|
samplingX = 0;
|
|
2611
2635
|
}
|
|
2612
2636
|
else {
|
|
2613
|
-
samplingX = colorFieldWidth;
|
|
2637
|
+
samplingX = colorFieldWidth - 1;
|
|
2614
2638
|
}
|
|
2615
2639
|
if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
|
|
2616
2640
|
clientY > colorFieldAndSliderRect.y) {
|
|
@@ -2630,7 +2654,7 @@ const ColorPicker = class {
|
|
|
2630
2654
|
this.captureHueSliderColor(samplingX);
|
|
2631
2655
|
}
|
|
2632
2656
|
};
|
|
2633
|
-
this.
|
|
2657
|
+
this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
|
|
2634
2658
|
const { dimensions: { colorField, slider, thumb } } = this;
|
|
2635
2659
|
this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
|
|
2636
2660
|
this.colorFieldAndSliderHovered = true;
|
|
@@ -2705,7 +2729,7 @@ const ColorPicker = class {
|
|
|
2705
2729
|
/* the channel container is ltr, so we apply the host's direction */
|
|
2706
2730
|
this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
|
|
2707
2731
|
};
|
|
2708
|
-
this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, dir: direction, label: ariaLabel, numberButtonType: "none", onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
|
|
2732
|
+
this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, dir: direction, label: ariaLabel, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
|
|
2709
2733
|
this.deleteColor = () => {
|
|
2710
2734
|
const colorToDelete = this.color.hex();
|
|
2711
2735
|
const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
|
|
@@ -2747,13 +2771,7 @@ const ColorPicker = class {
|
|
|
2747
2771
|
};
|
|
2748
2772
|
this.initColorFieldAndSlider = (canvas) => {
|
|
2749
2773
|
this.fieldAndSliderRenderingContext = canvas.getContext("2d");
|
|
2750
|
-
this.
|
|
2751
|
-
width: this.dimensions.colorField.width,
|
|
2752
|
-
height: this.dimensions.colorField.height +
|
|
2753
|
-
this.dimensions.slider.height +
|
|
2754
|
-
this.getSliderCapSpacing() * 2
|
|
2755
|
-
});
|
|
2756
|
-
this.drawColorFieldAndSlider();
|
|
2774
|
+
this.updateCanvasSize(canvas);
|
|
2757
2775
|
};
|
|
2758
2776
|
}
|
|
2759
2777
|
handleColorChange(color, oldColor) {
|
|
@@ -2766,7 +2784,9 @@ const ColorPicker = class {
|
|
|
2766
2784
|
this.internalColorSet(this.color, false, "internal");
|
|
2767
2785
|
}
|
|
2768
2786
|
handleScaleChange(scale = "m") {
|
|
2787
|
+
var _a;
|
|
2769
2788
|
this.updateDimensions(scale);
|
|
2789
|
+
this.updateCanvasSize((_a = this.fieldAndSliderRenderingContext) === null || _a === void 0 ? void 0 : _a.canvas);
|
|
2770
2790
|
}
|
|
2771
2791
|
handleValueChange(value, oldValue) {
|
|
2772
2792
|
const { allowEmpty, format } = this;
|
|
@@ -2863,8 +2883,8 @@ const ColorPicker = class {
|
|
|
2863
2883
|
}
|
|
2864
2884
|
}
|
|
2865
2885
|
disconnectedCallback() {
|
|
2866
|
-
document.removeEventListener("
|
|
2867
|
-
document.removeEventListener("
|
|
2886
|
+
document.removeEventListener("pointermove", this.globalPointerMoveHandler);
|
|
2887
|
+
document.removeEventListener("pointerup", this.globalPointerUpHandler);
|
|
2868
2888
|
}
|
|
2869
2889
|
componentDidRender() {
|
|
2870
2890
|
updateHostInteraction(this);
|
|
@@ -2886,13 +2906,13 @@ const ColorPicker = class {
|
|
|
2886
2906
|
return (h("div", { class: CSS$2.container }, h("div", { class: CSS$2.colorFieldAndSliderWrap }, h("canvas", { class: {
|
|
2887
2907
|
[CSS$2.colorFieldAndSlider]: true,
|
|
2888
2908
|
[CSS$2.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
|
|
2889
|
-
},
|
|
2909
|
+
}, onPointerDown: this.handleColorFieldAndSliderPointerDown, onPointerEnter: this.handleColorFieldAndSliderPointerEnterOrMove, onPointerLeave: this.handleColorFieldAndSliderPointerLeave, onPointerMove: this.handleColorFieldAndSliderPointerEnterOrMove, ref: this.initColorFieldAndSlider }), h("div", { "aria-label": vertical ? this.intlValue : this.intlSaturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color === null || color === void 0 ? void 0 : color.saturationv() : color === null || color === void 0 ? void 0 : color.value()) || "0", class: { [CSS$2.scope]: true, [CSS$2.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, ref: this.storeColorFieldScope, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0" }), h("div", { "aria-label": this.intlHue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": (color === null || color === void 0 ? void 0 : color.round().hue()) || DEFAULT_COLOR$1.round().hue(), class: { [CSS$2.scope]: true, [CSS$2.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, ref: this.storeHueScope, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0" })), hideHex && hideChannels ? null : (h("div", { class: {
|
|
2890
2910
|
[CSS$2.controlSection]: true,
|
|
2891
2911
|
[CSS$2.section]: true
|
|
2892
2912
|
} }, hideHex ? null : (h("div", { class: CSS$2.hexOptions }, h("span", { class: {
|
|
2893
2913
|
[CSS$2.header]: true,
|
|
2894
2914
|
[CSS$2.headerHex]: true
|
|
2895
|
-
} }, intlHex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS$2.control, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
|
|
2915
|
+
} }, intlHex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS$2.control, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
|
|
2896
2916
|
[CSS$2.colorModeContainer]: true,
|
|
2897
2917
|
[CSS$2.splitSection]: true
|
|
2898
2918
|
}, scale: hexInputScale }, h("calcite-tab-nav", { slot: "tab-nav" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv"))))), hideSaved ? null : (h("div", { class: { [CSS$2.savedColorsSection]: true, [CSS$2.section]: true } }, h("div", { class: CSS$2.header }, h("label", null, intlSaved), h("div", { class: CSS$2.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS$2.deleteColor, color: "neutral", disabled: noColor, iconStart: "minus", label: intlDeleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS$2.saveColor, color: "neutral", disabled: noColor, iconStart: "plus", label: intlSaveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS$2.savedColors }, [
|
|
@@ -2904,6 +2924,11 @@ const ColorPicker = class {
|
|
|
2904
2924
|
// Private Methods
|
|
2905
2925
|
//
|
|
2906
2926
|
//--------------------------------------------------------------------------
|
|
2927
|
+
handleKeyDown(event) {
|
|
2928
|
+
if (event.key === "Enter") {
|
|
2929
|
+
event.preventDefault();
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2907
2932
|
showIncompatibleColorWarning(value, format) {
|
|
2908
2933
|
console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
|
|
2909
2934
|
}
|
|
@@ -2986,6 +3011,18 @@ const ColorPicker = class {
|
|
|
2986
3011
|
const context = canvas.getContext("2d");
|
|
2987
3012
|
context.scale(devicePixelRatio, devicePixelRatio);
|
|
2988
3013
|
}
|
|
3014
|
+
updateCanvasSize(canvas) {
|
|
3015
|
+
if (!canvas) {
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
this.setCanvasContextSize(canvas, {
|
|
3019
|
+
width: this.dimensions.colorField.width,
|
|
3020
|
+
height: this.dimensions.colorField.height +
|
|
3021
|
+
this.dimensions.slider.height +
|
|
3022
|
+
this.getSliderCapSpacing() * 2
|
|
3023
|
+
});
|
|
3024
|
+
this.drawColorFieldAndSlider();
|
|
3025
|
+
}
|
|
2989
3026
|
containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
|
|
2990
3027
|
return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
|
|
2991
3028
|
Math.pow(boundsRadius, 2));
|
|
@@ -3100,11 +3137,13 @@ const ColorPickerHexInput = class {
|
|
|
3100
3137
|
this.allowEmpty = false;
|
|
3101
3138
|
/**
|
|
3102
3139
|
* Label used for the hex input.
|
|
3140
|
+
*
|
|
3103
3141
|
* @default "Hex"
|
|
3104
3142
|
*/
|
|
3105
3143
|
this.intlHex = TEXT.hex;
|
|
3106
3144
|
/**
|
|
3107
3145
|
* Label used for the hex input when there is no color selected.
|
|
3146
|
+
*
|
|
3108
3147
|
* @default "No color"
|
|
3109
3148
|
*/
|
|
3110
3149
|
this.intlNoColor = TEXT.noColor;
|
|
@@ -3116,7 +3155,7 @@ const ColorPickerHexInput = class {
|
|
|
3116
3155
|
* The hex value.
|
|
3117
3156
|
*/
|
|
3118
3157
|
this.value = normalizeHex(DEFAULT_COLOR.hex());
|
|
3119
|
-
this.
|
|
3158
|
+
this.onCalciteInternalInputBlur = () => {
|
|
3120
3159
|
const node = this.inputNode;
|
|
3121
3160
|
const inputValue = node.value;
|
|
3122
3161
|
const hex = `#${inputValue}`;
|
|
@@ -3201,7 +3240,7 @@ const ColorPickerHexInput = class {
|
|
|
3201
3240
|
render() {
|
|
3202
3241
|
const { intlHex, value } = this;
|
|
3203
3242
|
const hexInputValue = this.formatForInternalInput(value);
|
|
3204
|
-
return (h("div", { class: CSS$1.container }, h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6,
|
|
3243
|
+
return (h("div", { class: CSS$1.container }, h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6, numberingSystem: this.numberingSystem, onCalciteInputChange: this.onInputChange, onCalciteInternalInputBlur: this.onCalciteInternalInputBlur, onKeyDown: this.handleKeyDown, prefixText: "#", ref: this.storeInputRef, scale: this.scale, value: hexInputValue }), hexInputValue ? (h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
|
|
3205
3244
|
}
|
|
3206
3245
|
//--------------------------------------------------------------------------
|
|
3207
3246
|
//
|
|
@@ -3248,6 +3287,11 @@ const ColorPickerHexInput = class {
|
|
|
3248
3287
|
nudgeRGBChannels(color$1, amount) {
|
|
3249
3288
|
return color.rgb(color$1.array().map((channel) => channel + amount));
|
|
3250
3289
|
}
|
|
3290
|
+
handleKeyDown(event) {
|
|
3291
|
+
if (event.key === "Enter") {
|
|
3292
|
+
event.preventDefault();
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3251
3295
|
get el() { return getElement(this); }
|
|
3252
3296
|
static get watchers() { return {
|
|
3253
3297
|
"value": ["handleValueChange"]
|