@esri/calcite-components 1.0.0-beta.92 → 1.0.0-beta.93
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/LICENSE.md +13 -13
- package/dist/calcite/assets/date-picker/nls/ar.json +45 -45
- package/dist/calcite/assets/date-picker/nls/bg.json +31 -31
- package/dist/calcite/assets/date-picker/nls/bs.json +32 -32
- package/dist/calcite/assets/date-picker/nls/ca.json +32 -32
- package/dist/calcite/assets/date-picker/nls/cs.json +32 -32
- package/dist/calcite/assets/date-picker/nls/da.json +32 -32
- package/dist/calcite/assets/date-picker/nls/de-CH.json +29 -29
- package/dist/calcite/assets/date-picker/nls/de.json +32 -32
- package/dist/calcite/assets/date-picker/nls/el.json +32 -32
- package/dist/calcite/assets/date-picker/nls/en-AU.json +30 -30
- package/dist/calcite/assets/date-picker/nls/en-CA.json +14 -14
- package/dist/calcite/assets/date-picker/nls/en-GB.json +29 -29
- package/dist/calcite/assets/date-picker/nls/en.json +31 -31
- package/dist/calcite/assets/date-picker/nls/es-MX.json +29 -29
- package/dist/calcite/assets/date-picker/nls/es.json +32 -32
- package/dist/calcite/assets/date-picker/nls/et.json +32 -32
- package/dist/calcite/assets/date-picker/nls/fi.json +45 -45
- package/dist/calcite/assets/date-picker/nls/fr-CH.json +32 -32
- package/dist/calcite/assets/date-picker/nls/fr.json +32 -32
- package/dist/calcite/assets/date-picker/nls/he.json +19 -19
- package/dist/calcite/assets/date-picker/nls/hi.json +32 -32
- package/dist/calcite/assets/date-picker/nls/hr.json +32 -32
- package/dist/calcite/assets/date-picker/nls/hu.json +32 -32
- package/dist/calcite/assets/date-picker/nls/id.json +32 -32
- package/dist/calcite/assets/date-picker/nls/it-CH.json +32 -32
- package/dist/calcite/assets/date-picker/nls/it.json +32 -32
- package/dist/calcite/assets/date-picker/nls/ja.json +22 -22
- package/dist/calcite/assets/date-picker/nls/ko.json +22 -22
- package/dist/calcite/assets/date-picker/nls/lt.json +53 -53
- package/dist/calcite/assets/date-picker/nls/lv.json +45 -45
- package/dist/calcite/assets/date-picker/nls/mk.json +32 -32
- package/dist/calcite/assets/date-picker/nls/nb.json +32 -32
- package/dist/calcite/assets/date-picker/nls/nl.json +32 -32
- package/dist/calcite/assets/date-picker/nls/pl.json +32 -32
- package/dist/calcite/assets/date-picker/nls/pt-BR.json +31 -31
- package/dist/calcite/assets/date-picker/nls/pt-PT.json +32 -32
- package/dist/calcite/assets/date-picker/nls/pt.json +31 -31
- package/dist/calcite/assets/date-picker/nls/ro.json +32 -32
- package/dist/calcite/assets/date-picker/nls/ru.json +32 -32
- package/dist/calcite/assets/date-picker/nls/sk.json +32 -32
- package/dist/calcite/assets/date-picker/nls/sl.json +32 -32
- package/dist/calcite/assets/date-picker/nls/sr.json +32 -32
- package/dist/calcite/assets/date-picker/nls/sv.json +32 -32
- package/dist/calcite/assets/date-picker/nls/th.json +32 -32
- package/dist/calcite/assets/date-picker/nls/tr.json +32 -32
- package/dist/calcite/assets/date-picker/nls/uk.json +32 -32
- package/dist/calcite/assets/date-picker/nls/vi.json +45 -45
- package/dist/calcite/assets/date-picker/nls/zh-CN.json +22 -22
- package/dist/calcite/assets/date-picker/nls/zh-HK.json +22 -22
- package/dist/calcite/assets/date-picker/nls/zh-TW.json +22 -22
- 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-57bcbf12.system.entry.js → p-00cbb85f.system.entry.js} +2 -2
- package/dist/calcite/{p-6ca3a4d3.entry.js → p-00d150f2.entry.js} +2 -2
- package/dist/calcite/{p-a2035e81.entry.js → p-01870de6.entry.js} +2 -2
- package/dist/calcite/p-01b676af.entry.js +6 -0
- package/dist/calcite/p-01d3953d.system.entry.js +6 -0
- package/dist/calcite/{p-a1327fdf.system.js → p-02e0b722.system.js} +1 -1
- package/dist/calcite/{p-5efec339.system.entry.js → p-03562da5.system.entry.js} +2 -2
- package/dist/calcite/{p-4568acb6.entry.js → p-04685fe4.entry.js} +2 -2
- package/dist/calcite/{p-b8876de8.entry.js → p-0509ca3a.entry.js} +2 -2
- package/dist/calcite/{p-b1cac6ac.system.entry.js → p-05db8259.system.entry.js} +2 -2
- package/dist/calcite/{p-ce84c5ce.entry.js → p-07d3d6e5.entry.js} +2 -2
- package/dist/calcite/{p-6723dbea.system.entry.js → p-089d8461.system.entry.js} +2 -2
- package/dist/calcite/{p-89ebc813.entry.js → p-090c6537.entry.js} +2 -2
- package/dist/calcite/{p-47e21b1b.js → p-0a861972.js} +2 -2
- package/dist/calcite/{p-890bdf7b.system.js → p-0afb3088.system.js} +1 -1
- package/dist/calcite/p-0b5a943b.js +6 -0
- package/dist/calcite/{p-dd26e1a0.entry.js → p-0cea6bab.entry.js} +2 -2
- package/dist/calcite/{p-f2305e0a.system.entry.js → p-0d647626.system.entry.js} +2 -2
- package/dist/calcite/{p-c07cba80.system.js → p-10a45595.system.js} +1 -1
- package/dist/calcite/{p-8dccab26.system.js → p-113cc2b0.system.js} +1 -1
- package/dist/calcite/{p-455a984c.system.entry.js → p-11467d5d.system.entry.js} +2 -2
- package/dist/calcite/{p-fc884dc4.system.js → p-11d5321f.system.js} +1 -1
- package/dist/calcite/{p-7198a979.entry.js → p-1232824e.entry.js} +2 -2
- package/dist/calcite/{p-6b42f6c1.entry.js → p-1240d47f.entry.js} +2 -2
- package/dist/calcite/{p-f7408139.entry.js → p-127d3f16.entry.js} +2 -2
- package/dist/calcite/{p-ba9143cb.entry.js → p-16eec3a7.entry.js} +2 -2
- package/dist/calcite/{p-46f703d7.system.entry.js → p-18702b23.system.entry.js} +2 -2
- package/dist/calcite/{p-14370718.system.js → p-196a0d1b.system.js} +2 -2
- package/dist/calcite/p-1ab0054e.system.js +6 -0
- package/dist/calcite/{p-3aa80899.entry.js → p-1aba2bce.entry.js} +2 -2
- package/dist/calcite/{p-f151e536.system.js → p-1bbf8efc.system.js} +1 -1
- package/dist/calcite/{p-2d97d32a.system.entry.js → p-1d4c06fd.system.entry.js} +3 -3
- package/dist/calcite/{p-59ac4143.js → p-1df64778.js} +2 -2
- package/dist/calcite/{p-d9767f5b.system.js → p-21ed0b89.system.js} +2 -2
- package/dist/calcite/{p-b85d465f.js → p-2312e382.js} +1 -1
- package/dist/calcite/{p-b590359e.js → p-25296b9e.js} +2 -2
- package/dist/calcite/p-254a69f9.system.entry.js +6 -0
- package/dist/calcite/{p-3795cf17.system.entry.js → p-28868ccc.system.entry.js} +2 -2
- package/dist/calcite/{p-917ec520.entry.js → p-29ddc4d7.entry.js} +2 -2
- package/dist/calcite/{p-b80f2b72.entry.js → p-2ac00999.entry.js} +2 -2
- package/dist/calcite/{p-047f5080.system.entry.js → p-2fdc6ff5.system.entry.js} +2 -2
- package/dist/calcite/{p-9331ee41.js → p-302a8139.js} +1 -1
- package/dist/calcite/{p-2699d0a3.system.js → p-31f60e7d.system.js} +1 -1
- package/dist/calcite/{p-d3496216.system.js → p-33ab1a35.system.js} +2 -2
- package/dist/calcite/p-33e1889f.entry.js +6 -0
- package/dist/calcite/{p-fb579ef6.system.entry.js → p-35132009.system.entry.js} +2 -2
- package/dist/calcite/{p-3d5a42c2.js → p-360ec63a.js} +1 -1
- package/dist/calcite/{p-5cfbeadf.system.js → p-3a3f2dde.system.js} +1 -1
- package/dist/calcite/{p-95b2ce17.system.js → p-3bce6cd7.system.js} +1 -1
- package/dist/calcite/{p-80a5dd3b.entry.js → p-3c2009db.entry.js} +2 -2
- package/dist/calcite/{p-b318eb10.entry.js → p-3d71bca9.entry.js} +2 -2
- package/dist/calcite/p-3e5be22f.system.js +6 -0
- package/dist/calcite/p-4184afaf.entry.js +6 -0
- package/dist/calcite/{p-1e7ce144.system.entry.js → p-4375cecb.system.entry.js} +2 -2
- package/dist/calcite/{p-4e444288.entry.js → p-445fd0b8.entry.js} +2 -2
- package/dist/calcite/{p-f9fc4ac3.js → p-44d879aa.js} +1 -1
- package/dist/calcite/{p-1c521c06.system.entry.js → p-454f91d4.system.entry.js} +2 -2
- package/dist/calcite/{p-77c2c86d.entry.js → p-45710abc.entry.js} +2 -2
- package/dist/calcite/{p-e5416726.system.entry.js → p-45cd83d2.system.entry.js} +2 -2
- package/dist/calcite/{p-8b9c3657.entry.js → p-45f36f89.entry.js} +2 -2
- package/dist/calcite/{p-71451eb3.system.entry.js → p-467908eb.system.entry.js} +2 -2
- package/dist/calcite/p-4753bb58.entry.js +6 -0
- package/dist/calcite/{p-4f055915.system.entry.js → p-495f772b.system.entry.js} +2 -2
- package/dist/calcite/{p-671cfa60.entry.js → p-49f3a191.entry.js} +2 -2
- package/dist/calcite/{p-9ea4befe.entry.js → p-4c13c20f.entry.js} +2 -2
- package/dist/calcite/{p-ae6acb6b.system.js → p-4ee4c07e.system.js} +2 -2
- package/dist/calcite/{p-2e16ea90.entry.js → p-5167e918.entry.js} +2 -2
- package/dist/calcite/{p-563603be.js → p-53545a85.js} +2 -2
- package/dist/calcite/p-537f656a.system.entry.js +6 -0
- package/dist/calcite/p-53a863e2.entry.js +6 -0
- package/dist/calcite/{p-17eca2ae.system.entry.js → p-568ccb90.system.entry.js} +2 -2
- package/dist/calcite/{p-2d3e8d7e.system.entry.js → p-587604fa.system.entry.js} +2 -2
- package/dist/calcite/{p-3375bdcc.system.entry.js → p-589f38b8.system.entry.js} +2 -2
- package/dist/calcite/{p-92d60658.js → p-58c1c8b0.js} +1 -1
- package/dist/calcite/{p-40b1b217.js → p-58e988aa.js} +2 -2
- package/dist/calcite/{p-8aa9e027.system.js → p-59275123.system.js} +2 -2
- package/dist/calcite/{p-af3f93c3.js → p-59b92fb4.js} +1 -1
- package/dist/calcite/p-5a4d4d43.system.entry.js +6 -0
- package/dist/calcite/{p-24f3ecd3.system.js → p-5fc43c5c.system.js} +3 -3
- package/dist/calcite/{p-08d0c4b3.system.entry.js → p-610e044b.system.entry.js} +2 -2
- package/dist/calcite/{p-6c8b54a4.js → p-6320bdc5.js} +1 -1
- package/dist/calcite/{p-a9c79c8e.entry.js → p-654c3208.entry.js} +2 -2
- package/dist/calcite/{p-5d28e8d4.js → p-67eebd3a.js} +1 -1
- package/dist/calcite/{p-b81de7d1.system.entry.js → p-6a5ab57f.system.entry.js} +3 -3
- package/dist/calcite/{p-a509b85f.system.entry.js → p-6b4b9ea4.system.entry.js} +3 -3
- package/dist/calcite/{p-3b3b7338.entry.js → p-6ccca35c.entry.js} +2 -2
- package/dist/calcite/p-6d372a75.system.entry.js +6 -0
- package/dist/calcite/{p-415f281e.system.entry.js → p-74d32319.system.entry.js} +2 -2
- package/dist/calcite/{p-e20da2fa.entry.js → p-784f4ca9.entry.js} +2 -2
- package/dist/calcite/{p-c7a1d105.entry.js → p-7bccad75.entry.js} +2 -2
- package/dist/calcite/{p-75e86bf4.system.entry.js → p-7bcde78a.system.entry.js} +2 -2
- package/dist/calcite/{p-5d572c12.system.js → p-7c4514cc.system.js} +1 -1
- package/dist/calcite/{p-0831a033.entry.js → p-7ccad3e7.entry.js} +2 -2
- package/dist/calcite/{p-f5f344b4.entry.js → p-7ef212bf.entry.js} +2 -2
- package/dist/calcite/{p-fd888df3.js → p-7f70c6f8.js} +1 -1
- package/dist/calcite/{p-6af95a4b.entry.js → p-83b22271.entry.js} +2 -2
- package/dist/calcite/{p-7c975ff8.system.entry.js → p-84383868.system.entry.js} +2 -2
- package/dist/calcite/{p-75b3a441.system.entry.js → p-84a50b2f.system.entry.js} +3 -3
- package/dist/calcite/{p-54c0d659.system.js → p-880e859d.system.js} +1 -1
- package/dist/calcite/p-89810d95.js +6 -0
- package/dist/calcite/{p-58f0c5d8.js → p-8c1287d7.js} +1 -1
- package/dist/calcite/{p-6737ff3d.system.entry.js → p-8c700fb6.system.entry.js} +3 -3
- package/dist/calcite/p-8c9b4208.entry.js +6 -0
- package/dist/calcite/{p-8c90df11.system.entry.js → p-8d52ae3c.system.entry.js} +2 -2
- package/dist/calcite/{p-25bd48cf.system.js → p-9119080a.system.js} +1 -1
- package/dist/calcite/{p-af131e8f.system.entry.js → p-93130f18.system.entry.js} +2 -2
- package/dist/calcite/{p-57ef201e.entry.js → p-934b07d1.entry.js} +2 -2
- package/dist/calcite/{p-6b450790.js → p-93721054.js} +1 -1
- package/dist/calcite/{p-00cf13c7.system.entry.js → p-94ed6cd7.system.entry.js} +2 -2
- package/dist/calcite/{p-3a805702.entry.js → p-974d4f34.entry.js} +2 -2
- package/dist/calcite/{p-61e53bb3.system.js → p-97967de4.system.js} +1 -1
- package/dist/calcite/{p-9a99c514.system.entry.js → p-9804887e.system.entry.js} +2 -2
- package/dist/calcite/p-982f6b1a.system.js +6 -0
- package/dist/calcite/{p-05208d9e.system.entry.js → p-992b971e.system.entry.js} +2 -2
- package/dist/calcite/{p-d5e28888.system.entry.js → p-9aefc997.system.entry.js} +2 -2
- package/dist/calcite/{p-0808e377.entry.js → p-9c3c8126.entry.js} +2 -2
- package/dist/calcite/{p-ef566fe8.system.entry.js → p-9d3bf0ce.system.entry.js} +2 -2
- package/dist/calcite/{p-b602422c.system.js → p-9fc4c30d.system.js} +1 -1
- package/dist/calcite/{p-67b21e65.entry.js → p-a2b155f6.entry.js} +2 -2
- package/dist/calcite/{p-b352b87b.entry.js → p-a330d0c1.entry.js} +2 -2
- package/dist/calcite/p-a56c5b03.entry.js +6 -0
- package/dist/calcite/p-a59ca5f3.system.entry.js +6 -0
- package/dist/calcite/{p-54f1296e.entry.js → p-a5d8c321.entry.js} +2 -2
- package/dist/calcite/p-a5ecb224.system.entry.js +6 -0
- package/dist/calcite/{p-a7419bf8.system.entry.js → p-a9e281b4.system.entry.js} +2 -2
- package/dist/calcite/p-aa65ad4a.entry.js +6 -0
- package/dist/calcite/p-aa8a1302.system.entry.js +6 -0
- package/dist/calcite/{p-6fe2bde0.entry.js → p-aaaeb247.entry.js} +2 -2
- package/dist/calcite/{p-c01a73d7.system.entry.js → p-ad8c9b35.system.entry.js} +2 -2
- package/dist/calcite/{p-aaaf10f0.system.entry.js → p-adb4021c.system.entry.js} +2 -2
- package/dist/calcite/p-add0fbd7.js +6 -0
- package/dist/calcite/{p-79988262.system.js → p-afdabbeb.system.js} +2 -2
- package/dist/calcite/p-b1aa6019.entry.js +6 -0
- package/dist/calcite/{p-353edca5.system.entry.js → p-b1de8d4e.system.entry.js} +2 -2
- package/dist/calcite/{p-4c082bbb.entry.js → p-b1ec30df.entry.js} +2 -2
- package/dist/calcite/{p-4e03b1ae.entry.js → p-b70b80e1.entry.js} +2 -2
- package/dist/calcite/{p-365d9061.js → p-b75e6c78.js} +1 -1
- package/dist/calcite/{p-5c35dc5d.js → p-baa2ee9c.js} +1 -1
- package/dist/calcite/{p-f2d20a87.js → p-bb532b22.js} +2 -2
- package/dist/calcite/{p-900dede5.entry.js → p-bb752e62.entry.js} +2 -2
- package/dist/calcite/{p-d3e5e2ac.system.entry.js → p-bc2cbb09.system.entry.js} +2 -2
- package/dist/calcite/{p-0c8c14bf.system.entry.js → p-bce8deed.system.entry.js} +2 -2
- package/dist/calcite/{p-70f9636e.system.entry.js → p-bf4f542a.system.entry.js} +2 -2
- package/dist/calcite/{p-4956d534.entry.js → p-c043b29e.entry.js} +2 -2
- package/dist/calcite/{p-6102c66d.js → p-c2e2ad0c.js} +1 -1
- package/dist/calcite/{p-115b7c7b.entry.js → p-c3104419.entry.js} +2 -2
- package/dist/calcite/{p-b98a0d0d.entry.js → p-c4b33e5d.entry.js} +2 -2
- package/dist/calcite/{p-bf86c713.system.entry.js → p-c5d36f8c.system.entry.js} +2 -2
- package/dist/calcite/{p-37faecf9.entry.js → p-c6793ba1.entry.js} +2 -2
- package/dist/calcite/{p-a9d53c4a.entry.js → p-c6c679ac.entry.js} +2 -2
- package/dist/calcite/{p-06a73b31.system.js → p-c7b2f167.system.js} +1 -1
- package/dist/calcite/{p-5f9271fd.system.entry.js → p-c99ed5a2.system.entry.js} +2 -2
- package/dist/calcite/{p-22bdeaf6.system.js → p-cab7fa23.system.js} +2 -2
- package/dist/calcite/{p-ee28950a.entry.js → p-cb93db8b.entry.js} +2 -2
- package/dist/calcite/{p-669ab5f2.js → p-d049fa40.js} +2 -2
- package/dist/calcite/p-d4009ffe.entry.js +6 -0
- package/dist/calcite/{p-881abbf0.js → p-d525a08c.js} +1 -1
- package/dist/calcite/{p-ecd9fb1a.system.entry.js → p-da4cde84.system.entry.js} +2 -2
- package/dist/calcite/{p-17743b92.js → p-dcd7b5d1.js} +2 -2
- package/dist/calcite/{p-3381cb2b.system.entry.js → p-dd5f0609.system.entry.js} +2 -2
- package/dist/calcite/p-dfe35d4e.system.js +6 -0
- package/dist/calcite/{p-e6d1af49.entry.js → p-e890a9ac.entry.js} +2 -2
- package/dist/calcite/{p-205177f2.entry.js → p-e8930b74.entry.js} +2 -2
- package/dist/calcite/{p-262134e1.system.entry.js → p-e9c4ca11.system.entry.js} +2 -2
- package/dist/calcite/{p-a8bf09e5.system.js → p-ee06e1aa.system.js} +1 -1
- package/dist/calcite/{p-49259ab7.system.entry.js → p-ef4789a9.system.entry.js} +2 -2
- package/dist/calcite/p-f1039359.js +6 -0
- package/dist/calcite/{p-62914532.entry.js → p-f142aed3.entry.js} +2 -2
- package/dist/calcite/{p-7132c6c9.entry.js → p-f2ba7c96.entry.js} +2 -2
- package/dist/calcite/{p-4e48ac8d.system.entry.js → p-f308fd4e.system.entry.js} +2 -2
- package/dist/calcite/{p-3fb0028d.system.entry.js → p-f36909dc.system.entry.js} +2 -2
- package/dist/calcite/{p-1f03af38.system.js → p-f5d8aeee.system.js} +2 -2
- package/dist/calcite/{p-c9180bef.system.entry.js → p-fb162793.system.entry.js} +2 -2
- package/dist/calcite/{p-0633d33e.system.entry.js → p-fe94ce7b.system.entry.js} +2 -2
- package/dist/cjs/{ExpandToggle-75894d07.js → ExpandToggle-b2290d64.js} +90 -90
- package/dist/cjs/{Heading-c6b9cf61.js → Heading-de69eb01.js} +9 -9
- package/dist/cjs/{app-globals-ede7531b.js → app-globals-8c97cac1.js} +41 -36
- package/dist/cjs/{array-aea887f6.js → array-34ec294e.js} +3 -3
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +319 -317
- package/dist/cjs/calcite-action-bar.cjs.entry.js +200 -200
- package/dist/cjs/calcite-action-group.cjs.entry.js +75 -75
- package/dist/cjs/calcite-action-menu.cjs.entry.js +281 -281
- package/dist/cjs/calcite-action-pad.cjs.entry.js +121 -121
- package/dist/cjs/calcite-action.cjs.entry.js +143 -143
- package/dist/cjs/calcite-alert.cjs.entry.js +223 -223
- package/dist/cjs/calcite-avatar.cjs.entry.js +136 -136
- package/dist/cjs/calcite-block_2.cjs.entry.js +276 -276
- package/dist/cjs/calcite-button.cjs.entry.js +163 -163
- package/dist/cjs/calcite-card.cjs.entry.js +127 -127
- package/dist/cjs/calcite-checkbox.cjs.entry.js +126 -126
- package/dist/cjs/calcite-chip.cjs.entry.js +122 -122
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1165 -1158
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1014 -1010
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +935 -935
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +681 -679
- package/dist/cjs/calcite-fab.cjs.entry.js +81 -81
- package/dist/cjs/calcite-filter.cjs.entry.js +133 -133
- package/dist/cjs/calcite-flow.cjs.entry.js +106 -106
- package/dist/cjs/calcite-graph_2.cjs.entry.js +979 -979
- package/dist/cjs/calcite-handle.cjs.entry.js +78 -78
- package/dist/cjs/calcite-icon.cjs.entry.js +157 -157
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +231 -231
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +540 -538
- package/dist/cjs/calcite-input-message.cjs.entry.js +58 -58
- package/dist/cjs/calcite-input-number.cjs.entry.js +523 -523
- package/dist/cjs/calcite-input-text.cjs.entry.js +328 -328
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +1090 -1090
- package/dist/cjs/calcite-input.cjs.entry.js +627 -627
- package/dist/cjs/calcite-label.cjs.entry.js +68 -68
- package/dist/cjs/calcite-link.cjs.entry.js +66 -66
- package/dist/cjs/calcite-list_3.cjs.entry.js +180 -180
- package/dist/cjs/calcite-loader.cjs.entry.js +81 -81
- package/dist/cjs/calcite-modal.cjs.entry.js +324 -312
- package/dist/cjs/calcite-notice.cjs.entry.js +145 -145
- package/dist/cjs/calcite-option_3.cjs.entry.js +317 -317
- package/dist/cjs/calcite-pagination.cjs.entry.js +245 -245
- package/dist/cjs/calcite-panel.cjs.entry.js +317 -317
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +333 -333
- package/dist/cjs/calcite-popover_2.cjs.entry.js +464 -461
- package/dist/cjs/calcite-progress.cjs.entry.js +23 -23
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +96 -96
- package/dist/cjs/calcite-radio-button.cjs.entry.js +261 -261
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +243 -243
- package/dist/cjs/calcite-rating.cjs.entry.js +139 -139
- package/dist/cjs/calcite-scrim.cjs.entry.js +41 -41
- package/dist/cjs/calcite-shell_3.cjs.entry.js +375 -375
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +158 -158
- package/dist/cjs/calcite-split-button.cjs.entry.js +91 -91
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +409 -409
- package/dist/cjs/calcite-switch.cjs.entry.js +106 -106
- package/dist/cjs/calcite-tab_4.cjs.entry.js +679 -679
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +219 -219
- package/dist/cjs/calcite-tile.cjs.entry.js +71 -71
- package/dist/cjs/calcite-tip_3.cjs.entry.js +289 -289
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +357 -355
- package/dist/cjs/calcite-tree_2.cjs.entry.js +479 -479
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +408 -408
- package/dist/cjs/calcite.cjs.js +5 -5
- package/dist/cjs/{conditionalSlot-6a04d02f.js → conditionalSlot-06657c5b.js} +37 -37
- package/dist/cjs/{debounce-9f0ddb81.js → debounce-d1724c1b.js} +1 -1
- package/dist/cjs/{dom-e9f09e29.js → dom-9d34fe95.js} +165 -165
- package/dist/cjs/{filter-b45eeaf9.js → filter-34f3ce30.js} +34 -34
- package/dist/cjs/{floating-ui-8f4ad866.js → floating-ui-9ea3748d.js} +179 -177
- package/dist/cjs/{form-40bae29c.js → form-753af7bf.js} +215 -215
- package/dist/cjs/{guid-08ecb207.js → guid-d157229c.js} +12 -12
- package/dist/cjs/{index-d1f4f7de.js → index-afcc8e68.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{interactive-7fa78804.js → interactive-4157d28f.js} +39 -39
- package/dist/cjs/{interfaces-87a833aa.js → interfaces-d0082310.js} +7 -7
- package/dist/cjs/{key-1902890d.js → key-7da11b52.js} +4 -4
- package/dist/cjs/{label-387b4157.js → label-c5d6d6f9.js} +118 -118
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{locale-eb7612fa.js → locale-e3ec67bd.js} +244 -244
- package/dist/cjs/{math-f748d678.js → math-95aadcfc.js} +12 -12
- package/dist/cjs/{observers-4f40445c.js → observers-70ca1a5f.js} +18 -18
- package/dist/cjs/{openCloseComponent-78a7e2a9.js → openCloseComponent-a2beb5f0.js} +44 -44
- package/dist/cjs/{resources-a7220671.js → resources-2de8b619.js} +10 -10
- package/dist/cjs/{resources-549d99a7.js → resources-4b7ed703.js} +11 -11
- package/dist/cjs/{resources-95ef3f0a.js → resources-8cb481ad.js} +251 -251
- package/dist/cjs/{resources-42b4d672.js → resources-96e885bd.js} +12 -12
- package/dist/cjs/{resources-90d0bc03.js → resources-abf1b91c.js} +348 -348
- package/dist/cjs/{sortable.esm-027d0bf8.js → sortable.esm-e44756d6.js} +1 -1
- package/dist/cjs/{utils-87048187.js → utils-06b85079.js} +107 -107
- package/dist/collection/components/accordion/accordion.js +305 -303
- package/dist/collection/components/accordion/interfaces.js +2 -2
- package/dist/collection/components/accordion-item/accordion-item.js +416 -416
- package/dist/collection/components/accordion-item/interfaces.js +2 -2
- package/dist/collection/components/accordion-item/resources.js +17 -17
- package/dist/collection/components/action/action.css +12 -4
- package/dist/collection/components/action/action.js +434 -434
- package/dist/collection/components/action/resources.js +14 -14
- package/dist/collection/components/action-bar/action-bar.js +431 -431
- package/dist/collection/components/action-bar/resources.js +12 -12
- package/dist/collection/components/action-bar/utils.js +53 -53
- package/dist/collection/components/action-group/action-group.js +213 -213
- package/dist/collection/components/action-group/resources.js +11 -11
- package/dist/collection/components/action-menu/action-menu.js +499 -499
- package/dist/collection/components/action-menu/resources.js +12 -12
- package/dist/collection/components/action-pad/action-pad.js +305 -305
- package/dist/collection/components/action-pad/resources.js +12 -12
- package/dist/collection/components/alert/alert.js +589 -589
- package/dist/collection/components/alert/interfaces.js +8 -8
- package/dist/collection/components/alert/resources.js +17 -17
- package/dist/collection/components/avatar/avatar.js +183 -183
- package/dist/collection/components/avatar/utils.js +58 -58
- package/dist/collection/components/block/block.js +482 -482
- package/dist/collection/components/block/resources.js +39 -39
- package/dist/collection/components/block-section/block-section.js +228 -228
- package/dist/collection/components/block-section/interfaces.js +2 -2
- package/dist/collection/components/block-section/resources.js +24 -24
- package/dist/collection/components/button/button.css +111 -59
- package/dist/collection/components/button/button.js +576 -576
- package/dist/collection/components/button/interfaces.js +2 -2
- package/dist/collection/components/button/resources.js +16 -16
- package/dist/collection/components/card/card.js +297 -297
- package/dist/collection/components/card/resources.js +22 -22
- package/dist/collection/components/checkbox/checkbox.js +397 -397
- package/dist/collection/components/chip/chip.css +34 -18
- package/dist/collection/components/chip/chip.js +368 -368
- package/dist/collection/components/chip/interfaces.js +2 -2
- package/dist/collection/components/chip/resources.js +17 -17
- package/dist/collection/components/color-picker/color-picker.js +1587 -1587
- package/dist/collection/components/color-picker/interfaces.js +2 -2
- package/dist/collection/components/color-picker/resources.js +102 -102
- package/dist/collection/components/color-picker/utils.js +108 -108
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +365 -358
- package/dist/collection/components/color-picker-hex-input/resources.js +6 -6
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +119 -119
- package/dist/collection/components/color-picker-swatch/resources.js +9 -9
- package/dist/collection/components/combobox/combobox.css +10 -3
- package/dist/collection/components/combobox/combobox.js +1381 -1377
- package/dist/collection/components/combobox/interfaces.js +2 -2
- package/dist/collection/components/combobox/resources.js +12 -12
- package/dist/collection/components/combobox/utils.js +28 -28
- package/dist/collection/components/combobox-item/combobox-item.js +365 -365
- package/dist/collection/components/combobox-item/resources.js +13 -13
- package/dist/collection/components/combobox-item-group/combobox-item-group.js +85 -85
- package/dist/collection/components/combobox-item-group/resources.js +6 -6
- package/dist/collection/components/date-picker/assets/date-picker/nls/ar.json +45 -45
- package/dist/collection/components/date-picker/assets/date-picker/nls/bg.json +31 -31
- package/dist/collection/components/date-picker/assets/date-picker/nls/bs.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/ca.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/cs.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/da.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/de-CH.json +29 -29
- package/dist/collection/components/date-picker/assets/date-picker/nls/de.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/el.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/en-AU.json +30 -30
- package/dist/collection/components/date-picker/assets/date-picker/nls/en-CA.json +14 -14
- package/dist/collection/components/date-picker/assets/date-picker/nls/en-GB.json +29 -29
- package/dist/collection/components/date-picker/assets/date-picker/nls/en.json +31 -31
- package/dist/collection/components/date-picker/assets/date-picker/nls/es-MX.json +29 -29
- package/dist/collection/components/date-picker/assets/date-picker/nls/es.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/et.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/fi.json +45 -45
- package/dist/collection/components/date-picker/assets/date-picker/nls/fr-CH.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/fr.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/he.json +19 -19
- package/dist/collection/components/date-picker/assets/date-picker/nls/hi.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/hr.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/hu.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/id.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/it-CH.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/it.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/ja.json +22 -22
- package/dist/collection/components/date-picker/assets/date-picker/nls/ko.json +22 -22
- package/dist/collection/components/date-picker/assets/date-picker/nls/lt.json +53 -53
- package/dist/collection/components/date-picker/assets/date-picker/nls/lv.json +45 -45
- package/dist/collection/components/date-picker/assets/date-picker/nls/mk.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/nb.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/nl.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/pl.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/pt-BR.json +31 -31
- package/dist/collection/components/date-picker/assets/date-picker/nls/pt-PT.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/pt.json +31 -31
- package/dist/collection/components/date-picker/assets/date-picker/nls/ro.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/ru.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/sk.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/sl.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/sr.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/sv.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/th.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/tr.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/uk.json +32 -32
- package/dist/collection/components/date-picker/assets/date-picker/nls/vi.json +45 -45
- package/dist/collection/components/date-picker/assets/date-picker/nls/zh-CN.json +22 -22
- package/dist/collection/components/date-picker/assets/date-picker/nls/zh-HK.json +22 -22
- package/dist/collection/components/date-picker/assets/date-picker/nls/zh-TW.json +22 -22
- package/dist/collection/components/date-picker/date-picker.js +862 -862
- package/dist/collection/components/date-picker/interfaces.js +2 -2
- package/dist/collection/components/date-picker/resources.js +7 -7
- package/dist/collection/components/date-picker/utils.js +60 -60
- package/dist/collection/components/date-picker-day/date-picker-day.js +360 -360
- package/dist/collection/components/date-picker-month/date-picker-month.js +576 -576
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +412 -412
- package/dist/collection/components/date-picker-month-header/resources.js +2 -2
- package/dist/collection/components/dropdown/dropdown.css +6 -0
- package/dist/collection/components/dropdown/dropdown.js +859 -858
- package/dist/collection/components/dropdown/interfaces.js +2 -2
- package/dist/collection/components/dropdown/resources.js +7 -7
- package/dist/collection/components/dropdown-group/dropdown-group.js +164 -164
- package/dist/collection/components/dropdown-group/interfaces.js +2 -2
- package/dist/collection/components/dropdown-group/resources.js +6 -6
- package/dist/collection/components/dropdown-item/dropdown-item.js +456 -456
- package/dist/collection/components/dropdown-item/resources.js +10 -10
- package/dist/collection/components/fab/fab.js +283 -283
- package/dist/collection/components/fab/resources.js +7 -7
- package/dist/collection/components/filter/filter.js +313 -313
- package/dist/collection/components/filter/resources.js +14 -14
- package/dist/collection/components/flow/flow.js +147 -147
- package/dist/collection/components/flow/interfaces.js +2 -2
- package/dist/collection/components/flow/resources.js +6 -6
- package/dist/collection/components/functional/ExpandToggle.js +43 -43
- package/dist/collection/components/functional/Heading.js +10 -10
- package/dist/collection/components/graph/graph.js +214 -214
- package/dist/collection/components/graph/interfaces.js +2 -2
- package/dist/collection/components/graph/util.js +127 -127
- package/dist/collection/components/handle/handle.js +158 -158
- package/dist/collection/components/handle/resources.js +8 -8
- package/dist/collection/components/icon/icon.js +186 -186
- package/dist/collection/components/icon/resources.js +5 -5
- package/dist/collection/components/icon/utils.js +64 -64
- package/dist/collection/components/inline-editable/inline-editable.js +485 -485
- package/dist/collection/components/inline-editable/resources.js +15 -15
- package/dist/collection/components/input/input.js +1397 -1397
- package/dist/collection/components/input/interfaces.js +2 -2
- package/dist/collection/components/input/resources.js +31 -31
- package/dist/collection/components/input-date-picker/input-date-picker.css +9 -0
- package/dist/collection/components/input-date-picker/input-date-picker.js +1313 -1311
- package/dist/collection/components/input-date-picker/resources.js +5 -5
- package/dist/collection/components/input-message/input-message.js +170 -170
- package/dist/collection/components/input-message/interfaces.js +7 -7
- package/dist/collection/components/input-number/input-number.js +1259 -1259
- package/dist/collection/components/input-number/interfaces.js +2 -2
- package/dist/collection/components/input-number/resources.js +23 -23
- package/dist/collection/components/input-text/input-text.js +908 -908
- package/dist/collection/components/input-text/resources.js +20 -20
- package/dist/collection/components/input-time-picker/input-time-picker.js +755 -755
- package/dist/collection/components/interfaces.js +2 -2
- package/dist/collection/components/label/label.js +249 -249
- package/dist/collection/components/label/resources.js +4 -4
- package/dist/collection/components/link/link.js +243 -243
- package/dist/collection/components/list/list.js +122 -122
- package/dist/collection/components/list/resources.js +4 -4
- package/dist/collection/components/list-item/list-item.js +208 -208
- package/dist/collection/components/list-item/resources.js +21 -21
- package/dist/collection/components/list-item-group/list-item-group.js +76 -76
- package/dist/collection/components/list-item-group/resources.js +6 -6
- package/dist/collection/components/loader/loader.js +249 -249
- package/dist/collection/components/modal/interfaces.js +2 -2
- package/dist/collection/components/modal/modal.css +2 -2
- package/dist/collection/components/modal/modal.js +766 -754
- package/dist/collection/components/modal/resources.js +33 -32
- package/dist/collection/components/notice/notice.js +402 -402
- package/dist/collection/components/notice/resources.js +17 -17
- package/dist/collection/components/option/option.js +181 -181
- package/dist/collection/components/option-group/option-group.js +102 -102
- package/dist/collection/components/pagination/pagination.js +391 -391
- package/dist/collection/components/pagination/resources.js +15 -15
- package/dist/collection/components/panel/panel.js +778 -778
- package/dist/collection/components/panel/resources.js +44 -44
- package/dist/collection/components/pick-list/pick-list.js +385 -385
- package/dist/collection/components/pick-list/resources.js +16 -16
- package/dist/collection/components/pick-list/shared-list-logic.js +300 -300
- package/dist/collection/components/pick-list/shared-list-render.js +16 -16
- package/dist/collection/components/pick-list-group/pick-list-group.js +96 -96
- package/dist/collection/components/pick-list-group/resources.js +10 -10
- package/dist/collection/components/pick-list-item/pick-list-item.js +518 -518
- package/dist/collection/components/pick-list-item/resources.js +27 -27
- package/dist/collection/components/popover/PopoverManager.js +70 -71
- package/dist/collection/components/popover/popover.js +844 -840
- package/dist/collection/components/popover/resources.js +20 -20
- package/dist/collection/components/popover-manager/popover-manager.js +115 -115
- package/dist/collection/components/progress/progress.js +123 -123
- package/dist/collection/components/radio-button/radio-button.js +598 -598
- package/dist/collection/components/radio-button/resources.js +4 -4
- package/dist/collection/components/radio-button-group/radio-button-group.js +255 -255
- package/dist/collection/components/radio-group/interfaces.js +2 -2
- package/dist/collection/components/radio-group/radio-group.js +452 -452
- package/dist/collection/components/radio-group-item/radio-group-item.js +168 -168
- package/dist/collection/components/radio-group-item/resources.js +7 -7
- package/dist/collection/components/rating/rating.js +413 -413
- package/dist/collection/components/rating/resources.js +5 -5
- package/dist/collection/components/scrim/resources.js +8 -8
- package/dist/collection/components/scrim/scrim.js +90 -90
- package/dist/collection/components/select/resources.js +6 -6
- package/dist/collection/components/select/select.js +432 -432
- package/dist/collection/components/shell/resources.js +17 -17
- package/dist/collection/components/shell/shell.css +1 -1
- package/dist/collection/components/shell/shell.js +120 -120
- package/dist/collection/components/shell-center-row/resources.js +8 -8
- package/dist/collection/components/shell-center-row/shell-center-row.js +134 -134
- package/dist/collection/components/shell-panel/resources.js +16 -16
- package/dist/collection/components/shell-panel/shell-panel.js +402 -402
- package/dist/collection/components/slider/slider.js +1328 -1328
- package/dist/collection/components/sortable-list/resources.js +7 -7
- package/dist/collection/components/sortable-list/sortable-list.js +303 -303
- package/dist/collection/components/split-button/resources.js +9 -9
- package/dist/collection/components/split-button/split-button.css +16 -10
- package/dist/collection/components/split-button/split-button.js +446 -446
- package/dist/collection/components/stepper/interfaces.js +2 -2
- package/dist/collection/components/stepper/stepper.js +471 -471
- package/dist/collection/components/stepper-item/stepper-item.js +600 -600
- package/dist/collection/components/switch/switch.js +287 -287
- package/dist/collection/components/tab/interfaces.js +2 -2
- package/dist/collection/components/tab/tab.js +299 -299
- package/dist/collection/components/tab-nav/tab-nav.js +479 -479
- package/dist/collection/components/tab-title/tab-title.js +668 -668
- package/dist/collection/components/tabs/interfaces.js +2 -2
- package/dist/collection/components/tabs/resources.js +4 -4
- package/dist/collection/components/tabs/tabs.js +284 -284
- package/dist/collection/components/tile/resources.js +5 -5
- package/dist/collection/components/tile/tile.js +250 -250
- package/dist/collection/components/tile-select/interfaces.js +2 -2
- package/dist/collection/components/tile-select/resources.js +17 -17
- package/dist/collection/components/tile-select/tile-select.js +525 -525
- package/dist/collection/components/tile-select-group/interfaces.js +2 -2
- package/dist/collection/components/tile-select-group/tile-select-group.js +82 -82
- package/dist/collection/components/time-picker/resources.js +44 -44
- package/dist/collection/components/time-picker/time-picker.js +1109 -1109
- package/dist/collection/components/tip/resources.js +21 -21
- package/dist/collection/components/tip/tip.js +228 -228
- package/dist/collection/components/tip-group/tip-group.js +37 -37
- package/dist/collection/components/tip-manager/resources.js +27 -27
- package/dist/collection/components/tip-manager/tip-manager.js +384 -384
- package/dist/collection/components/tooltip/TooltipManager.js +157 -157
- package/dist/collection/components/tooltip/resources.js +7 -7
- package/dist/collection/components/tooltip/tooltip.js +386 -384
- package/dist/collection/components/tooltip-manager/tooltip-manager.js +60 -60
- package/dist/collection/components/tree/interfaces.js +10 -10
- package/dist/collection/components/tree/tree.js +428 -428
- package/dist/collection/components/tree-item/interfaces.js +2 -2
- package/dist/collection/components/tree-item/resources.js +19 -19
- package/dist/collection/components/tree-item/tree-item.js +480 -480
- package/dist/collection/components/value-list/interfaces.js +2 -2
- package/dist/collection/components/value-list/resources.js +12 -12
- package/dist/collection/components/value-list/utils.js +45 -45
- package/dist/collection/components/value-list/value-list.js +577 -577
- package/dist/collection/components/value-list-item/resources.js +8 -8
- package/dist/collection/components/value-list-item/value-list-item.js +422 -422
- package/dist/collection/demos/_assets/demo-dom-swapper.js +45 -0
- package/dist/collection/demos/_assets/demo-form.js +22 -0
- package/dist/collection/demos/_assets/demo-spacer.js +17 -0
- package/dist/collection/demos/_assets/demo-template.js +24 -0
- package/dist/collection/demos/_assets/head.js +48 -0
- package/dist/collection/demos/_assets/locales.js +223 -0
- package/dist/collection/utils/array.js +4 -4
- package/dist/collection/utils/conditionalSlot.js +38 -38
- package/dist/collection/utils/date.js +189 -189
- package/dist/collection/utils/dom.js +166 -166
- package/dist/collection/utils/filter.js +35 -35
- package/dist/collection/utils/floating-ui.js +227 -225
- package/dist/collection/utils/form.js +216 -216
- package/dist/collection/utils/globalAttributes.js +61 -61
- package/dist/collection/utils/globalScript.js +18 -13
- package/dist/collection/utils/guid.js +13 -13
- package/dist/collection/utils/interactive.js +42 -42
- package/dist/collection/utils/key.js +33 -33
- package/dist/collection/utils/label.js +119 -119
- package/dist/collection/utils/locale.js +119 -119
- package/dist/collection/utils/math.js +13 -13
- package/dist/collection/utils/number.js +130 -130
- package/dist/collection/utils/observers.js +20 -20
- package/dist/collection/utils/openCloseComponent.js +45 -45
- package/dist/collection/utils/popper.js +121 -0
- package/dist/collection/utils/resources.js +27 -27
- package/dist/collection/utils/theme.js +27 -27
- package/dist/collection/utils/time.js +177 -177
- package/dist/components/ExpandToggle.js +86 -86
- package/dist/components/Heading.js +8 -8
- package/dist/components/action-group.js +124 -124
- package/dist/components/action-menu.js +331 -331
- package/dist/components/action.js +178 -178
- package/dist/components/array.js +3 -3
- package/dist/components/button.js +205 -205
- package/dist/components/calcite-accordion-item.js +199 -199
- package/dist/components/calcite-accordion.js +166 -164
- package/dist/components/calcite-action-bar.js +247 -247
- 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 +167 -167
- package/dist/components/calcite-action.js +1 -1
- package/dist/components/calcite-alert.js +259 -259
- package/dist/components/calcite-avatar.js +159 -159
- package/dist/components/calcite-block-section.js +127 -127
- package/dist/components/calcite-block.js +241 -241
- package/dist/components/calcite-button.js +1 -1
- package/dist/components/calcite-card.js +160 -160
- 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 +934 -934
- package/dist/components/calcite-combobox-item-group.js +51 -51
- package/dist/components/calcite-combobox-item.js +156 -156
- package/dist/components/calcite-combobox.js +877 -873
- 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 +77 -77
- package/dist/components/calcite-dropdown-item.js +212 -212
- package/dist/components/calcite-dropdown.js +1 -1
- package/dist/components/calcite-fab.js +118 -118
- package/dist/components/calcite-filter.js +1 -1
- package/dist/components/calcite-flow.js +125 -125
- 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 +266 -266
- package/dist/components/calcite-input-date-picker.js +615 -613
- package/dist/components/calcite-input-message.js +81 -81
- package/dist/components/calcite-input-number.js +573 -573
- package/dist/components/calcite-input-text.js +372 -372
- package/dist/components/calcite-input-time-picker.js +327 -327
- package/dist/components/calcite-input.js +1 -1
- package/dist/components/calcite-label.js +1 -1
- package/dist/components/calcite-link.js +1 -1
- package/dist/components/calcite-list-item-group.js +43 -43
- package/dist/components/calcite-list-item.js +128 -128
- package/dist/components/calcite-list.js +64 -64
- package/dist/components/calcite-loader.js +1 -1
- package/dist/components/calcite-modal.js +368 -355
- package/dist/components/calcite-notice.js +170 -170
- package/dist/components/calcite-option-group.js +50 -50
- package/dist/components/calcite-option.js +97 -97
- package/dist/components/calcite-pagination.js +272 -272
- package/dist/components/calcite-panel.js +375 -375
- package/dist/components/calcite-pick-list-group.js +56 -56
- package/dist/components/calcite-pick-list-item.js +1 -1
- package/dist/components/calcite-pick-list.js +185 -185
- package/dist/components/calcite-popover-manager.js +79 -79
- package/dist/components/calcite-popover.js +1 -1
- package/dist/components/calcite-progress.js +1 -1
- package/dist/components/calcite-radio-button-group.js +117 -117
- package/dist/components/calcite-radio-button.js +283 -283
- package/dist/components/calcite-radio-group-item.js +71 -71
- package/dist/components/calcite-radio-group.js +220 -220
- package/dist/components/calcite-rating.js +173 -173
- package/dist/components/calcite-scrim.js +1 -1
- package/dist/components/calcite-select.js +235 -235
- package/dist/components/calcite-shell-center-row.js +77 -77
- package/dist/components/calcite-shell-panel.js +254 -254
- package/dist/components/calcite-shell.js +102 -102
- package/dist/components/calcite-slider.js +809 -809
- package/dist/components/calcite-sortable-list.js +178 -178
- package/dist/components/calcite-split-button.js +141 -141
- package/dist/components/calcite-stepper-item.js +227 -227
- package/dist/components/calcite-stepper.js +240 -240
- 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 +46 -46
- package/dist/components/calcite-tile-select.js +236 -236
- package/dist/components/calcite-tile.js +1 -1
- package/dist/components/calcite-time-picker.js +1 -1
- package/dist/components/calcite-tip-group.js +27 -27
- package/dist/components/calcite-tip-manager.js +202 -202
- package/dist/components/calcite-tip.js +132 -132
- package/dist/components/calcite-tooltip-manager.js +43 -43
- package/dist/components/calcite-tooltip.js +355 -353
- package/dist/components/calcite-tree-item.js +256 -256
- package/dist/components/calcite-tree.js +269 -269
- package/dist/components/calcite-value-list-item.js +177 -177
- package/dist/components/calcite-value-list.js +334 -334
- package/dist/components/checkbox.js +146 -146
- package/dist/components/chip.js +149 -149
- package/dist/components/color-picker-hex-input.js +334 -327
- package/dist/components/color-picker-swatch.js +69 -69
- package/dist/components/conditionalSlot.js +35 -35
- package/dist/components/date-picker-day.js +93 -93
- package/dist/components/date-picker-month-header.js +186 -186
- package/dist/components/date-picker-month.js +331 -331
- package/dist/components/date-picker.js +540 -540
- package/dist/components/date.js +188 -188
- package/dist/components/debounce.js +1 -1
- package/dist/components/dom.js +163 -163
- package/dist/components/dropdown.js +467 -465
- package/dist/components/filter.js +33 -33
- package/dist/components/filter2.js +167 -167
- package/dist/components/floating-ui.js +178 -176
- package/dist/components/form.js +213 -213
- package/dist/components/graph.js +234 -234
- package/dist/components/guid.js +12 -12
- package/dist/components/handle.js +99 -99
- package/dist/components/icon.js +175 -175
- package/dist/components/index.js +40 -35
- package/dist/components/input.js +679 -679
- package/dist/components/interactive.js +39 -39
- package/dist/components/interfaces.js +7 -7
- package/dist/components/interfaces2.js +9 -9
- package/dist/components/key.js +4 -4
- package/dist/components/label.js +117 -117
- package/dist/components/label2.js +87 -87
- package/dist/components/link.js +92 -92
- package/dist/components/loader.js +104 -104
- package/dist/components/locale.js +243 -243
- package/dist/components/math.js +12 -12
- package/dist/components/observers.js +18 -18
- package/dist/components/openCloseComponent.js +44 -44
- package/dist/components/pick-list-item.js +230 -230
- package/dist/components/popover.js +450 -447
- package/dist/components/progress.js +44 -44
- package/dist/components/resources.js +12 -12
- package/dist/components/resources2.js +12 -12
- package/dist/components/resources3.js +9 -9
- package/dist/components/resources4.js +26 -26
- package/dist/components/scrim.js +64 -64
- package/dist/components/shared-list-render.js +300 -300
- package/dist/components/sortable.esm.js +1 -1
- package/dist/components/switch.js +123 -123
- package/dist/components/tab-nav.js +225 -225
- package/dist/components/tab-title.js +251 -251
- package/dist/components/tab.js +137 -137
- package/dist/components/tabs.js +175 -175
- package/dist/components/tile.js +100 -100
- package/dist/components/time-picker.js +884 -884
- package/dist/components/utils.js +107 -107
- package/dist/components/utils2.js +29 -29
- package/dist/custom-elements/index.js +20407 -20366
- package/dist/esm/{ExpandToggle-dc3e3d23.js → ExpandToggle-87ab4f71.js} +90 -90
- package/dist/esm/{Heading-5c05676e.js → Heading-102fe57b.js} +9 -9
- package/dist/esm/{app-globals-f3d4272a.js → app-globals-67426734.js} +41 -36
- package/dist/esm/{array-d40ffe9a.js → array-f5e4a1f6.js} +3 -3
- package/dist/esm/calcite-accordion_2.entry.js +319 -317
- package/dist/esm/calcite-action-bar.entry.js +200 -200
- package/dist/esm/calcite-action-group.entry.js +75 -75
- package/dist/esm/calcite-action-menu.entry.js +281 -281
- package/dist/esm/calcite-action-pad.entry.js +121 -121
- package/dist/esm/calcite-action.entry.js +143 -143
- package/dist/esm/calcite-alert.entry.js +223 -223
- package/dist/esm/calcite-avatar.entry.js +136 -136
- package/dist/esm/calcite-block_2.entry.js +276 -276
- package/dist/esm/calcite-button.entry.js +163 -163
- package/dist/esm/calcite-card.entry.js +127 -127
- package/dist/esm/calcite-checkbox.entry.js +126 -126
- package/dist/esm/calcite-chip.entry.js +122 -122
- package/dist/esm/calcite-color-picker_3.entry.js +1165 -1158
- package/dist/esm/calcite-combobox_3.entry.js +1014 -1010
- package/dist/esm/calcite-date-picker_4.entry.js +935 -935
- package/dist/esm/calcite-dropdown_3.entry.js +681 -679
- package/dist/esm/calcite-fab.entry.js +81 -81
- package/dist/esm/calcite-filter.entry.js +133 -133
- package/dist/esm/calcite-flow.entry.js +106 -106
- package/dist/esm/calcite-graph_2.entry.js +979 -979
- package/dist/esm/calcite-handle.entry.js +78 -78
- package/dist/esm/calcite-icon.entry.js +157 -157
- package/dist/esm/calcite-inline-editable.entry.js +231 -231
- package/dist/esm/calcite-input-date-picker.entry.js +540 -538
- package/dist/esm/calcite-input-message.entry.js +58 -58
- package/dist/esm/calcite-input-number.entry.js +523 -523
- package/dist/esm/calcite-input-text.entry.js +328 -328
- package/dist/esm/calcite-input-time-picker_2.entry.js +1090 -1090
- package/dist/esm/calcite-input.entry.js +627 -627
- package/dist/esm/calcite-label.entry.js +68 -68
- package/dist/esm/calcite-link.entry.js +66 -66
- package/dist/esm/calcite-list_3.entry.js +180 -180
- package/dist/esm/calcite-loader.entry.js +81 -81
- package/dist/esm/calcite-modal.entry.js +324 -312
- package/dist/esm/calcite-notice.entry.js +145 -145
- package/dist/esm/calcite-option_3.entry.js +317 -317
- package/dist/esm/calcite-pagination.entry.js +245 -245
- package/dist/esm/calcite-panel.entry.js +317 -317
- package/dist/esm/calcite-pick-list_3.entry.js +333 -333
- package/dist/esm/calcite-popover_2.entry.js +464 -461
- package/dist/esm/calcite-progress.entry.js +23 -23
- package/dist/esm/calcite-radio-button-group.entry.js +96 -96
- package/dist/esm/calcite-radio-button.entry.js +261 -261
- package/dist/esm/calcite-radio-group_2.entry.js +243 -243
- package/dist/esm/calcite-rating.entry.js +139 -139
- package/dist/esm/calcite-scrim.entry.js +41 -41
- package/dist/esm/calcite-shell_3.entry.js +375 -375
- package/dist/esm/calcite-sortable-list.entry.js +158 -158
- package/dist/esm/calcite-split-button.entry.js +91 -91
- package/dist/esm/calcite-stepper_2.entry.js +409 -409
- package/dist/esm/calcite-switch.entry.js +106 -106
- package/dist/esm/calcite-tab_4.entry.js +679 -679
- package/dist/esm/calcite-tile-select_2.entry.js +219 -219
- package/dist/esm/calcite-tile.entry.js +71 -71
- package/dist/esm/calcite-tip_3.entry.js +289 -289
- package/dist/esm/calcite-tooltip_2.entry.js +357 -355
- package/dist/esm/calcite-tree_2.entry.js +479 -479
- package/dist/esm/calcite-value-list_2.entry.js +408 -408
- package/dist/esm/calcite.js +5 -5
- package/dist/esm/{conditionalSlot-ecb2fb5b.js → conditionalSlot-9def1428.js} +37 -37
- package/dist/esm/{debounce-606ac892.js → debounce-d7adb5b5.js} +1 -1
- package/dist/esm/{dom-ad5fd630.js → dom-a762d6de.js} +165 -165
- package/dist/esm/{filter-a04e9337.js → filter-3357418b.js} +34 -34
- package/dist/esm/{floating-ui-1570beec.js → floating-ui-ae7423f2.js} +179 -177
- package/dist/esm/{form-15b335c2.js → form-e49dd288.js} +215 -215
- package/dist/esm/{guid-44185ff2.js → guid-979aa261.js} +12 -12
- package/dist/esm/{index-5fd0c41c.js → index-ebacd58f.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{interactive-5e7f35f4.js → interactive-ee876f5b.js} +39 -39
- package/dist/esm/{interfaces-06face10.js → interfaces-d6e9d230.js} +7 -7
- package/dist/esm/{key-c11cbfbd.js → key-efdd4e0d.js} +4 -4
- package/dist/esm/{label-63e40550.js → label-d3d802aa.js} +118 -118
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{locale-89a5125e.js → locale-6759d954.js} +244 -244
- package/dist/esm/{math-4dcd0dab.js → math-bb630b76.js} +12 -12
- package/dist/esm/{observers-04124e99.js → observers-78730da1.js} +18 -18
- package/dist/esm/{openCloseComponent-3ae9fbac.js → openCloseComponent-424d53d5.js} +44 -44
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{resources-5cfb576c.js → resources-2468fbf7.js} +348 -348
- package/dist/esm/{resources-45d4ddd3.js → resources-323d7370.js} +11 -11
- package/dist/esm/{resources-1db69fa1.js → resources-3f24d3fc.js} +12 -12
- package/dist/esm/{resources-a691bf05.js → resources-5e0eb8be.js} +10 -10
- package/dist/esm/{resources-3f78fbe2.js → resources-9409c7c7.js} +251 -251
- package/dist/esm/{sortable.esm-ba484a10.js → sortable.esm-a7eceaf1.js} +1 -1
- package/dist/esm/{utils-46049675.js → utils-923ae7f9.js} +107 -107
- package/dist/esm-es5/ExpandToggle-87ab4f71.js +6 -0
- package/dist/esm-es5/{Heading-5c05676e.js → Heading-102fe57b.js} +2 -2
- package/dist/esm-es5/app-globals-67426734.js +6 -0
- package/dist/esm-es5/{array-d40ffe9a.js → array-f5e4a1f6.js} +1 -1
- package/dist/esm-es5/calcite-accordion_2.entry.js +2 -2
- package/dist/esm-es5/calcite-action-bar.entry.js +3 -3
- 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 +3 -3
- package/dist/esm-es5/calcite-alert.entry.js +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-chip.entry.js +3 -3
- package/dist/esm-es5/calcite-color-picker_3.entry.js +2 -2
- package/dist/esm-es5/calcite-combobox_3.entry.js +2 -2
- package/dist/esm-es5/calcite-date-picker_4.entry.js +2 -2
- package/dist/esm-es5/calcite-dropdown_3.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-input-date-picker.entry.js +2 -2
- package/dist/esm-es5/calcite-input-message.entry.js +2 -2
- package/dist/esm-es5/calcite-input-number.entry.js +2 -2
- package/dist/esm-es5/calcite-input-text.entry.js +2 -2
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +2 -2
- package/dist/esm-es5/calcite-input.entry.js +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-modal.entry.js +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-pick-list_3.entry.js +2 -2
- package/dist/esm-es5/calcite-popover_2.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-switch.entry.js +2 -2
- package/dist/esm-es5/calcite-tab_4.entry.js +2 -2
- 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 +2 -2
- package/dist/esm-es5/calcite-tooltip_2.entry.js +2 -2
- 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-ecb2fb5b.js → conditionalSlot-9def1428.js} +2 -2
- package/dist/esm-es5/{debounce-606ac892.js → debounce-d7adb5b5.js} +1 -1
- package/dist/esm-es5/{dom-ad5fd630.js → dom-a762d6de.js} +2 -2
- package/dist/esm-es5/{filter-a04e9337.js → filter-3357418b.js} +2 -2
- package/dist/esm-es5/{floating-ui-1570beec.js → floating-ui-ae7423f2.js} +2 -2
- package/dist/esm-es5/{form-15b335c2.js → form-e49dd288.js} +2 -2
- package/dist/esm-es5/{guid-44185ff2.js → guid-979aa261.js} +1 -1
- package/dist/esm-es5/{index-5fd0c41c.js → index-ebacd58f.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{interactive-5e7f35f4.js → interactive-ee876f5b.js} +1 -1
- package/dist/esm-es5/{interfaces-06face10.js → interfaces-d6e9d230.js} +1 -1
- package/dist/esm-es5/{key-c11cbfbd.js → key-efdd4e0d.js} +1 -1
- package/dist/esm-es5/{label-63e40550.js → label-d3d802aa.js} +2 -2
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/{locale-89a5125e.js → locale-6759d954.js} +2 -2
- package/dist/esm-es5/{math-4dcd0dab.js → math-bb630b76.js} +1 -1
- package/dist/esm-es5/{observers-04124e99.js → observers-78730da1.js} +1 -1
- package/dist/esm-es5/{openCloseComponent-3ae9fbac.js → openCloseComponent-424d53d5.js} +1 -1
- package/dist/esm-es5/{resources-5cfb576c.js → resources-2468fbf7.js} +2 -2
- package/dist/esm-es5/{resources-45d4ddd3.js → resources-323d7370.js} +1 -1
- package/dist/esm-es5/{resources-1db69fa1.js → resources-3f24d3fc.js} +1 -1
- package/dist/esm-es5/{resources-a691bf05.js → resources-5e0eb8be.js} +1 -1
- package/dist/esm-es5/{resources-3f78fbe2.js → resources-9409c7c7.js} +2 -2
- package/dist/esm-es5/{sortable.esm-ba484a10.js → sortable.esm-a7eceaf1.js} +1 -1
- package/dist/esm-es5/{utils-46049675.js → utils-923ae7f9.js} +1 -1
- package/dist/extras/docs-json.json +340 -292
- 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 +44 -44
- package/dist/types/components/accordion/interfaces.d.ts +4 -4
- package/dist/types/components/accordion-item/accordion-item.d.ts +78 -78
- package/dist/types/components/accordion-item/interfaces.d.ts +11 -11
- package/dist/types/components/accordion-item/resources.d.ts +16 -16
- package/dist/types/components/action/action.d.ts +76 -76
- package/dist/types/components/action/resources.d.ts +13 -13
- package/dist/types/components/action-bar/action-bar.d.ts +81 -81
- package/dist/types/components/action-bar/resources.d.ts +11 -11
- package/dist/types/components/action-bar/utils.d.ts +21 -21
- package/dist/types/components/action-group/action-group.d.ts +43 -43
- package/dist/types/components/action-group/resources.d.ts +10 -10
- package/dist/types/components/action-menu/action-menu.d.ts +87 -87
- package/dist/types/components/action-menu/resources.d.ts +11 -11
- package/dist/types/components/action-pad/action-pad.d.ts +58 -58
- package/dist/types/components/action-pad/resources.d.ts +11 -11
- package/dist/types/components/alert/alert.d.ts +105 -105
- package/dist/types/components/alert/interfaces.d.ts +12 -12
- package/dist/types/components/alert/resources.d.ts +16 -16
- package/dist/types/components/avatar/avatar.d.ts +26 -26
- package/dist/types/components/avatar/utils.d.ts +20 -20
- package/dist/types/components/block/block.d.ts +97 -97
- package/dist/types/components/block/resources.d.ts +38 -38
- package/dist/types/components/block-section/block-section.d.ts +44 -44
- package/dist/types/components/block-section/interfaces.d.ts +1 -1
- package/dist/types/components/block-section/resources.d.ts +23 -23
- package/dist/types/components/button/button.d.ts +83 -83
- package/dist/types/components/button/interfaces.d.ts +4 -4
- package/dist/types/components/button/resources.d.ts +15 -15
- package/dist/types/components/card/card.d.ts +55 -55
- package/dist/types/components/card/resources.d.ts +21 -21
- package/dist/types/components/checkbox/checkbox.d.ts +78 -78
- package/dist/types/components/chip/chip.d.ts +56 -56
- package/dist/types/components/chip/interfaces.d.ts +1 -1
- package/dist/types/components/chip/resources.d.ts +16 -16
- package/dist/types/components/color-picker/color-picker.d.ts +275 -275
- package/dist/types/components/color-picker/interfaces.d.ts +27 -27
- package/dist/types/components/color-picker/resources.d.ts +101 -101
- package/dist/types/components/color-picker/utils.d.ts +33 -33
- package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +58 -57
- package/dist/types/components/color-picker-hex-input/resources.d.ts +5 -5
- package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +23 -23
- package/dist/types/components/color-picker-swatch/resources.d.ts +8 -8
- package/dist/types/components/combobox/combobox.d.ts +211 -211
- package/dist/types/components/combobox/interfaces.d.ts +6 -6
- package/dist/types/components/combobox/resources.d.ts +11 -11
- package/dist/types/components/combobox/utils.d.ts +6 -6
- package/dist/types/components/combobox-item/combobox-item.d.ts +60 -60
- package/dist/types/components/combobox-item/resources.d.ts +12 -12
- package/dist/types/components/combobox-item-group/combobox-item-group.d.ts +17 -17
- package/dist/types/components/combobox-item-group/resources.d.ts +5 -5
- package/dist/types/components/date-picker/date-picker.d.ts +161 -161
- package/dist/types/components/date-picker/interfaces.d.ts +4 -4
- package/dist/types/components/date-picker/resources.d.ts +6 -6
- package/dist/types/components/date-picker/utils.d.ts +48 -48
- package/dist/types/components/date-picker-day/date-picker-day.d.ts +49 -49
- package/dist/types/components/date-picker-month/date-picker-month.d.ts +125 -125
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +68 -68
- package/dist/types/components/date-picker-month-header/resources.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +136 -136
- package/dist/types/components/dropdown/interfaces.d.ts +9 -9
- package/dist/types/components/dropdown/resources.d.ts +6 -6
- package/dist/types/components/dropdown-group/dropdown-group.d.ts +34 -34
- package/dist/types/components/dropdown-group/interfaces.d.ts +5 -5
- package/dist/types/components/dropdown-group/resources.d.ts +5 -5
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +63 -63
- package/dist/types/components/dropdown-item/resources.d.ts +9 -9
- package/dist/types/components/fab/fab.d.ts +50 -50
- package/dist/types/components/fab/resources.d.ts +6 -6
- package/dist/types/components/filter/filter.d.ts +59 -59
- package/dist/types/components/filter/resources.d.ts +13 -13
- package/dist/types/components/flow/flow.d.ts +22 -22
- package/dist/types/components/flow/interfaces.d.ts +1 -1
- package/dist/types/components/flow/resources.d.ts +5 -5
- package/dist/types/components/functional/ExpandToggle.d.ts +19 -19
- package/dist/types/components/functional/Heading.d.ts +9 -9
- package/dist/types/components/graph/graph.d.ts +28 -28
- package/dist/types/components/graph/interfaces.d.ts +27 -27
- package/dist/types/components/graph/util.d.ts +29 -29
- package/dist/types/components/handle/handle.d.ts +25 -25
- package/dist/types/components/handle/resources.d.ts +7 -7
- package/dist/types/components/icon/icon.d.ts +32 -32
- package/dist/types/components/icon/resources.d.ts +4 -4
- package/dist/types/components/icon/utils.d.ts +30 -30
- package/dist/types/components/inline-editable/inline-editable.d.ts +79 -79
- package/dist/types/components/inline-editable/resources.d.ts +14 -14
- package/dist/types/components/input/input.d.ts +239 -239
- package/dist/types/components/input/interfaces.d.ts +1 -1
- package/dist/types/components/input/resources.d.ts +30 -30
- package/dist/types/components/input-date-picker/input-date-picker.d.ts +234 -234
- package/dist/types/components/input-date-picker/resources.d.ts +4 -4
- package/dist/types/components/input-message/input-message.d.ts +31 -31
- package/dist/types/components/input-message/interfaces.d.ts +5 -5
- package/dist/types/components/input-number/input-number.d.ts +219 -219
- package/dist/types/components/input-number/interfaces.d.ts +1 -1
- package/dist/types/components/input-number/resources.d.ts +22 -22
- package/dist/types/components/input-text/input-text.d.ts +171 -171
- package/dist/types/components/input-text/resources.d.ts +19 -19
- package/dist/types/components/input-time-picker/input-time-picker.d.ts +112 -112
- package/dist/types/components/interfaces.d.ts +13 -13
- package/dist/types/components/label/label.d.ts +44 -44
- package/dist/types/components/label/resources.d.ts +3 -3
- package/dist/types/components/link/link.d.ts +37 -37
- package/dist/types/components/list/list.d.ts +23 -23
- package/dist/types/components/list/resources.d.ts +3 -3
- package/dist/types/components/list-item/list-item.d.ts +42 -42
- package/dist/types/components/list-item/resources.d.ts +20 -20
- package/dist/types/components/list-item-group/list-item-group.d.ts +18 -18
- package/dist/types/components/list-item-group/resources.d.ts +5 -5
- package/dist/types/components/loader/loader.d.ts +33 -33
- package/dist/types/components/modal/interfaces.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +125 -119
- package/dist/types/components/modal/resources.d.ts +30 -29
- package/dist/types/components/notice/notice.d.ts +72 -72
- package/dist/types/components/notice/resources.d.ts +16 -16
- package/dist/types/components/option/option.d.ts +32 -32
- package/dist/types/components/option-group/option-group.d.ts +20 -20
- package/dist/types/components/pagination/pagination.d.ts +61 -61
- package/dist/types/components/pagination/resources.d.ts +14 -14
- package/dist/types/components/panel/panel.d.ts +163 -163
- package/dist/types/components/panel/resources.d.ts +43 -43
- package/dist/types/components/pick-list/pick-list.d.ts +81 -81
- package/dist/types/components/pick-list/resources.d.ts +14 -14
- package/dist/types/components/pick-list/shared-list-logic.d.ts +33 -33
- package/dist/types/components/pick-list/shared-list-render.d.ts +20 -20
- package/dist/types/components/pick-list-group/pick-list-group.d.ts +21 -21
- package/dist/types/components/pick-list-group/resources.d.ts +9 -9
- package/dist/types/components/pick-list-item/pick-list-item.d.ts +114 -114
- package/dist/types/components/pick-list-item/resources.d.ts +26 -26
- package/dist/types/components/popover/PopoverManager.d.ts +13 -13
- package/dist/types/components/popover/popover.d.ts +150 -150
- package/dist/types/components/popover/resources.d.ts +19 -19
- package/dist/types/components/popover-manager/popover-manager.d.ts +24 -24
- package/dist/types/components/progress/progress.d.ts +15 -15
- package/dist/types/components/radio-button/radio-button.d.ts +101 -101
- package/dist/types/components/radio-button/resources.d.ts +3 -3
- package/dist/types/components/radio-button-group/radio-button-group.d.ts +34 -34
- package/dist/types/components/radio-group/interfaces.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +61 -61
- package/dist/types/components/radio-group-item/radio-group-item.d.ts +25 -25
- package/dist/types/components/radio-group-item/resources.d.ts +6 -6
- package/dist/types/components/rating/rating.d.ts +68 -68
- package/dist/types/components/rating/resources.d.ts +4 -4
- package/dist/types/components/scrim/resources.d.ts +7 -7
- package/dist/types/components/scrim/scrim.d.ts +18 -18
- package/dist/types/components/select/resources.d.ts +5 -5
- package/dist/types/components/select/select.d.ts +77 -77
- package/dist/types/components/shell/resources.d.ts +16 -16
- package/dist/types/components/shell/shell.d.ts +26 -26
- package/dist/types/components/shell-center-row/resources.d.ts +7 -7
- package/dist/types/components/shell-center-row/shell-center-row.d.ts +25 -25
- package/dist/types/components/shell-panel/resources.d.ts +15 -15
- package/dist/types/components/shell-panel/shell-panel.d.ts +72 -72
- package/dist/types/components/slider/slider.d.ts +218 -218
- package/dist/types/components/sortable-list/resources.d.ts +6 -6
- package/dist/types/components/sortable-list/sortable-list.d.ts +52 -52
- package/dist/types/components/split-button/resources.d.ts +8 -8
- package/dist/types/components/split-button/split-button.d.ts +71 -71
- package/dist/types/components/stepper/interfaces.d.ts +9 -9
- package/dist/types/components/stepper/stepper.d.ts +64 -64
- package/dist/types/components/stepper-item/stepper-item.d.ts +94 -94
- package/dist/types/components/switch/switch.d.ts +49 -49
- package/dist/types/components/tab/interfaces.d.ts +6 -6
- package/dist/types/components/tab/tab.d.ts +53 -53
- package/dist/types/components/tab-nav/tab-nav.d.ts +87 -87
- package/dist/types/components/tab-title/tab-title.d.ts +112 -112
- package/dist/types/components/tabs/interfaces.d.ts +3 -3
- package/dist/types/components/tabs/resources.d.ts +3 -3
- package/dist/types/components/tabs/tabs.d.ts +67 -67
- package/dist/types/components/tile/resources.d.ts +4 -4
- package/dist/types/components/tile/tile.d.ts +39 -39
- package/dist/types/components/tile-select/interfaces.d.ts +1 -1
- package/dist/types/components/tile-select/resources.d.ts +16 -16
- package/dist/types/components/tile-select/tile-select.d.ts +59 -59
- package/dist/types/components/tile-select-group/interfaces.d.ts +1 -1
- package/dist/types/components/tile-select-group/tile-select-group.d.ts +15 -15
- package/dist/types/components/time-picker/resources.d.ts +43 -43
- package/dist/types/components/time-picker/time-picker.d.ts +165 -165
- package/dist/types/components/tip/resources.d.ts +20 -20
- package/dist/types/components/tip/tip.d.ts +47 -47
- package/dist/types/components/tip-group/tip-group.d.ts +12 -12
- package/dist/types/components/tip-manager/resources.d.ts +26 -26
- package/dist/types/components/tip-manager/tip-manager.d.ts +71 -71
- package/dist/types/components/tooltip/TooltipManager.d.ts +28 -28
- package/dist/types/components/tooltip/resources.d.ts +6 -6
- package/dist/types/components/tooltip/tooltip.d.ts +64 -64
- package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +14 -14
- package/dist/types/components/tree/interfaces.d.ts +11 -11
- package/dist/types/components/tree/tree.d.ts +46 -46
- package/dist/types/components/tree-item/interfaces.d.ts +10 -10
- package/dist/types/components/tree-item/resources.d.ts +18 -18
- package/dist/types/components/tree-item/tree-item.d.ts +74 -74
- package/dist/types/components/value-list/interfaces.d.ts +1 -1
- package/dist/types/components/value-list/resources.d.ts +10 -10
- package/dist/types/components/value-list/utils.d.ts +8 -8
- package/dist/types/components/value-list/value-list.d.ts +126 -126
- package/dist/types/components/value-list-item/resources.d.ts +7 -7
- package/dist/types/components/value-list-item/value-list-item.d.ts +84 -84
- package/dist/types/components.d.ts +46 -46
- package/dist/types/utils/array.d.ts +1 -1
- package/dist/types/utils/conditionalSlot.d.ts +21 -21
- package/dist/types/utils/date.d.ts +102 -102
- package/dist/types/utils/dom.d.ts +62 -62
- package/dist/types/utils/filter.d.ts +1 -1
- package/dist/types/utils/floating-ui.d.ts +117 -109
- package/dist/types/utils/form.d.ts +140 -140
- package/dist/types/utils/globalAttributes.d.ts +40 -40
- package/dist/types/utils/globalScript.d.ts +6 -6
- package/dist/types/utils/guid.d.ts +1 -1
- package/dist/types/utils/interactive.d.ts +31 -31
- package/dist/types/utils/key.d.ts +3 -3
- package/dist/types/utils/label.d.ts +48 -48
- package/dist/types/utils/locale.d.ts +7 -7
- package/dist/types/utils/math.d.ts +2 -2
- package/dist/types/utils/number.d.ts +23 -23
- package/dist/types/utils/observers.d.ts +13 -13
- package/dist/types/utils/openCloseComponent.d.ts +50 -50
- package/dist/types/utils/resources.d.ts +18 -18
- package/dist/types/utils/theme.d.ts +4 -4
- package/dist/types/utils/time.d.ts +29 -29
- package/hydrate/index.js +21917 -21875
- package/package.json +5 -5
- package/readme.md +2 -2
- package/dist/calcite/p-0330afe9.entry.js +0 -6
- package/dist/calcite/p-22c0a92c.system.entry.js +0 -6
- package/dist/calcite/p-2353cf75.system.js +0 -6
- package/dist/calcite/p-305499ae.entry.js +0 -6
- package/dist/calcite/p-3229244a.system.entry.js +0 -6
- package/dist/calcite/p-348880ed.entry.js +0 -6
- package/dist/calcite/p-41b31d8a.entry.js +0 -6
- package/dist/calcite/p-59ab1ea7.system.entry.js +0 -6
- package/dist/calcite/p-5ee75672.entry.js +0 -6
- package/dist/calcite/p-6519a510.entry.js +0 -6
- package/dist/calcite/p-7836e97f.js +0 -6
- package/dist/calcite/p-809291a4.js +0 -6
- package/dist/calcite/p-8bec0f20.entry.js +0 -6
- package/dist/calcite/p-938a7e19.js +0 -6
- package/dist/calcite/p-9a107c5b.system.entry.js +0 -6
- package/dist/calcite/p-a75b8779.entry.js +0 -6
- package/dist/calcite/p-a8a6b848.system.entry.js +0 -6
- package/dist/calcite/p-b7e4822f.system.entry.js +0 -6
- package/dist/calcite/p-b9cd387a.system.js +0 -6
- package/dist/calcite/p-bf072e3e.entry.js +0 -6
- package/dist/calcite/p-c090491e.system.js +0 -6
- package/dist/calcite/p-d6582e2b.js +0 -6
- package/dist/calcite/p-eb2b79d4.system.entry.js +0 -6
- package/dist/calcite/p-f5ffbb61.system.js +0 -6
- package/dist/calcite/p-f7ce0989.entry.js +0 -6
- package/dist/calcite/p-fa4e05f6.system.entry.js +0 -6
- package/dist/esm-es5/ExpandToggle-dc3e3d23.js +0 -6
- package/dist/esm-es5/app-globals-f3d4272a.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
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.93
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client/index.js';
|
|
7
7
|
import { c as color, d as defineCustomElement$a } from './color-picker-swatch.js';
|
|
@@ -89,939 +89,939 @@ function throttle(func, wait, options) {
|
|
|
89
89
|
|
|
90
90
|
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-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}: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{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{inline-size: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{inline-size:100%;-webkit-margin-after:4px;margin-block-end:4px}:host([scale=s]) .channel:last-child{-webkit-margin-after:0;margin-block-end:0}:host([scale=m]) .container{inline-size:272px}:host([scale=l]) .header{-webkit-padding-after:0px;padding-block-end:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .color-field-and-slider{-webkit-margin-after:-20px;margin-block-end:-20px}:host([scale=l]) .section{padding-block:0 16px;padding-inline:16px}:host([scale=l]) .section:first-of-type{-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;-webkit-padding-before:16px;padding-block-start: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-block-size:98px;inline-size: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{-webkit-margin-after:-16px;margin-block-end:-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-block:0 12px;padding-inline:12px}.section:first-of-type{-webkit-padding-before:12px;padding-block-start: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;-webkit-padding-after:0.25rem;padding-block-end:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{-webkit-padding-before:12px;padding-block-start:12px}.channels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.channel{inline-size:31%}.saved-colors{-webkit-padding-before:12px;padding-block-start:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;inline-size: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}";
|
|
91
91
|
|
|
92
|
-
const throttleFor60FpsInMs = 16;
|
|
93
|
-
const defaultValue = normalizeHex(DEFAULT_COLOR.hex());
|
|
94
|
-
const defaultFormat = "auto";
|
|
95
|
-
const ColorPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
96
|
-
constructor() {
|
|
97
|
-
super();
|
|
98
|
-
this.__registerHost();
|
|
99
|
-
this.__attachShadow();
|
|
100
|
-
this.calciteColorPickerChange = createEvent(this, "calciteColorPickerChange", 6);
|
|
101
|
-
this.calciteColorPickerInput = createEvent(this, "calciteColorPickerInput", 6);
|
|
102
|
-
//--------------------------------------------------------------------------
|
|
103
|
-
//
|
|
104
|
-
// Public properties
|
|
105
|
-
//
|
|
106
|
-
//--------------------------------------------------------------------------
|
|
107
|
-
/**
|
|
108
|
-
* When false, empty color (null) will be allowed as a value. Otherwise, a color value is always enforced by the component.
|
|
109
|
-
*
|
|
110
|
-
* When true, clearing the input and blurring will restore the last valid color set. When false, it will set it to empty.
|
|
111
|
-
*/
|
|
112
|
-
this.allowEmpty = false;
|
|
113
|
-
/** specify the appearance -
|
|
114
|
-
this.appearance = "
|
|
115
|
-
/**
|
|
116
|
-
* Internal prop for advanced use-cases.
|
|
117
|
-
*
|
|
118
|
-
* @internal
|
|
119
|
-
*/
|
|
120
|
-
this.color = DEFAULT_COLOR;
|
|
121
|
-
/**
|
|
122
|
-
* When true, disabled prevents user interaction.
|
|
123
|
-
*/
|
|
124
|
-
this.disabled = false;
|
|
125
|
-
/**
|
|
126
|
-
* The format of the value property.
|
|
127
|
-
*
|
|
128
|
-
* When "auto", the format will be inferred from `value` when set.
|
|
129
|
-
*
|
|
130
|
-
* @default "auto"
|
|
131
|
-
*/
|
|
132
|
-
this.format = defaultFormat;
|
|
133
|
-
/** When true, hides the hex input */
|
|
134
|
-
this.hideHex = false;
|
|
135
|
-
/** When true, hides the RGB/HSV channel inputs */
|
|
136
|
-
this.hideChannels = false;
|
|
137
|
-
/** When true, hides the saved colors section */
|
|
138
|
-
this.hideSaved = false;
|
|
139
|
-
/**
|
|
140
|
-
* Label used for the blue channel
|
|
141
|
-
*
|
|
142
|
-
* @default "B"
|
|
143
|
-
*/
|
|
144
|
-
this.intlB = TEXT.b;
|
|
145
|
-
/**
|
|
146
|
-
* Label used for the blue channel description
|
|
147
|
-
*
|
|
148
|
-
* @default "Blue"
|
|
149
|
-
*/
|
|
150
|
-
this.intlBlue = TEXT.blue;
|
|
151
|
-
/**
|
|
152
|
-
* Label used for the delete color button.
|
|
153
|
-
*
|
|
154
|
-
* @default "Delete color"
|
|
155
|
-
*/
|
|
156
|
-
this.intlDeleteColor = TEXT.deleteColor;
|
|
157
|
-
/**
|
|
158
|
-
* Label used for the green channel
|
|
159
|
-
*
|
|
160
|
-
* @default "G"
|
|
161
|
-
*/
|
|
162
|
-
this.intlG = TEXT.g;
|
|
163
|
-
/**
|
|
164
|
-
* Label used for the green channel description
|
|
165
|
-
*
|
|
166
|
-
* @default "Green"
|
|
167
|
-
*/
|
|
168
|
-
this.intlGreen = TEXT.green;
|
|
169
|
-
/**
|
|
170
|
-
* Label used for the hue channel
|
|
171
|
-
*
|
|
172
|
-
* @default "H"
|
|
173
|
-
*/
|
|
174
|
-
this.intlH = TEXT.h;
|
|
175
|
-
/**
|
|
176
|
-
* Label used for the HSV mode
|
|
177
|
-
*
|
|
178
|
-
* @default "HSV"
|
|
179
|
-
*/
|
|
180
|
-
this.intlHsv = TEXT.hsv;
|
|
181
|
-
/**
|
|
182
|
-
* Label used for the hex input
|
|
183
|
-
*
|
|
184
|
-
* @default "Hex"
|
|
185
|
-
*/
|
|
186
|
-
this.intlHex = TEXT.hex;
|
|
187
|
-
/**
|
|
188
|
-
* Label used for the hue channel description
|
|
189
|
-
*
|
|
190
|
-
* @default "Hue"
|
|
191
|
-
*/
|
|
192
|
-
this.intlHue = TEXT.hue;
|
|
193
|
-
/**
|
|
194
|
-
* Label used for the hex input when there is no color selected.
|
|
195
|
-
*
|
|
196
|
-
* @default "No color"
|
|
197
|
-
*/
|
|
198
|
-
this.intlNoColor = TEXT.noColor;
|
|
199
|
-
/**
|
|
200
|
-
* Label used for the red channel
|
|
201
|
-
*
|
|
202
|
-
* @default "R"
|
|
203
|
-
*/
|
|
204
|
-
this.intlR = TEXT.r;
|
|
205
|
-
/**
|
|
206
|
-
* Label used for the red channel description
|
|
207
|
-
*
|
|
208
|
-
* @default "Red"
|
|
209
|
-
*/
|
|
210
|
-
this.intlRed = TEXT.red;
|
|
211
|
-
/**
|
|
212
|
-
* Label used for the RGB mode
|
|
213
|
-
*
|
|
214
|
-
* @default "RGB"
|
|
215
|
-
*/
|
|
216
|
-
this.intlRgb = TEXT.rgb;
|
|
217
|
-
/**
|
|
218
|
-
* Label used for the saturation channel
|
|
219
|
-
*
|
|
220
|
-
* @default "S"
|
|
221
|
-
*/
|
|
222
|
-
this.intlS = TEXT.s;
|
|
223
|
-
/**
|
|
224
|
-
* Label used for the saturation channel description
|
|
225
|
-
*
|
|
226
|
-
* @default "Saturation"
|
|
227
|
-
*/
|
|
228
|
-
this.intlSaturation = TEXT.saturation;
|
|
229
|
-
/**
|
|
230
|
-
* Label used for the save color button.
|
|
231
|
-
*
|
|
232
|
-
* @default "Save color"
|
|
233
|
-
*/
|
|
234
|
-
this.intlSaveColor = TEXT.saveColor;
|
|
235
|
-
/**
|
|
236
|
-
* Label used for the saved colors section
|
|
237
|
-
*
|
|
238
|
-
* @default "Saved"
|
|
239
|
-
*/
|
|
240
|
-
this.intlSaved = TEXT.saved;
|
|
241
|
-
/**
|
|
242
|
-
* Label used for the value channel
|
|
243
|
-
*
|
|
244
|
-
* @default "V"
|
|
245
|
-
*/
|
|
246
|
-
this.intlV = TEXT.v;
|
|
247
|
-
/**
|
|
248
|
-
* Label used for the
|
|
249
|
-
*
|
|
250
|
-
* @default "Value"
|
|
251
|
-
*/
|
|
252
|
-
this.intlValue = TEXT.value;
|
|
253
|
-
/**
|
|
254
|
-
* The scale of the color picker.
|
|
255
|
-
*/
|
|
256
|
-
this.scale = "m";
|
|
257
|
-
/**
|
|
258
|
-
* The color value.
|
|
259
|
-
*
|
|
260
|
-
* This value can be either a {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color|CSS string}
|
|
261
|
-
* a RGB, HSL or HSV object.
|
|
262
|
-
*
|
|
263
|
-
* The type will be preserved as the color is updated.
|
|
264
|
-
*
|
|
265
|
-
* @default "#007ac2"
|
|
266
|
-
* @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
|
|
267
|
-
*/
|
|
268
|
-
this.value = defaultValue;
|
|
269
|
-
this.colorFieldAndSliderHovered = false;
|
|
270
|
-
this.hueThumbState = "idle";
|
|
271
|
-
this.internalColorUpdateContext = null;
|
|
272
|
-
this.mode = CSSColorMode.HEX;
|
|
273
|
-
this.shiftKeyChannelAdjustment = 0;
|
|
274
|
-
this.sliderThumbState = "idle";
|
|
275
|
-
this.colorFieldAndSliderInteractive = false;
|
|
276
|
-
this.channelMode = "rgb";
|
|
277
|
-
this.channels = this.toChannels(DEFAULT_COLOR);
|
|
278
|
-
this.dimensions = DIMENSIONS.m;
|
|
279
|
-
this.savedColors = [];
|
|
280
|
-
this.handleTabActivate = (event) => {
|
|
281
|
-
this.channelMode = event.currentTarget.getAttribute("data-color-mode");
|
|
282
|
-
this.updateChannelsFromColor(this.color);
|
|
283
|
-
};
|
|
284
|
-
this.handleColorFieldScopeKeyDown = (event) => {
|
|
285
|
-
const { key } = event;
|
|
286
|
-
const arrowKeyToXYOffset = {
|
|
287
|
-
ArrowUp: { x: 0, y: -10 },
|
|
288
|
-
ArrowRight: { x: 10, y: 0 },
|
|
289
|
-
ArrowDown: { x: 0, y: 10 },
|
|
290
|
-
ArrowLeft: { x: -10, y: 0 }
|
|
291
|
-
};
|
|
292
|
-
if (arrowKeyToXYOffset[key]) {
|
|
293
|
-
event.preventDefault();
|
|
294
|
-
this.scopeOrientation = key === "ArrowDown" || key === "ArrowUp" ? "vertical" : "horizontal";
|
|
295
|
-
this.captureColorFieldColor(this.colorFieldScopeLeft + arrowKeyToXYOffset[key].x || 0, this.colorFieldScopeTop + arrowKeyToXYOffset[key].y || 0, false);
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
this.handleHueScopeKeyDown = (event) => {
|
|
299
|
-
const modifier = event.shiftKey ? 10 : 1;
|
|
300
|
-
const { key } = event;
|
|
301
|
-
const arrowKeyToXOffset = {
|
|
302
|
-
ArrowUp: 1,
|
|
303
|
-
ArrowRight: 1,
|
|
304
|
-
ArrowDown: -1,
|
|
305
|
-
ArrowLeft: -1
|
|
306
|
-
};
|
|
307
|
-
if (arrowKeyToXOffset[key]) {
|
|
308
|
-
event.preventDefault();
|
|
309
|
-
const delta = arrowKeyToXOffset[key] * modifier;
|
|
310
|
-
const hue = this.baseColorFieldColor.hue();
|
|
311
|
-
const color = this.baseColorFieldColor.hue(hue + delta);
|
|
312
|
-
this.internalColorSet(color, false);
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
this.handleHexInputChange = (event) => {
|
|
316
|
-
event.stopPropagation();
|
|
317
|
-
const { allowEmpty, color: color$1 } = this;
|
|
318
|
-
const input = event.target;
|
|
319
|
-
const hex = input.value;
|
|
320
|
-
if (allowEmpty && !hex) {
|
|
321
|
-
this.internalColorSet(null);
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
const normalizedHex = color$1 && normalizeHex(color$1.hex());
|
|
325
|
-
if (hex !== normalizedHex) {
|
|
326
|
-
this.internalColorSet(color(hex));
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
this.handleSavedColorSelect = (event) => {
|
|
330
|
-
const swatch = event.currentTarget;
|
|
331
|
-
this.internalColorSet(color(swatch.color));
|
|
332
|
-
};
|
|
333
|
-
this.handleChannelInput = (event) => {
|
|
334
|
-
const input = event.currentTarget;
|
|
335
|
-
const internalInput = event.detail.nativeEvent.target;
|
|
336
|
-
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
337
|
-
const limit = this.channelMode === "rgb"
|
|
338
|
-
? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
|
|
339
|
-
: HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
|
|
340
|
-
let inputValue;
|
|
341
|
-
if (this.allowEmpty && !input.value) {
|
|
342
|
-
inputValue = "";
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
const value = Number(input.value) + this.shiftKeyChannelAdjustment;
|
|
346
|
-
const clamped = clamp(value, 0, limit);
|
|
347
|
-
inputValue = clamped.toString();
|
|
348
|
-
}
|
|
349
|
-
input.value = inputValue;
|
|
350
|
-
internalInput.value = inputValue;
|
|
351
|
-
};
|
|
352
|
-
this.handleChannelChange = (event) => {
|
|
353
|
-
const input = event.currentTarget;
|
|
354
|
-
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
355
|
-
const channels = [...this.channels];
|
|
356
|
-
const shouldClearChannels = this.allowEmpty && !input.value;
|
|
357
|
-
if (shouldClearChannels) {
|
|
358
|
-
this.channels = [null, null, null];
|
|
359
|
-
this.internalColorSet(null);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
channels[channelIndex] = Number(input.value);
|
|
363
|
-
this.updateColorFromChannels(channels);
|
|
364
|
-
};
|
|
365
|
-
this.handleSavedColorKeyDown = (event) => {
|
|
366
|
-
if (isActivationKey(event.key)) {
|
|
367
|
-
event.preventDefault();
|
|
368
|
-
this.handleSavedColorSelect(event);
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
|
-
this.handleColorFieldAndSliderPointerLeave = () => {
|
|
372
|
-
this.colorFieldAndSliderInteractive = false;
|
|
373
|
-
this.colorFieldAndSliderHovered = false;
|
|
374
|
-
if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
|
|
375
|
-
this.hueThumbState = "idle";
|
|
376
|
-
this.sliderThumbState = "idle";
|
|
377
|
-
this.drawColorFieldAndSlider();
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
this.handleColorFieldAndSliderPointerDown = (event) => {
|
|
381
|
-
var _a, _b;
|
|
382
|
-
const { offsetX, offsetY } = event;
|
|
383
|
-
const region = this.getCanvasRegion(offsetY);
|
|
384
|
-
if (region === "color-field") {
|
|
385
|
-
this.hueThumbState = "drag";
|
|
386
|
-
this.captureColorFieldColor(offsetX, offsetY);
|
|
387
|
-
(_a = this.colorFieldScopeNode) === null || _a === void 0 ? void 0 : _a.focus();
|
|
388
|
-
}
|
|
389
|
-
else if (region === "slider") {
|
|
390
|
-
this.sliderThumbState = "drag";
|
|
391
|
-
this.captureHueSliderColor(offsetX);
|
|
392
|
-
(_b = this.hueScopeNode) === null || _b === void 0 ? void 0 : _b.focus();
|
|
393
|
-
}
|
|
394
|
-
// prevent text selection outside of color field & slider area
|
|
395
|
-
event.preventDefault();
|
|
396
|
-
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
397
|
-
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
398
|
-
this.activeColorFieldAndSliderRect =
|
|
399
|
-
this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
|
|
400
|
-
};
|
|
401
|
-
this.globalPointerUpHandler = () => {
|
|
402
|
-
const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
403
|
-
this.hueThumbState = "idle";
|
|
404
|
-
this.sliderThumbState = "idle";
|
|
405
|
-
this.activeColorFieldAndSliderRect = null;
|
|
406
|
-
this.drawColorFieldAndSlider();
|
|
407
|
-
if (previouslyDragging) {
|
|
408
|
-
this.calciteColorPickerChange.emit();
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
this.globalPointerMoveHandler = (event) => {
|
|
412
|
-
const { el, dimensions } = this;
|
|
413
|
-
const sliderThumbDragging = this.sliderThumbState === "drag";
|
|
414
|
-
const hueThumbDragging = this.hueThumbState === "drag";
|
|
415
|
-
if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
let samplingX;
|
|
419
|
-
let samplingY;
|
|
420
|
-
const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
|
|
421
|
-
const { clientX, clientY } = event;
|
|
422
|
-
if (this.colorFieldAndSliderHovered) {
|
|
423
|
-
samplingX = clientX - colorFieldAndSliderRect.x;
|
|
424
|
-
samplingY = clientY - colorFieldAndSliderRect.y;
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
const colorFieldWidth = dimensions.colorField.width;
|
|
428
|
-
const colorFieldHeight = dimensions.colorField.height;
|
|
429
|
-
const hueSliderHeight = dimensions.slider.height;
|
|
430
|
-
if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
|
|
431
|
-
clientX > colorFieldAndSliderRect.x) {
|
|
432
|
-
samplingX = clientX - colorFieldAndSliderRect.x;
|
|
433
|
-
}
|
|
434
|
-
else if (clientX < colorFieldAndSliderRect.x) {
|
|
435
|
-
samplingX = 0;
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
samplingX = colorFieldWidth - 1;
|
|
439
|
-
}
|
|
440
|
-
if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
|
|
441
|
-
clientY > colorFieldAndSliderRect.y) {
|
|
442
|
-
samplingY = clientY - colorFieldAndSliderRect.y;
|
|
443
|
-
}
|
|
444
|
-
else if (clientY < colorFieldAndSliderRect.y) {
|
|
445
|
-
samplingY = 0;
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
448
|
-
samplingY = colorFieldHeight + hueSliderHeight;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (hueThumbDragging) {
|
|
452
|
-
this.captureColorFieldColor(samplingX, samplingY, false);
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
this.captureHueSliderColor(samplingX);
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
|
|
459
|
-
const { dimensions: { colorField, slider, thumb } } = this;
|
|
460
|
-
this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
|
|
461
|
-
this.colorFieldAndSliderHovered = true;
|
|
462
|
-
const region = this.getCanvasRegion(offsetY);
|
|
463
|
-
if (region === "color-field") {
|
|
464
|
-
const prevHueThumbState = this.hueThumbState;
|
|
465
|
-
const color = this.baseColorFieldColor.hsv();
|
|
466
|
-
const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
|
|
467
|
-
const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
|
|
468
|
-
const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
|
|
469
|
-
let transitionedBetweenHoverAndIdle = false;
|
|
470
|
-
if (prevHueThumbState === "idle" && hoveringThumb) {
|
|
471
|
-
this.hueThumbState = "hover";
|
|
472
|
-
transitionedBetweenHoverAndIdle = true;
|
|
473
|
-
}
|
|
474
|
-
else if (prevHueThumbState === "hover" && !hoveringThumb) {
|
|
475
|
-
this.hueThumbState = "idle";
|
|
476
|
-
transitionedBetweenHoverAndIdle = true;
|
|
477
|
-
}
|
|
478
|
-
if (this.hueThumbState !== "drag") {
|
|
479
|
-
if (transitionedBetweenHoverAndIdle) {
|
|
480
|
-
// refresh since we won't update color and thus no redraw
|
|
481
|
-
this.drawColorFieldAndSlider();
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
else if (region === "slider") {
|
|
486
|
-
const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
|
|
487
|
-
const prevSliderThumbState = this.sliderThumbState;
|
|
488
|
-
const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
|
|
489
|
-
const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
|
|
490
|
-
const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
|
|
491
|
-
let sliderThumbTransitionedBetweenHoverAndIdle = false;
|
|
492
|
-
if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
|
|
493
|
-
this.sliderThumbState = "hover";
|
|
494
|
-
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
495
|
-
}
|
|
496
|
-
else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
|
|
497
|
-
this.sliderThumbState = "idle";
|
|
498
|
-
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
499
|
-
}
|
|
500
|
-
if (this.sliderThumbState !== "drag") {
|
|
501
|
-
if (sliderThumbTransitionedBetweenHoverAndIdle) {
|
|
502
|
-
// refresh since we won't update color and thus no redraw
|
|
503
|
-
this.drawColorFieldAndSlider();
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
this.storeColorFieldScope = (node) => {
|
|
509
|
-
this.colorFieldScopeNode = node;
|
|
510
|
-
};
|
|
511
|
-
this.storeHueScope = (node) => {
|
|
512
|
-
this.hueScopeNode = node;
|
|
513
|
-
};
|
|
514
|
-
this.renderChannelsTabTitle = (channelMode) => {
|
|
515
|
-
const { channelMode: activeChannelMode, intlRgb, intlHsv } = this;
|
|
516
|
-
const active = channelMode === activeChannelMode;
|
|
517
|
-
const label = channelMode === "rgb" ? intlRgb : intlHsv;
|
|
518
|
-
return (h("calcite-tab-title", { active: active, class: CSS.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate }, label));
|
|
519
|
-
};
|
|
520
|
-
this.renderChannelsTab = (channelMode) => {
|
|
521
|
-
const { channelMode: activeChannelMode, channels, intlB, intlBlue, intlG, intlGreen, intlH, intlHue, intlR, intlRed, intlS, intlSaturation, intlV, intlValue } = this;
|
|
522
|
-
const active = channelMode === activeChannelMode;
|
|
523
|
-
const isRgb = channelMode === "rgb";
|
|
524
|
-
const channelLabels = isRgb ? [intlR, intlG, intlB] : [intlH, intlS, intlV];
|
|
525
|
-
const channelAriaLabels = isRgb
|
|
526
|
-
? [intlRed, intlGreen, intlBlue]
|
|
527
|
-
: [intlHue, intlSaturation, intlValue];
|
|
528
|
-
const direction = getElementDir(this.el);
|
|
529
|
-
return (h("calcite-tab", { active: active, class: CSS.control, key: channelMode }, h("div", { class: CSS.channels, dir: "ltr" }, channels.map((channel, index) =>
|
|
530
|
-
/* the channel container is ltr, so we apply the host's direction */
|
|
531
|
-
this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
|
|
532
|
-
};
|
|
533
|
-
this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS.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() }));
|
|
534
|
-
this.deleteColor = () => {
|
|
535
|
-
const colorToDelete = this.color.hex();
|
|
536
|
-
const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
|
|
537
|
-
if (!inStorage) {
|
|
538
|
-
return;
|
|
539
|
-
}
|
|
540
|
-
const savedColors = this.savedColors.filter((color) => color !== colorToDelete);
|
|
541
|
-
this.savedColors = savedColors;
|
|
542
|
-
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
543
|
-
if (this.storageId) {
|
|
544
|
-
localStorage.setItem(storageKey, JSON.stringify(savedColors));
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
this.saveColor = () => {
|
|
548
|
-
const colorToSave = this.color.hex();
|
|
549
|
-
const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
|
|
550
|
-
if (alreadySaved) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
const savedColors = [...this.savedColors, colorToSave];
|
|
554
|
-
this.savedColors = savedColors;
|
|
555
|
-
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
556
|
-
if (this.storageId) {
|
|
557
|
-
localStorage.setItem(storageKey, JSON.stringify(savedColors));
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
this.drawColorFieldAndSlider = throttle(() => {
|
|
561
|
-
if (!this.fieldAndSliderRenderingContext) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
this.drawColorField();
|
|
565
|
-
this.drawHueSlider();
|
|
566
|
-
}, throttleFor60FpsInMs);
|
|
567
|
-
this.captureColorFieldColor = (x, y, skipEqual = true) => {
|
|
568
|
-
const { dimensions: { colorField: { height, width } } } = this;
|
|
569
|
-
const saturation = Math.round((HSV_LIMITS.s / width) * x);
|
|
570
|
-
const value = Math.round((HSV_LIMITS.v / height) * (height - y));
|
|
571
|
-
this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
|
|
572
|
-
};
|
|
573
|
-
this.initColorFieldAndSlider = (canvas) => {
|
|
574
|
-
this.fieldAndSliderRenderingContext = canvas.getContext("2d");
|
|
575
|
-
this.updateCanvasSize(canvas);
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
handleColorChange(color, oldColor) {
|
|
579
|
-
this.drawColorFieldAndSlider();
|
|
580
|
-
this.updateChannelsFromColor(color);
|
|
581
|
-
this.previousColor = oldColor;
|
|
582
|
-
}
|
|
583
|
-
handleFormatChange(format) {
|
|
584
|
-
this.setMode(format);
|
|
585
|
-
this.internalColorSet(this.color, false, "internal");
|
|
586
|
-
}
|
|
587
|
-
handleScaleChange(scale = "m") {
|
|
588
|
-
var _a;
|
|
589
|
-
this.updateDimensions(scale);
|
|
590
|
-
this.updateCanvasSize((_a = this.fieldAndSliderRenderingContext) === null || _a === void 0 ? void 0 : _a.canvas);
|
|
591
|
-
}
|
|
592
|
-
handleValueChange(value, oldValue) {
|
|
593
|
-
const { allowEmpty, format } = this;
|
|
594
|
-
const checkMode = !allowEmpty || value;
|
|
595
|
-
let modeChanged = false;
|
|
596
|
-
if (checkMode) {
|
|
597
|
-
const nextMode = parseMode(value);
|
|
598
|
-
if (!nextMode || (format !== "auto" && nextMode !== format)) {
|
|
599
|
-
this.showIncompatibleColorWarning(value, format);
|
|
600
|
-
this.value = oldValue;
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
modeChanged = this.mode !== nextMode;
|
|
604
|
-
this.setMode(nextMode);
|
|
605
|
-
}
|
|
606
|
-
const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
607
|
-
if (this.internalColorUpdateContext === "initial") {
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
if (this.internalColorUpdateContext === "user-interaction") {
|
|
611
|
-
this.calciteColorPickerInput.emit();
|
|
612
|
-
if (!dragging) {
|
|
613
|
-
this.calciteColorPickerChange.emit();
|
|
614
|
-
}
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
const color$1 = allowEmpty && !value ? null : color(value);
|
|
618
|
-
const colorChanged = !colorEqual(color$1, this.color);
|
|
619
|
-
if (modeChanged || colorChanged) {
|
|
620
|
-
this.internalColorSet(color$1, true, "internal");
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
//--------------------------------------------------------------------------
|
|
624
|
-
//
|
|
625
|
-
// Internal State/Props
|
|
626
|
-
//
|
|
627
|
-
//--------------------------------------------------------------------------
|
|
628
|
-
get baseColorFieldColor() {
|
|
629
|
-
return this.color || this.previousColor || DEFAULT_COLOR;
|
|
630
|
-
}
|
|
631
|
-
// using @Listen as a workaround for VDOM listener not firing
|
|
632
|
-
handleChannelKeyUpOrDown(event) {
|
|
633
|
-
this.shiftKeyChannelAdjustment = 0;
|
|
634
|
-
const { key } = event;
|
|
635
|
-
if ((key !== "ArrowUp" && key !== "ArrowDown") ||
|
|
636
|
-
!event.composedPath().some((node) => { var _a; return (_a = node.classList) === null || _a === void 0 ? void 0 : _a.contains(CSS.channel); })) {
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
const { shiftKey } = event;
|
|
640
|
-
event.preventDefault();
|
|
641
|
-
if (!this.color) {
|
|
642
|
-
this.internalColorSet(this.previousColor);
|
|
643
|
-
event.stopPropagation();
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
// this gets applied to the input's up/down arrow increment/decrement
|
|
647
|
-
const complementaryBump = 9;
|
|
648
|
-
this.shiftKeyChannelAdjustment =
|
|
649
|
-
key === "ArrowUp" && shiftKey
|
|
650
|
-
? complementaryBump
|
|
651
|
-
: key === "ArrowDown" && shiftKey
|
|
652
|
-
? -complementaryBump
|
|
653
|
-
: 0;
|
|
654
|
-
}
|
|
655
|
-
//--------------------------------------------------------------------------
|
|
656
|
-
//
|
|
657
|
-
// Public Methods
|
|
658
|
-
//
|
|
659
|
-
//--------------------------------------------------------------------------
|
|
660
|
-
/** Sets focus on the component. */
|
|
661
|
-
async setFocus() {
|
|
662
|
-
return focusElement(this.colorFieldScopeNode);
|
|
663
|
-
}
|
|
664
|
-
//--------------------------------------------------------------------------
|
|
665
|
-
//
|
|
666
|
-
// Lifecycle
|
|
667
|
-
//
|
|
668
|
-
//--------------------------------------------------------------------------
|
|
669
|
-
componentWillLoad() {
|
|
670
|
-
const { allowEmpty, color: color$1, format, value } = this;
|
|
671
|
-
const willSetNoColor = allowEmpty && !value;
|
|
672
|
-
const parsedMode = parseMode(value);
|
|
673
|
-
const valueIsCompatible = willSetNoColor || (format === "auto" && parsedMode) || format === parsedMode;
|
|
674
|
-
const initialColor = willSetNoColor ? null : valueIsCompatible ? color(value) : color$1;
|
|
675
|
-
if (!valueIsCompatible) {
|
|
676
|
-
this.showIncompatibleColorWarning(value, format);
|
|
677
|
-
}
|
|
678
|
-
this.setMode(format);
|
|
679
|
-
this.internalColorSet(initialColor, false, "initial");
|
|
680
|
-
this.updateDimensions(this.scale);
|
|
681
|
-
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
682
|
-
if (this.storageId && localStorage.getItem(storageKey)) {
|
|
683
|
-
this.savedColors = JSON.parse(localStorage.getItem(storageKey));
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
disconnectedCallback() {
|
|
687
|
-
document.removeEventListener("pointermove", this.globalPointerMoveHandler);
|
|
688
|
-
document.removeEventListener("pointerup", this.globalPointerUpHandler);
|
|
689
|
-
}
|
|
690
|
-
componentDidRender() {
|
|
691
|
-
updateHostInteraction(this);
|
|
692
|
-
}
|
|
693
|
-
//--------------------------------------------------------------------------
|
|
694
|
-
//
|
|
695
|
-
// Render Methods
|
|
696
|
-
//
|
|
697
|
-
//--------------------------------------------------------------------------
|
|
698
|
-
render() {
|
|
699
|
-
const { allowEmpty, color, intlDeleteColor, hideHex, hideChannels, hideSaved, intlHex, intlSaved, intlSaveColor, savedColors, scale } = this;
|
|
700
|
-
const selectedColorInHex = color ? color.hex() : null;
|
|
701
|
-
const hexInputScale = scale === "l" ? "m" : "s";
|
|
702
|
-
const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
|
|
703
|
-
const hueTop = hueScopeTop !== null && hueScopeTop !== void 0 ? hueScopeTop : sliderHeight / 2 + colorFieldHeight;
|
|
704
|
-
const hueLeft = hueScopeLeft !== null && hueScopeLeft !== void 0 ? hueScopeLeft : (colorFieldWidth * DEFAULT_COLOR.hue()) / HSV_LIMITS.h;
|
|
705
|
-
const noColor = color === null;
|
|
706
|
-
const vertical = scopeOrientation === "vertical";
|
|
707
|
-
return (h("div", { class: CSS.container }, h("div", { class: CSS.colorFieldAndSliderWrap }, h("canvas", { class: {
|
|
708
|
-
[CSS.colorFieldAndSlider]: true,
|
|
709
|
-
[CSS.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
|
|
710
|
-
}, 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.scope]: true, [CSS.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.round().hue(), class: { [CSS.scope]: true, [CSS.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: {
|
|
711
|
-
[CSS.controlSection]: true,
|
|
712
|
-
[CSS.section]: true
|
|
713
|
-
} }, hideHex ? null : (h("div", { class: CSS.hexOptions }, h("span", { class: {
|
|
714
|
-
[CSS.header]: true,
|
|
715
|
-
[CSS.headerHex]: true
|
|
716
|
-
} }, intlHex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS.control, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
|
|
717
|
-
[CSS.colorModeContainer]: true,
|
|
718
|
-
[CSS.splitSection]: true
|
|
719
|
-
}, 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.savedColorsSection]: true, [CSS.section]: true } }, h("div", { class: CSS.header }, h("label", null, intlSaved), h("div", { class: CSS.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS.deleteColor, color: "neutral", disabled: noColor, iconStart: "minus", label: intlDeleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS.saveColor, color: "neutral", disabled: noColor, iconStart: "plus", label: intlSaveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS.savedColors }, [
|
|
720
|
-
...savedColors.map((color) => (h("calcite-color-picker-swatch", { active: selectedColorInHex === color, class: CSS.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
|
|
721
|
-
])) : null))));
|
|
722
|
-
}
|
|
723
|
-
// --------------------------------------------------------------------------
|
|
724
|
-
//
|
|
725
|
-
// Private Methods
|
|
726
|
-
//
|
|
727
|
-
//--------------------------------------------------------------------------
|
|
728
|
-
handleKeyDown(event) {
|
|
729
|
-
if (event.key === "Enter") {
|
|
730
|
-
event.preventDefault();
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
showIncompatibleColorWarning(value, format) {
|
|
734
|
-
console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
|
|
735
|
-
}
|
|
736
|
-
setMode(format) {
|
|
737
|
-
this.mode = format === "auto" ? this.mode : format;
|
|
738
|
-
}
|
|
739
|
-
captureHueSliderColor(x) {
|
|
740
|
-
const { dimensions: { slider: { width } } } = this;
|
|
741
|
-
const hue = (360 / width) * x;
|
|
742
|
-
this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
|
|
743
|
-
}
|
|
744
|
-
getCanvasRegion(y) {
|
|
745
|
-
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
|
|
746
|
-
if (y <= colorFieldHeight) {
|
|
747
|
-
return "color-field";
|
|
748
|
-
}
|
|
749
|
-
if (y <= colorFieldHeight + sliderHeight) {
|
|
750
|
-
return "slider";
|
|
751
|
-
}
|
|
752
|
-
return "none";
|
|
753
|
-
}
|
|
754
|
-
internalColorSet(color, skipEqual = true, context = "user-interaction") {
|
|
755
|
-
if (skipEqual && colorEqual(color, this.color)) {
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
758
|
-
this.internalColorUpdateContext = context;
|
|
759
|
-
this.color = color;
|
|
760
|
-
this.value = this.toValue(color);
|
|
761
|
-
this.internalColorUpdateContext = null;
|
|
762
|
-
}
|
|
763
|
-
toValue(color, format = this.mode) {
|
|
764
|
-
if (!color) {
|
|
765
|
-
return null;
|
|
766
|
-
}
|
|
767
|
-
const hexMode = "hex";
|
|
768
|
-
if (format.includes(hexMode)) {
|
|
769
|
-
return normalizeHex(color.round()[hexMode]());
|
|
770
|
-
}
|
|
771
|
-
if (format.includes("-css")) {
|
|
772
|
-
return color[format.replace("-css", "").replace("a", "")]().round().string();
|
|
773
|
-
}
|
|
774
|
-
const colorObject = color[format]().round().object();
|
|
775
|
-
if (format.endsWith("a")) {
|
|
776
|
-
// normalize alpha prop
|
|
777
|
-
colorObject.a = colorObject.alpha;
|
|
778
|
-
delete colorObject.alpha;
|
|
779
|
-
}
|
|
780
|
-
return colorObject;
|
|
781
|
-
}
|
|
782
|
-
getSliderCapSpacing() {
|
|
783
|
-
const { dimensions: { slider: { height }, thumb: { radius } } } = this;
|
|
784
|
-
return radius * 2 - height;
|
|
785
|
-
}
|
|
786
|
-
updateDimensions(scale = "m") {
|
|
787
|
-
this.dimensions = DIMENSIONS[scale];
|
|
788
|
-
}
|
|
789
|
-
drawColorField() {
|
|
790
|
-
const context = this.fieldAndSliderRenderingContext;
|
|
791
|
-
const { dimensions: { colorField: { height, width } } } = this;
|
|
792
|
-
context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
|
|
793
|
-
context.fillRect(0, 0, width, height);
|
|
794
|
-
const whiteGradient = context.createLinearGradient(0, 0, width, 0);
|
|
795
|
-
whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
|
|
796
|
-
whiteGradient.addColorStop(1, "rgba(255,255,255,0)");
|
|
797
|
-
context.fillStyle = whiteGradient;
|
|
798
|
-
context.fillRect(0, 0, width, height);
|
|
799
|
-
const blackGradient = context.createLinearGradient(0, 0, 0, height);
|
|
800
|
-
blackGradient.addColorStop(0, "rgba(0,0,0,0)");
|
|
801
|
-
blackGradient.addColorStop(1, "rgba(0,0,0,1)");
|
|
802
|
-
context.fillStyle = blackGradient;
|
|
803
|
-
context.fillRect(0, 0, width, height);
|
|
804
|
-
this.drawActiveColorFieldColor();
|
|
805
|
-
}
|
|
806
|
-
setCanvasContextSize(canvas, { height, width }) {
|
|
807
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
808
|
-
canvas.width = width * devicePixelRatio;
|
|
809
|
-
canvas.height = height * devicePixelRatio;
|
|
810
|
-
canvas.style.height = `${height}px`;
|
|
811
|
-
canvas.style.width = `${width}px`;
|
|
812
|
-
const context = canvas.getContext("2d");
|
|
813
|
-
context.scale(devicePixelRatio, devicePixelRatio);
|
|
814
|
-
}
|
|
815
|
-
updateCanvasSize(canvas) {
|
|
816
|
-
if (!canvas) {
|
|
817
|
-
return;
|
|
818
|
-
}
|
|
819
|
-
this.setCanvasContextSize(canvas, {
|
|
820
|
-
width: this.dimensions.colorField.width,
|
|
821
|
-
height: this.dimensions.colorField.height +
|
|
822
|
-
this.dimensions.slider.height +
|
|
823
|
-
this.getSliderCapSpacing() * 2
|
|
824
|
-
});
|
|
825
|
-
this.drawColorFieldAndSlider();
|
|
826
|
-
}
|
|
827
|
-
containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
|
|
828
|
-
return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
|
|
829
|
-
Math.pow(boundsRadius, 2));
|
|
830
|
-
}
|
|
831
|
-
drawActiveColorFieldColor() {
|
|
832
|
-
const { color } = this;
|
|
833
|
-
if (!color) {
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
836
|
-
const hsvColor = color.hsv();
|
|
837
|
-
const { dimensions: { colorField: { height, width }, thumb: { radius } } } = this;
|
|
838
|
-
const x = hsvColor.saturationv() / (HSV_LIMITS.s / width);
|
|
839
|
-
const y = height - hsvColor.value() / (HSV_LIMITS.v / height);
|
|
840
|
-
requestAnimationFrame(() => {
|
|
841
|
-
this.colorFieldScopeLeft = x;
|
|
842
|
-
this.colorFieldScopeTop = y;
|
|
843
|
-
});
|
|
844
|
-
this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
|
|
845
|
-
}
|
|
846
|
-
drawThumb(context, radius, x, y, color, state) {
|
|
847
|
-
const startAngle = 0;
|
|
848
|
-
const endAngle = 2 * Math.PI;
|
|
849
|
-
context.beginPath();
|
|
850
|
-
context.arc(x, y, radius, startAngle, endAngle);
|
|
851
|
-
context.shadowBlur = state === "hover" ? 32 : 16;
|
|
852
|
-
context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
|
|
853
|
-
context.fillStyle = "#fff";
|
|
854
|
-
context.fill();
|
|
855
|
-
context.beginPath();
|
|
856
|
-
context.arc(x, y, radius - 3, startAngle, endAngle);
|
|
857
|
-
context.shadowBlur = 0;
|
|
858
|
-
context.shadowColor = "transparent";
|
|
859
|
-
context.fillStyle = color.rgb().string();
|
|
860
|
-
context.fill();
|
|
861
|
-
}
|
|
862
|
-
drawActiveHueSliderColor() {
|
|
863
|
-
const { color } = this;
|
|
864
|
-
if (!color) {
|
|
865
|
-
return;
|
|
866
|
-
}
|
|
867
|
-
const hsvColor = color.hsv().saturationv(100).value(100);
|
|
868
|
-
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
|
|
869
|
-
const x = hsvColor.hue() / (360 / width);
|
|
870
|
-
const y = height / 2 + colorFieldHeight;
|
|
871
|
-
requestAnimationFrame(() => {
|
|
872
|
-
this.hueScopeLeft = x;
|
|
873
|
-
this.hueScopeTop = y;
|
|
874
|
-
});
|
|
875
|
-
this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
|
|
876
|
-
}
|
|
877
|
-
drawHueSlider() {
|
|
878
|
-
const context = this.fieldAndSliderRenderingContext;
|
|
879
|
-
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
|
|
880
|
-
const gradient = context.createLinearGradient(0, 0, width, 0);
|
|
881
|
-
const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
|
|
882
|
-
const offset = 1 / (hueSliderColorStopKeywords.length - 1);
|
|
883
|
-
let currentOffset = 0;
|
|
884
|
-
hueSliderColorStopKeywords.forEach((keyword) => {
|
|
885
|
-
gradient.addColorStop(currentOffset, color(keyword).string());
|
|
886
|
-
currentOffset += offset;
|
|
887
|
-
});
|
|
888
|
-
context.fillStyle = gradient;
|
|
889
|
-
context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
|
|
890
|
-
context.fillRect(0, colorFieldHeight, width, height);
|
|
891
|
-
this.drawActiveHueSliderColor();
|
|
892
|
-
}
|
|
893
|
-
updateColorFromChannels(channels) {
|
|
894
|
-
this.internalColorSet(color(channels, this.channelMode));
|
|
895
|
-
}
|
|
896
|
-
updateChannelsFromColor(color) {
|
|
897
|
-
this.channels = color ? this.toChannels(color) : [null, null, null];
|
|
898
|
-
}
|
|
899
|
-
toChannels(color) {
|
|
900
|
-
const { channelMode } = this;
|
|
901
|
-
return color[channelMode]()
|
|
902
|
-
.array()
|
|
903
|
-
.map((value) => Math.floor(value));
|
|
904
|
-
}
|
|
905
|
-
get el() { return this; }
|
|
906
|
-
static get watchers() { return {
|
|
907
|
-
"color": ["handleColorChange"],
|
|
908
|
-
"format": ["handleFormatChange"],
|
|
909
|
-
"scale": ["handleScaleChange"],
|
|
910
|
-
"value": ["handleValueChange"]
|
|
911
|
-
}; }
|
|
912
|
-
static get style() { return colorPickerCss; }
|
|
913
|
-
}, [1, "calcite-color-picker", {
|
|
914
|
-
"allowEmpty": [4, "allow-empty"],
|
|
915
|
-
"appearance": [513],
|
|
916
|
-
"color": [1040],
|
|
917
|
-
"disabled": [516],
|
|
918
|
-
"format": [1],
|
|
919
|
-
"hideHex": [4, "hide-hex"],
|
|
920
|
-
"hideChannels": [4, "hide-channels"],
|
|
921
|
-
"hideSaved": [4, "hide-saved"],
|
|
922
|
-
"intlB": [1, "intl-b"],
|
|
923
|
-
"intlBlue": [1, "intl-blue"],
|
|
924
|
-
"intlDeleteColor": [1, "intl-delete-color"],
|
|
925
|
-
"intlG": [1, "intl-g"],
|
|
926
|
-
"intlGreen": [1, "intl-green"],
|
|
927
|
-
"intlH": [1, "intl-h"],
|
|
928
|
-
"intlHsv": [1, "intl-hsv"],
|
|
929
|
-
"intlHex": [1, "intl-hex"],
|
|
930
|
-
"intlHue": [1, "intl-hue"],
|
|
931
|
-
"intlNoColor": [1, "intl-no-color"],
|
|
932
|
-
"intlR": [1, "intl-r"],
|
|
933
|
-
"intlRed": [1, "intl-red"],
|
|
934
|
-
"intlRgb": [1, "intl-rgb"],
|
|
935
|
-
"intlS": [1, "intl-s"],
|
|
936
|
-
"intlSaturation": [1, "intl-saturation"],
|
|
937
|
-
"intlSaveColor": [1, "intl-save-color"],
|
|
938
|
-
"intlSaved": [1, "intl-saved"],
|
|
939
|
-
"intlV": [1, "intl-v"],
|
|
940
|
-
"intlValue": [1, "intl-value"],
|
|
941
|
-
"scale": [513],
|
|
942
|
-
"storageId": [1, "storage-id"],
|
|
943
|
-
"numberingSystem": [1, "numbering-system"],
|
|
944
|
-
"value": [1025],
|
|
945
|
-
"colorFieldAndSliderInteractive": [32],
|
|
946
|
-
"channelMode": [32],
|
|
947
|
-
"channels": [32],
|
|
948
|
-
"dimensions": [32],
|
|
949
|
-
"savedColors": [32],
|
|
950
|
-
"colorFieldScopeTop": [32],
|
|
951
|
-
"colorFieldScopeLeft": [32],
|
|
952
|
-
"scopeOrientation": [32],
|
|
953
|
-
"hueScopeLeft": [32],
|
|
954
|
-
"hueScopeTop": [32],
|
|
955
|
-
"setFocus": [64]
|
|
956
|
-
}, [[2, "keydown", "handleChannelKeyUpOrDown"], [2, "keyup", "handleChannelKeyUpOrDown"]]]);
|
|
957
|
-
function defineCustomElement$1() {
|
|
958
|
-
if (typeof customElements === "undefined") {
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
const components = ["calcite-color-picker", "calcite-button", "calcite-color-picker-hex-input", "calcite-color-picker-swatch", "calcite-icon", "calcite-input", "calcite-loader", "calcite-progress", "calcite-tab", "calcite-tab-nav", "calcite-tab-title", "calcite-tabs"];
|
|
962
|
-
components.forEach(tagName => { switch (tagName) {
|
|
963
|
-
case "calcite-color-picker":
|
|
964
|
-
if (!customElements.get(tagName)) {
|
|
965
|
-
customElements.define(tagName, ColorPicker);
|
|
966
|
-
}
|
|
967
|
-
break;
|
|
968
|
-
case "calcite-button":
|
|
969
|
-
if (!customElements.get(tagName)) {
|
|
970
|
-
defineCustomElement$c();
|
|
971
|
-
}
|
|
972
|
-
break;
|
|
973
|
-
case "calcite-color-picker-hex-input":
|
|
974
|
-
if (!customElements.get(tagName)) {
|
|
975
|
-
defineCustomElement$b();
|
|
976
|
-
}
|
|
977
|
-
break;
|
|
978
|
-
case "calcite-color-picker-swatch":
|
|
979
|
-
if (!customElements.get(tagName)) {
|
|
980
|
-
defineCustomElement$a();
|
|
981
|
-
}
|
|
982
|
-
break;
|
|
983
|
-
case "calcite-icon":
|
|
984
|
-
if (!customElements.get(tagName)) {
|
|
985
|
-
defineCustomElement$9();
|
|
986
|
-
}
|
|
987
|
-
break;
|
|
988
|
-
case "calcite-input":
|
|
989
|
-
if (!customElements.get(tagName)) {
|
|
990
|
-
defineCustomElement$8();
|
|
991
|
-
}
|
|
992
|
-
break;
|
|
993
|
-
case "calcite-loader":
|
|
994
|
-
if (!customElements.get(tagName)) {
|
|
995
|
-
defineCustomElement$7();
|
|
996
|
-
}
|
|
997
|
-
break;
|
|
998
|
-
case "calcite-progress":
|
|
999
|
-
if (!customElements.get(tagName)) {
|
|
1000
|
-
defineCustomElement$6();
|
|
1001
|
-
}
|
|
1002
|
-
break;
|
|
1003
|
-
case "calcite-tab":
|
|
1004
|
-
if (!customElements.get(tagName)) {
|
|
1005
|
-
defineCustomElement$5();
|
|
1006
|
-
}
|
|
1007
|
-
break;
|
|
1008
|
-
case "calcite-tab-nav":
|
|
1009
|
-
if (!customElements.get(tagName)) {
|
|
1010
|
-
defineCustomElement$4();
|
|
1011
|
-
}
|
|
1012
|
-
break;
|
|
1013
|
-
case "calcite-tab-title":
|
|
1014
|
-
if (!customElements.get(tagName)) {
|
|
1015
|
-
defineCustomElement$3();
|
|
1016
|
-
}
|
|
1017
|
-
break;
|
|
1018
|
-
case "calcite-tabs":
|
|
1019
|
-
if (!customElements.get(tagName)) {
|
|
1020
|
-
defineCustomElement$2();
|
|
1021
|
-
}
|
|
1022
|
-
break;
|
|
1023
|
-
} });
|
|
1024
|
-
}
|
|
92
|
+
const throttleFor60FpsInMs = 16;
|
|
93
|
+
const defaultValue = normalizeHex(DEFAULT_COLOR.hex());
|
|
94
|
+
const defaultFormat = "auto";
|
|
95
|
+
const ColorPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
96
|
+
constructor() {
|
|
97
|
+
super();
|
|
98
|
+
this.__registerHost();
|
|
99
|
+
this.__attachShadow();
|
|
100
|
+
this.calciteColorPickerChange = createEvent(this, "calciteColorPickerChange", 6);
|
|
101
|
+
this.calciteColorPickerInput = createEvent(this, "calciteColorPickerInput", 6);
|
|
102
|
+
//--------------------------------------------------------------------------
|
|
103
|
+
//
|
|
104
|
+
// Public properties
|
|
105
|
+
//
|
|
106
|
+
//--------------------------------------------------------------------------
|
|
107
|
+
/**
|
|
108
|
+
* When false, empty color (null) will be allowed as a value. Otherwise, a color value is always enforced by the component.
|
|
109
|
+
*
|
|
110
|
+
* When true, clearing the input and blurring will restore the last valid color set. When false, it will set it to empty.
|
|
111
|
+
*/
|
|
112
|
+
this.allowEmpty = false;
|
|
113
|
+
/** specify the appearance - solid (containing border), or minimal (no containing border) */
|
|
114
|
+
this.appearance = "solid";
|
|
115
|
+
/**
|
|
116
|
+
* Internal prop for advanced use-cases.
|
|
117
|
+
*
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
this.color = DEFAULT_COLOR;
|
|
121
|
+
/**
|
|
122
|
+
* When true, disabled prevents user interaction.
|
|
123
|
+
*/
|
|
124
|
+
this.disabled = false;
|
|
125
|
+
/**
|
|
126
|
+
* The format of the value property.
|
|
127
|
+
*
|
|
128
|
+
* When "auto", the format will be inferred from `value` when set.
|
|
129
|
+
*
|
|
130
|
+
* @default "auto"
|
|
131
|
+
*/
|
|
132
|
+
this.format = defaultFormat;
|
|
133
|
+
/** When true, hides the hex input */
|
|
134
|
+
this.hideHex = false;
|
|
135
|
+
/** When true, hides the RGB/HSV channel inputs */
|
|
136
|
+
this.hideChannels = false;
|
|
137
|
+
/** When true, hides the saved colors section */
|
|
138
|
+
this.hideSaved = false;
|
|
139
|
+
/**
|
|
140
|
+
* Label used for the blue channel
|
|
141
|
+
*
|
|
142
|
+
* @default "B"
|
|
143
|
+
*/
|
|
144
|
+
this.intlB = TEXT.b;
|
|
145
|
+
/**
|
|
146
|
+
* Label used for the blue channel description
|
|
147
|
+
*
|
|
148
|
+
* @default "Blue"
|
|
149
|
+
*/
|
|
150
|
+
this.intlBlue = TEXT.blue;
|
|
151
|
+
/**
|
|
152
|
+
* Label used for the delete color button.
|
|
153
|
+
*
|
|
154
|
+
* @default "Delete color"
|
|
155
|
+
*/
|
|
156
|
+
this.intlDeleteColor = TEXT.deleteColor;
|
|
157
|
+
/**
|
|
158
|
+
* Label used for the green channel
|
|
159
|
+
*
|
|
160
|
+
* @default "G"
|
|
161
|
+
*/
|
|
162
|
+
this.intlG = TEXT.g;
|
|
163
|
+
/**
|
|
164
|
+
* Label used for the green channel description
|
|
165
|
+
*
|
|
166
|
+
* @default "Green"
|
|
167
|
+
*/
|
|
168
|
+
this.intlGreen = TEXT.green;
|
|
169
|
+
/**
|
|
170
|
+
* Label used for the hue channel
|
|
171
|
+
*
|
|
172
|
+
* @default "H"
|
|
173
|
+
*/
|
|
174
|
+
this.intlH = TEXT.h;
|
|
175
|
+
/**
|
|
176
|
+
* Label used for the HSV mode
|
|
177
|
+
*
|
|
178
|
+
* @default "HSV"
|
|
179
|
+
*/
|
|
180
|
+
this.intlHsv = TEXT.hsv;
|
|
181
|
+
/**
|
|
182
|
+
* Label used for the hex input
|
|
183
|
+
*
|
|
184
|
+
* @default "Hex"
|
|
185
|
+
*/
|
|
186
|
+
this.intlHex = TEXT.hex;
|
|
187
|
+
/**
|
|
188
|
+
* Label used for the hue channel description
|
|
189
|
+
*
|
|
190
|
+
* @default "Hue"
|
|
191
|
+
*/
|
|
192
|
+
this.intlHue = TEXT.hue;
|
|
193
|
+
/**
|
|
194
|
+
* Label used for the hex input when there is no color selected.
|
|
195
|
+
*
|
|
196
|
+
* @default "No color"
|
|
197
|
+
*/
|
|
198
|
+
this.intlNoColor = TEXT.noColor;
|
|
199
|
+
/**
|
|
200
|
+
* Label used for the red channel
|
|
201
|
+
*
|
|
202
|
+
* @default "R"
|
|
203
|
+
*/
|
|
204
|
+
this.intlR = TEXT.r;
|
|
205
|
+
/**
|
|
206
|
+
* Label used for the red channel description
|
|
207
|
+
*
|
|
208
|
+
* @default "Red"
|
|
209
|
+
*/
|
|
210
|
+
this.intlRed = TEXT.red;
|
|
211
|
+
/**
|
|
212
|
+
* Label used for the RGB mode
|
|
213
|
+
*
|
|
214
|
+
* @default "RGB"
|
|
215
|
+
*/
|
|
216
|
+
this.intlRgb = TEXT.rgb;
|
|
217
|
+
/**
|
|
218
|
+
* Label used for the saturation channel
|
|
219
|
+
*
|
|
220
|
+
* @default "S"
|
|
221
|
+
*/
|
|
222
|
+
this.intlS = TEXT.s;
|
|
223
|
+
/**
|
|
224
|
+
* Label used for the saturation channel description
|
|
225
|
+
*
|
|
226
|
+
* @default "Saturation"
|
|
227
|
+
*/
|
|
228
|
+
this.intlSaturation = TEXT.saturation;
|
|
229
|
+
/**
|
|
230
|
+
* Label used for the save color button.
|
|
231
|
+
*
|
|
232
|
+
* @default "Save color"
|
|
233
|
+
*/
|
|
234
|
+
this.intlSaveColor = TEXT.saveColor;
|
|
235
|
+
/**
|
|
236
|
+
* Label used for the saved colors section
|
|
237
|
+
*
|
|
238
|
+
* @default "Saved"
|
|
239
|
+
*/
|
|
240
|
+
this.intlSaved = TEXT.saved;
|
|
241
|
+
/**
|
|
242
|
+
* Label used for the value channel
|
|
243
|
+
*
|
|
244
|
+
* @default "V"
|
|
245
|
+
*/
|
|
246
|
+
this.intlV = TEXT.v;
|
|
247
|
+
/**
|
|
248
|
+
* Label used for the
|
|
249
|
+
*
|
|
250
|
+
* @default "Value"
|
|
251
|
+
*/
|
|
252
|
+
this.intlValue = TEXT.value;
|
|
253
|
+
/**
|
|
254
|
+
* The scale of the color picker.
|
|
255
|
+
*/
|
|
256
|
+
this.scale = "m";
|
|
257
|
+
/**
|
|
258
|
+
* The color value.
|
|
259
|
+
*
|
|
260
|
+
* This value can be either a {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color|CSS string}
|
|
261
|
+
* a RGB, HSL or HSV object.
|
|
262
|
+
*
|
|
263
|
+
* The type will be preserved as the color is updated.
|
|
264
|
+
*
|
|
265
|
+
* @default "#007ac2"
|
|
266
|
+
* @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
|
|
267
|
+
*/
|
|
268
|
+
this.value = defaultValue;
|
|
269
|
+
this.colorFieldAndSliderHovered = false;
|
|
270
|
+
this.hueThumbState = "idle";
|
|
271
|
+
this.internalColorUpdateContext = null;
|
|
272
|
+
this.mode = CSSColorMode.HEX;
|
|
273
|
+
this.shiftKeyChannelAdjustment = 0;
|
|
274
|
+
this.sliderThumbState = "idle";
|
|
275
|
+
this.colorFieldAndSliderInteractive = false;
|
|
276
|
+
this.channelMode = "rgb";
|
|
277
|
+
this.channels = this.toChannels(DEFAULT_COLOR);
|
|
278
|
+
this.dimensions = DIMENSIONS.m;
|
|
279
|
+
this.savedColors = [];
|
|
280
|
+
this.handleTabActivate = (event) => {
|
|
281
|
+
this.channelMode = event.currentTarget.getAttribute("data-color-mode");
|
|
282
|
+
this.updateChannelsFromColor(this.color);
|
|
283
|
+
};
|
|
284
|
+
this.handleColorFieldScopeKeyDown = (event) => {
|
|
285
|
+
const { key } = event;
|
|
286
|
+
const arrowKeyToXYOffset = {
|
|
287
|
+
ArrowUp: { x: 0, y: -10 },
|
|
288
|
+
ArrowRight: { x: 10, y: 0 },
|
|
289
|
+
ArrowDown: { x: 0, y: 10 },
|
|
290
|
+
ArrowLeft: { x: -10, y: 0 }
|
|
291
|
+
};
|
|
292
|
+
if (arrowKeyToXYOffset[key]) {
|
|
293
|
+
event.preventDefault();
|
|
294
|
+
this.scopeOrientation = key === "ArrowDown" || key === "ArrowUp" ? "vertical" : "horizontal";
|
|
295
|
+
this.captureColorFieldColor(this.colorFieldScopeLeft + arrowKeyToXYOffset[key].x || 0, this.colorFieldScopeTop + arrowKeyToXYOffset[key].y || 0, false);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
this.handleHueScopeKeyDown = (event) => {
|
|
299
|
+
const modifier = event.shiftKey ? 10 : 1;
|
|
300
|
+
const { key } = event;
|
|
301
|
+
const arrowKeyToXOffset = {
|
|
302
|
+
ArrowUp: 1,
|
|
303
|
+
ArrowRight: 1,
|
|
304
|
+
ArrowDown: -1,
|
|
305
|
+
ArrowLeft: -1
|
|
306
|
+
};
|
|
307
|
+
if (arrowKeyToXOffset[key]) {
|
|
308
|
+
event.preventDefault();
|
|
309
|
+
const delta = arrowKeyToXOffset[key] * modifier;
|
|
310
|
+
const hue = this.baseColorFieldColor.hue();
|
|
311
|
+
const color = this.baseColorFieldColor.hue(hue + delta);
|
|
312
|
+
this.internalColorSet(color, false);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
this.handleHexInputChange = (event) => {
|
|
316
|
+
event.stopPropagation();
|
|
317
|
+
const { allowEmpty, color: color$1 } = this;
|
|
318
|
+
const input = event.target;
|
|
319
|
+
const hex = input.value;
|
|
320
|
+
if (allowEmpty && !hex) {
|
|
321
|
+
this.internalColorSet(null);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const normalizedHex = color$1 && normalizeHex(color$1.hex());
|
|
325
|
+
if (hex !== normalizedHex) {
|
|
326
|
+
this.internalColorSet(color(hex));
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
this.handleSavedColorSelect = (event) => {
|
|
330
|
+
const swatch = event.currentTarget;
|
|
331
|
+
this.internalColorSet(color(swatch.color));
|
|
332
|
+
};
|
|
333
|
+
this.handleChannelInput = (event) => {
|
|
334
|
+
const input = event.currentTarget;
|
|
335
|
+
const internalInput = event.detail.nativeEvent.target;
|
|
336
|
+
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
337
|
+
const limit = this.channelMode === "rgb"
|
|
338
|
+
? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
|
|
339
|
+
: HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
|
|
340
|
+
let inputValue;
|
|
341
|
+
if (this.allowEmpty && !input.value) {
|
|
342
|
+
inputValue = "";
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
const value = Number(input.value) + this.shiftKeyChannelAdjustment;
|
|
346
|
+
const clamped = clamp(value, 0, limit);
|
|
347
|
+
inputValue = clamped.toString();
|
|
348
|
+
}
|
|
349
|
+
input.value = inputValue;
|
|
350
|
+
internalInput.value = inputValue;
|
|
351
|
+
};
|
|
352
|
+
this.handleChannelChange = (event) => {
|
|
353
|
+
const input = event.currentTarget;
|
|
354
|
+
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
355
|
+
const channels = [...this.channels];
|
|
356
|
+
const shouldClearChannels = this.allowEmpty && !input.value;
|
|
357
|
+
if (shouldClearChannels) {
|
|
358
|
+
this.channels = [null, null, null];
|
|
359
|
+
this.internalColorSet(null);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
channels[channelIndex] = Number(input.value);
|
|
363
|
+
this.updateColorFromChannels(channels);
|
|
364
|
+
};
|
|
365
|
+
this.handleSavedColorKeyDown = (event) => {
|
|
366
|
+
if (isActivationKey(event.key)) {
|
|
367
|
+
event.preventDefault();
|
|
368
|
+
this.handleSavedColorSelect(event);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
this.handleColorFieldAndSliderPointerLeave = () => {
|
|
372
|
+
this.colorFieldAndSliderInteractive = false;
|
|
373
|
+
this.colorFieldAndSliderHovered = false;
|
|
374
|
+
if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
|
|
375
|
+
this.hueThumbState = "idle";
|
|
376
|
+
this.sliderThumbState = "idle";
|
|
377
|
+
this.drawColorFieldAndSlider();
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
this.handleColorFieldAndSliderPointerDown = (event) => {
|
|
381
|
+
var _a, _b;
|
|
382
|
+
const { offsetX, offsetY } = event;
|
|
383
|
+
const region = this.getCanvasRegion(offsetY);
|
|
384
|
+
if (region === "color-field") {
|
|
385
|
+
this.hueThumbState = "drag";
|
|
386
|
+
this.captureColorFieldColor(offsetX, offsetY);
|
|
387
|
+
(_a = this.colorFieldScopeNode) === null || _a === void 0 ? void 0 : _a.focus();
|
|
388
|
+
}
|
|
389
|
+
else if (region === "slider") {
|
|
390
|
+
this.sliderThumbState = "drag";
|
|
391
|
+
this.captureHueSliderColor(offsetX);
|
|
392
|
+
(_b = this.hueScopeNode) === null || _b === void 0 ? void 0 : _b.focus();
|
|
393
|
+
}
|
|
394
|
+
// prevent text selection outside of color field & slider area
|
|
395
|
+
event.preventDefault();
|
|
396
|
+
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
397
|
+
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
398
|
+
this.activeColorFieldAndSliderRect =
|
|
399
|
+
this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
|
|
400
|
+
};
|
|
401
|
+
this.globalPointerUpHandler = () => {
|
|
402
|
+
const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
403
|
+
this.hueThumbState = "idle";
|
|
404
|
+
this.sliderThumbState = "idle";
|
|
405
|
+
this.activeColorFieldAndSliderRect = null;
|
|
406
|
+
this.drawColorFieldAndSlider();
|
|
407
|
+
if (previouslyDragging) {
|
|
408
|
+
this.calciteColorPickerChange.emit();
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
this.globalPointerMoveHandler = (event) => {
|
|
412
|
+
const { el, dimensions } = this;
|
|
413
|
+
const sliderThumbDragging = this.sliderThumbState === "drag";
|
|
414
|
+
const hueThumbDragging = this.hueThumbState === "drag";
|
|
415
|
+
if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
let samplingX;
|
|
419
|
+
let samplingY;
|
|
420
|
+
const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
|
|
421
|
+
const { clientX, clientY } = event;
|
|
422
|
+
if (this.colorFieldAndSliderHovered) {
|
|
423
|
+
samplingX = clientX - colorFieldAndSliderRect.x;
|
|
424
|
+
samplingY = clientY - colorFieldAndSliderRect.y;
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
const colorFieldWidth = dimensions.colorField.width;
|
|
428
|
+
const colorFieldHeight = dimensions.colorField.height;
|
|
429
|
+
const hueSliderHeight = dimensions.slider.height;
|
|
430
|
+
if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
|
|
431
|
+
clientX > colorFieldAndSliderRect.x) {
|
|
432
|
+
samplingX = clientX - colorFieldAndSliderRect.x;
|
|
433
|
+
}
|
|
434
|
+
else if (clientX < colorFieldAndSliderRect.x) {
|
|
435
|
+
samplingX = 0;
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
samplingX = colorFieldWidth - 1;
|
|
439
|
+
}
|
|
440
|
+
if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
|
|
441
|
+
clientY > colorFieldAndSliderRect.y) {
|
|
442
|
+
samplingY = clientY - colorFieldAndSliderRect.y;
|
|
443
|
+
}
|
|
444
|
+
else if (clientY < colorFieldAndSliderRect.y) {
|
|
445
|
+
samplingY = 0;
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
samplingY = colorFieldHeight + hueSliderHeight;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (hueThumbDragging) {
|
|
452
|
+
this.captureColorFieldColor(samplingX, samplingY, false);
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
this.captureHueSliderColor(samplingX);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
|
|
459
|
+
const { dimensions: { colorField, slider, thumb } } = this;
|
|
460
|
+
this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
|
|
461
|
+
this.colorFieldAndSliderHovered = true;
|
|
462
|
+
const region = this.getCanvasRegion(offsetY);
|
|
463
|
+
if (region === "color-field") {
|
|
464
|
+
const prevHueThumbState = this.hueThumbState;
|
|
465
|
+
const color = this.baseColorFieldColor.hsv();
|
|
466
|
+
const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
|
|
467
|
+
const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
|
|
468
|
+
const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
|
|
469
|
+
let transitionedBetweenHoverAndIdle = false;
|
|
470
|
+
if (prevHueThumbState === "idle" && hoveringThumb) {
|
|
471
|
+
this.hueThumbState = "hover";
|
|
472
|
+
transitionedBetweenHoverAndIdle = true;
|
|
473
|
+
}
|
|
474
|
+
else if (prevHueThumbState === "hover" && !hoveringThumb) {
|
|
475
|
+
this.hueThumbState = "idle";
|
|
476
|
+
transitionedBetweenHoverAndIdle = true;
|
|
477
|
+
}
|
|
478
|
+
if (this.hueThumbState !== "drag") {
|
|
479
|
+
if (transitionedBetweenHoverAndIdle) {
|
|
480
|
+
// refresh since we won't update color and thus no redraw
|
|
481
|
+
this.drawColorFieldAndSlider();
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
else if (region === "slider") {
|
|
486
|
+
const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
|
|
487
|
+
const prevSliderThumbState = this.sliderThumbState;
|
|
488
|
+
const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
|
|
489
|
+
const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
|
|
490
|
+
const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
|
|
491
|
+
let sliderThumbTransitionedBetweenHoverAndIdle = false;
|
|
492
|
+
if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
|
|
493
|
+
this.sliderThumbState = "hover";
|
|
494
|
+
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
495
|
+
}
|
|
496
|
+
else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
|
|
497
|
+
this.sliderThumbState = "idle";
|
|
498
|
+
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
499
|
+
}
|
|
500
|
+
if (this.sliderThumbState !== "drag") {
|
|
501
|
+
if (sliderThumbTransitionedBetweenHoverAndIdle) {
|
|
502
|
+
// refresh since we won't update color and thus no redraw
|
|
503
|
+
this.drawColorFieldAndSlider();
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
this.storeColorFieldScope = (node) => {
|
|
509
|
+
this.colorFieldScopeNode = node;
|
|
510
|
+
};
|
|
511
|
+
this.storeHueScope = (node) => {
|
|
512
|
+
this.hueScopeNode = node;
|
|
513
|
+
};
|
|
514
|
+
this.renderChannelsTabTitle = (channelMode) => {
|
|
515
|
+
const { channelMode: activeChannelMode, intlRgb, intlHsv } = this;
|
|
516
|
+
const active = channelMode === activeChannelMode;
|
|
517
|
+
const label = channelMode === "rgb" ? intlRgb : intlHsv;
|
|
518
|
+
return (h("calcite-tab-title", { active: active, class: CSS.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate }, label));
|
|
519
|
+
};
|
|
520
|
+
this.renderChannelsTab = (channelMode) => {
|
|
521
|
+
const { channelMode: activeChannelMode, channels, intlB, intlBlue, intlG, intlGreen, intlH, intlHue, intlR, intlRed, intlS, intlSaturation, intlV, intlValue } = this;
|
|
522
|
+
const active = channelMode === activeChannelMode;
|
|
523
|
+
const isRgb = channelMode === "rgb";
|
|
524
|
+
const channelLabels = isRgb ? [intlR, intlG, intlB] : [intlH, intlS, intlV];
|
|
525
|
+
const channelAriaLabels = isRgb
|
|
526
|
+
? [intlRed, intlGreen, intlBlue]
|
|
527
|
+
: [intlHue, intlSaturation, intlValue];
|
|
528
|
+
const direction = getElementDir(this.el);
|
|
529
|
+
return (h("calcite-tab", { active: active, class: CSS.control, key: channelMode }, h("div", { class: CSS.channels, dir: "ltr" }, channels.map((channel, index) =>
|
|
530
|
+
/* the channel container is ltr, so we apply the host's direction */
|
|
531
|
+
this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
|
|
532
|
+
};
|
|
533
|
+
this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS.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() }));
|
|
534
|
+
this.deleteColor = () => {
|
|
535
|
+
const colorToDelete = this.color.hex();
|
|
536
|
+
const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
|
|
537
|
+
if (!inStorage) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
const savedColors = this.savedColors.filter((color) => color !== colorToDelete);
|
|
541
|
+
this.savedColors = savedColors;
|
|
542
|
+
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
543
|
+
if (this.storageId) {
|
|
544
|
+
localStorage.setItem(storageKey, JSON.stringify(savedColors));
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
this.saveColor = () => {
|
|
548
|
+
const colorToSave = this.color.hex();
|
|
549
|
+
const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
|
|
550
|
+
if (alreadySaved) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const savedColors = [...this.savedColors, colorToSave];
|
|
554
|
+
this.savedColors = savedColors;
|
|
555
|
+
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
556
|
+
if (this.storageId) {
|
|
557
|
+
localStorage.setItem(storageKey, JSON.stringify(savedColors));
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
this.drawColorFieldAndSlider = throttle(() => {
|
|
561
|
+
if (!this.fieldAndSliderRenderingContext) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
this.drawColorField();
|
|
565
|
+
this.drawHueSlider();
|
|
566
|
+
}, throttleFor60FpsInMs);
|
|
567
|
+
this.captureColorFieldColor = (x, y, skipEqual = true) => {
|
|
568
|
+
const { dimensions: { colorField: { height, width } } } = this;
|
|
569
|
+
const saturation = Math.round((HSV_LIMITS.s / width) * x);
|
|
570
|
+
const value = Math.round((HSV_LIMITS.v / height) * (height - y));
|
|
571
|
+
this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
|
|
572
|
+
};
|
|
573
|
+
this.initColorFieldAndSlider = (canvas) => {
|
|
574
|
+
this.fieldAndSliderRenderingContext = canvas.getContext("2d");
|
|
575
|
+
this.updateCanvasSize(canvas);
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
handleColorChange(color, oldColor) {
|
|
579
|
+
this.drawColorFieldAndSlider();
|
|
580
|
+
this.updateChannelsFromColor(color);
|
|
581
|
+
this.previousColor = oldColor;
|
|
582
|
+
}
|
|
583
|
+
handleFormatChange(format) {
|
|
584
|
+
this.setMode(format);
|
|
585
|
+
this.internalColorSet(this.color, false, "internal");
|
|
586
|
+
}
|
|
587
|
+
handleScaleChange(scale = "m") {
|
|
588
|
+
var _a;
|
|
589
|
+
this.updateDimensions(scale);
|
|
590
|
+
this.updateCanvasSize((_a = this.fieldAndSliderRenderingContext) === null || _a === void 0 ? void 0 : _a.canvas);
|
|
591
|
+
}
|
|
592
|
+
handleValueChange(value, oldValue) {
|
|
593
|
+
const { allowEmpty, format } = this;
|
|
594
|
+
const checkMode = !allowEmpty || value;
|
|
595
|
+
let modeChanged = false;
|
|
596
|
+
if (checkMode) {
|
|
597
|
+
const nextMode = parseMode(value);
|
|
598
|
+
if (!nextMode || (format !== "auto" && nextMode !== format)) {
|
|
599
|
+
this.showIncompatibleColorWarning(value, format);
|
|
600
|
+
this.value = oldValue;
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
modeChanged = this.mode !== nextMode;
|
|
604
|
+
this.setMode(nextMode);
|
|
605
|
+
}
|
|
606
|
+
const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
607
|
+
if (this.internalColorUpdateContext === "initial") {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (this.internalColorUpdateContext === "user-interaction") {
|
|
611
|
+
this.calciteColorPickerInput.emit();
|
|
612
|
+
if (!dragging) {
|
|
613
|
+
this.calciteColorPickerChange.emit();
|
|
614
|
+
}
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
const color$1 = allowEmpty && !value ? null : color(value);
|
|
618
|
+
const colorChanged = !colorEqual(color$1, this.color);
|
|
619
|
+
if (modeChanged || colorChanged) {
|
|
620
|
+
this.internalColorSet(color$1, true, "internal");
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
//--------------------------------------------------------------------------
|
|
624
|
+
//
|
|
625
|
+
// Internal State/Props
|
|
626
|
+
//
|
|
627
|
+
//--------------------------------------------------------------------------
|
|
628
|
+
get baseColorFieldColor() {
|
|
629
|
+
return this.color || this.previousColor || DEFAULT_COLOR;
|
|
630
|
+
}
|
|
631
|
+
// using @Listen as a workaround for VDOM listener not firing
|
|
632
|
+
handleChannelKeyUpOrDown(event) {
|
|
633
|
+
this.shiftKeyChannelAdjustment = 0;
|
|
634
|
+
const { key } = event;
|
|
635
|
+
if ((key !== "ArrowUp" && key !== "ArrowDown") ||
|
|
636
|
+
!event.composedPath().some((node) => { var _a; return (_a = node.classList) === null || _a === void 0 ? void 0 : _a.contains(CSS.channel); })) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const { shiftKey } = event;
|
|
640
|
+
event.preventDefault();
|
|
641
|
+
if (!this.color) {
|
|
642
|
+
this.internalColorSet(this.previousColor);
|
|
643
|
+
event.stopPropagation();
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
// this gets applied to the input's up/down arrow increment/decrement
|
|
647
|
+
const complementaryBump = 9;
|
|
648
|
+
this.shiftKeyChannelAdjustment =
|
|
649
|
+
key === "ArrowUp" && shiftKey
|
|
650
|
+
? complementaryBump
|
|
651
|
+
: key === "ArrowDown" && shiftKey
|
|
652
|
+
? -complementaryBump
|
|
653
|
+
: 0;
|
|
654
|
+
}
|
|
655
|
+
//--------------------------------------------------------------------------
|
|
656
|
+
//
|
|
657
|
+
// Public Methods
|
|
658
|
+
//
|
|
659
|
+
//--------------------------------------------------------------------------
|
|
660
|
+
/** Sets focus on the component. */
|
|
661
|
+
async setFocus() {
|
|
662
|
+
return focusElement(this.colorFieldScopeNode);
|
|
663
|
+
}
|
|
664
|
+
//--------------------------------------------------------------------------
|
|
665
|
+
//
|
|
666
|
+
// Lifecycle
|
|
667
|
+
//
|
|
668
|
+
//--------------------------------------------------------------------------
|
|
669
|
+
componentWillLoad() {
|
|
670
|
+
const { allowEmpty, color: color$1, format, value } = this;
|
|
671
|
+
const willSetNoColor = allowEmpty && !value;
|
|
672
|
+
const parsedMode = parseMode(value);
|
|
673
|
+
const valueIsCompatible = willSetNoColor || (format === "auto" && parsedMode) || format === parsedMode;
|
|
674
|
+
const initialColor = willSetNoColor ? null : valueIsCompatible ? color(value) : color$1;
|
|
675
|
+
if (!valueIsCompatible) {
|
|
676
|
+
this.showIncompatibleColorWarning(value, format);
|
|
677
|
+
}
|
|
678
|
+
this.setMode(format);
|
|
679
|
+
this.internalColorSet(initialColor, false, "initial");
|
|
680
|
+
this.updateDimensions(this.scale);
|
|
681
|
+
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
682
|
+
if (this.storageId && localStorage.getItem(storageKey)) {
|
|
683
|
+
this.savedColors = JSON.parse(localStorage.getItem(storageKey));
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
disconnectedCallback() {
|
|
687
|
+
document.removeEventListener("pointermove", this.globalPointerMoveHandler);
|
|
688
|
+
document.removeEventListener("pointerup", this.globalPointerUpHandler);
|
|
689
|
+
}
|
|
690
|
+
componentDidRender() {
|
|
691
|
+
updateHostInteraction(this);
|
|
692
|
+
}
|
|
693
|
+
//--------------------------------------------------------------------------
|
|
694
|
+
//
|
|
695
|
+
// Render Methods
|
|
696
|
+
//
|
|
697
|
+
//--------------------------------------------------------------------------
|
|
698
|
+
render() {
|
|
699
|
+
const { allowEmpty, color, intlDeleteColor, hideHex, hideChannels, hideSaved, intlHex, intlSaved, intlSaveColor, savedColors, scale } = this;
|
|
700
|
+
const selectedColorInHex = color ? color.hex() : null;
|
|
701
|
+
const hexInputScale = scale === "l" ? "m" : "s";
|
|
702
|
+
const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
|
|
703
|
+
const hueTop = hueScopeTop !== null && hueScopeTop !== void 0 ? hueScopeTop : sliderHeight / 2 + colorFieldHeight;
|
|
704
|
+
const hueLeft = hueScopeLeft !== null && hueScopeLeft !== void 0 ? hueScopeLeft : (colorFieldWidth * DEFAULT_COLOR.hue()) / HSV_LIMITS.h;
|
|
705
|
+
const noColor = color === null;
|
|
706
|
+
const vertical = scopeOrientation === "vertical";
|
|
707
|
+
return (h("div", { class: CSS.container }, h("div", { class: CSS.colorFieldAndSliderWrap }, h("canvas", { class: {
|
|
708
|
+
[CSS.colorFieldAndSlider]: true,
|
|
709
|
+
[CSS.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
|
|
710
|
+
}, 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.scope]: true, [CSS.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.round().hue(), class: { [CSS.scope]: true, [CSS.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: {
|
|
711
|
+
[CSS.controlSection]: true,
|
|
712
|
+
[CSS.section]: true
|
|
713
|
+
} }, hideHex ? null : (h("div", { class: CSS.hexOptions }, h("span", { class: {
|
|
714
|
+
[CSS.header]: true,
|
|
715
|
+
[CSS.headerHex]: true
|
|
716
|
+
} }, intlHex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS.control, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
|
|
717
|
+
[CSS.colorModeContainer]: true,
|
|
718
|
+
[CSS.splitSection]: true
|
|
719
|
+
}, 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.savedColorsSection]: true, [CSS.section]: true } }, h("div", { class: CSS.header }, h("label", null, intlSaved), h("div", { class: CSS.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS.deleteColor, color: "neutral", disabled: noColor, iconStart: "minus", label: intlDeleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS.saveColor, color: "neutral", disabled: noColor, iconStart: "plus", label: intlSaveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS.savedColors }, [
|
|
720
|
+
...savedColors.map((color) => (h("calcite-color-picker-swatch", { active: selectedColorInHex === color, class: CSS.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
|
|
721
|
+
])) : null))));
|
|
722
|
+
}
|
|
723
|
+
// --------------------------------------------------------------------------
|
|
724
|
+
//
|
|
725
|
+
// Private Methods
|
|
726
|
+
//
|
|
727
|
+
//--------------------------------------------------------------------------
|
|
728
|
+
handleKeyDown(event) {
|
|
729
|
+
if (event.key === "Enter") {
|
|
730
|
+
event.preventDefault();
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
showIncompatibleColorWarning(value, format) {
|
|
734
|
+
console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
|
|
735
|
+
}
|
|
736
|
+
setMode(format) {
|
|
737
|
+
this.mode = format === "auto" ? this.mode : format;
|
|
738
|
+
}
|
|
739
|
+
captureHueSliderColor(x) {
|
|
740
|
+
const { dimensions: { slider: { width } } } = this;
|
|
741
|
+
const hue = (360 / width) * x;
|
|
742
|
+
this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
|
|
743
|
+
}
|
|
744
|
+
getCanvasRegion(y) {
|
|
745
|
+
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
|
|
746
|
+
if (y <= colorFieldHeight) {
|
|
747
|
+
return "color-field";
|
|
748
|
+
}
|
|
749
|
+
if (y <= colorFieldHeight + sliderHeight) {
|
|
750
|
+
return "slider";
|
|
751
|
+
}
|
|
752
|
+
return "none";
|
|
753
|
+
}
|
|
754
|
+
internalColorSet(color, skipEqual = true, context = "user-interaction") {
|
|
755
|
+
if (skipEqual && colorEqual(color, this.color)) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
this.internalColorUpdateContext = context;
|
|
759
|
+
this.color = color;
|
|
760
|
+
this.value = this.toValue(color);
|
|
761
|
+
this.internalColorUpdateContext = null;
|
|
762
|
+
}
|
|
763
|
+
toValue(color, format = this.mode) {
|
|
764
|
+
if (!color) {
|
|
765
|
+
return null;
|
|
766
|
+
}
|
|
767
|
+
const hexMode = "hex";
|
|
768
|
+
if (format.includes(hexMode)) {
|
|
769
|
+
return normalizeHex(color.round()[hexMode]());
|
|
770
|
+
}
|
|
771
|
+
if (format.includes("-css")) {
|
|
772
|
+
return color[format.replace("-css", "").replace("a", "")]().round().string();
|
|
773
|
+
}
|
|
774
|
+
const colorObject = color[format]().round().object();
|
|
775
|
+
if (format.endsWith("a")) {
|
|
776
|
+
// normalize alpha prop
|
|
777
|
+
colorObject.a = colorObject.alpha;
|
|
778
|
+
delete colorObject.alpha;
|
|
779
|
+
}
|
|
780
|
+
return colorObject;
|
|
781
|
+
}
|
|
782
|
+
getSliderCapSpacing() {
|
|
783
|
+
const { dimensions: { slider: { height }, thumb: { radius } } } = this;
|
|
784
|
+
return radius * 2 - height;
|
|
785
|
+
}
|
|
786
|
+
updateDimensions(scale = "m") {
|
|
787
|
+
this.dimensions = DIMENSIONS[scale];
|
|
788
|
+
}
|
|
789
|
+
drawColorField() {
|
|
790
|
+
const context = this.fieldAndSliderRenderingContext;
|
|
791
|
+
const { dimensions: { colorField: { height, width } } } = this;
|
|
792
|
+
context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
|
|
793
|
+
context.fillRect(0, 0, width, height);
|
|
794
|
+
const whiteGradient = context.createLinearGradient(0, 0, width, 0);
|
|
795
|
+
whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
|
|
796
|
+
whiteGradient.addColorStop(1, "rgba(255,255,255,0)");
|
|
797
|
+
context.fillStyle = whiteGradient;
|
|
798
|
+
context.fillRect(0, 0, width, height);
|
|
799
|
+
const blackGradient = context.createLinearGradient(0, 0, 0, height);
|
|
800
|
+
blackGradient.addColorStop(0, "rgba(0,0,0,0)");
|
|
801
|
+
blackGradient.addColorStop(1, "rgba(0,0,0,1)");
|
|
802
|
+
context.fillStyle = blackGradient;
|
|
803
|
+
context.fillRect(0, 0, width, height);
|
|
804
|
+
this.drawActiveColorFieldColor();
|
|
805
|
+
}
|
|
806
|
+
setCanvasContextSize(canvas, { height, width }) {
|
|
807
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
808
|
+
canvas.width = width * devicePixelRatio;
|
|
809
|
+
canvas.height = height * devicePixelRatio;
|
|
810
|
+
canvas.style.height = `${height}px`;
|
|
811
|
+
canvas.style.width = `${width}px`;
|
|
812
|
+
const context = canvas.getContext("2d");
|
|
813
|
+
context.scale(devicePixelRatio, devicePixelRatio);
|
|
814
|
+
}
|
|
815
|
+
updateCanvasSize(canvas) {
|
|
816
|
+
if (!canvas) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
this.setCanvasContextSize(canvas, {
|
|
820
|
+
width: this.dimensions.colorField.width,
|
|
821
|
+
height: this.dimensions.colorField.height +
|
|
822
|
+
this.dimensions.slider.height +
|
|
823
|
+
this.getSliderCapSpacing() * 2
|
|
824
|
+
});
|
|
825
|
+
this.drawColorFieldAndSlider();
|
|
826
|
+
}
|
|
827
|
+
containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
|
|
828
|
+
return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
|
|
829
|
+
Math.pow(boundsRadius, 2));
|
|
830
|
+
}
|
|
831
|
+
drawActiveColorFieldColor() {
|
|
832
|
+
const { color } = this;
|
|
833
|
+
if (!color) {
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
const hsvColor = color.hsv();
|
|
837
|
+
const { dimensions: { colorField: { height, width }, thumb: { radius } } } = this;
|
|
838
|
+
const x = hsvColor.saturationv() / (HSV_LIMITS.s / width);
|
|
839
|
+
const y = height - hsvColor.value() / (HSV_LIMITS.v / height);
|
|
840
|
+
requestAnimationFrame(() => {
|
|
841
|
+
this.colorFieldScopeLeft = x;
|
|
842
|
+
this.colorFieldScopeTop = y;
|
|
843
|
+
});
|
|
844
|
+
this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
|
|
845
|
+
}
|
|
846
|
+
drawThumb(context, radius, x, y, color, state) {
|
|
847
|
+
const startAngle = 0;
|
|
848
|
+
const endAngle = 2 * Math.PI;
|
|
849
|
+
context.beginPath();
|
|
850
|
+
context.arc(x, y, radius, startAngle, endAngle);
|
|
851
|
+
context.shadowBlur = state === "hover" ? 32 : 16;
|
|
852
|
+
context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
|
|
853
|
+
context.fillStyle = "#fff";
|
|
854
|
+
context.fill();
|
|
855
|
+
context.beginPath();
|
|
856
|
+
context.arc(x, y, radius - 3, startAngle, endAngle);
|
|
857
|
+
context.shadowBlur = 0;
|
|
858
|
+
context.shadowColor = "transparent";
|
|
859
|
+
context.fillStyle = color.rgb().string();
|
|
860
|
+
context.fill();
|
|
861
|
+
}
|
|
862
|
+
drawActiveHueSliderColor() {
|
|
863
|
+
const { color } = this;
|
|
864
|
+
if (!color) {
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
const hsvColor = color.hsv().saturationv(100).value(100);
|
|
868
|
+
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
|
|
869
|
+
const x = hsvColor.hue() / (360 / width);
|
|
870
|
+
const y = height / 2 + colorFieldHeight;
|
|
871
|
+
requestAnimationFrame(() => {
|
|
872
|
+
this.hueScopeLeft = x;
|
|
873
|
+
this.hueScopeTop = y;
|
|
874
|
+
});
|
|
875
|
+
this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
|
|
876
|
+
}
|
|
877
|
+
drawHueSlider() {
|
|
878
|
+
const context = this.fieldAndSliderRenderingContext;
|
|
879
|
+
const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
|
|
880
|
+
const gradient = context.createLinearGradient(0, 0, width, 0);
|
|
881
|
+
const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
|
|
882
|
+
const offset = 1 / (hueSliderColorStopKeywords.length - 1);
|
|
883
|
+
let currentOffset = 0;
|
|
884
|
+
hueSliderColorStopKeywords.forEach((keyword) => {
|
|
885
|
+
gradient.addColorStop(currentOffset, color(keyword).string());
|
|
886
|
+
currentOffset += offset;
|
|
887
|
+
});
|
|
888
|
+
context.fillStyle = gradient;
|
|
889
|
+
context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
|
|
890
|
+
context.fillRect(0, colorFieldHeight, width, height);
|
|
891
|
+
this.drawActiveHueSliderColor();
|
|
892
|
+
}
|
|
893
|
+
updateColorFromChannels(channels) {
|
|
894
|
+
this.internalColorSet(color(channels, this.channelMode));
|
|
895
|
+
}
|
|
896
|
+
updateChannelsFromColor(color) {
|
|
897
|
+
this.channels = color ? this.toChannels(color) : [null, null, null];
|
|
898
|
+
}
|
|
899
|
+
toChannels(color) {
|
|
900
|
+
const { channelMode } = this;
|
|
901
|
+
return color[channelMode]()
|
|
902
|
+
.array()
|
|
903
|
+
.map((value) => Math.floor(value));
|
|
904
|
+
}
|
|
905
|
+
get el() { return this; }
|
|
906
|
+
static get watchers() { return {
|
|
907
|
+
"color": ["handleColorChange"],
|
|
908
|
+
"format": ["handleFormatChange"],
|
|
909
|
+
"scale": ["handleScaleChange"],
|
|
910
|
+
"value": ["handleValueChange"]
|
|
911
|
+
}; }
|
|
912
|
+
static get style() { return colorPickerCss; }
|
|
913
|
+
}, [1, "calcite-color-picker", {
|
|
914
|
+
"allowEmpty": [4, "allow-empty"],
|
|
915
|
+
"appearance": [513],
|
|
916
|
+
"color": [1040],
|
|
917
|
+
"disabled": [516],
|
|
918
|
+
"format": [1],
|
|
919
|
+
"hideHex": [4, "hide-hex"],
|
|
920
|
+
"hideChannels": [4, "hide-channels"],
|
|
921
|
+
"hideSaved": [4, "hide-saved"],
|
|
922
|
+
"intlB": [1, "intl-b"],
|
|
923
|
+
"intlBlue": [1, "intl-blue"],
|
|
924
|
+
"intlDeleteColor": [1, "intl-delete-color"],
|
|
925
|
+
"intlG": [1, "intl-g"],
|
|
926
|
+
"intlGreen": [1, "intl-green"],
|
|
927
|
+
"intlH": [1, "intl-h"],
|
|
928
|
+
"intlHsv": [1, "intl-hsv"],
|
|
929
|
+
"intlHex": [1, "intl-hex"],
|
|
930
|
+
"intlHue": [1, "intl-hue"],
|
|
931
|
+
"intlNoColor": [1, "intl-no-color"],
|
|
932
|
+
"intlR": [1, "intl-r"],
|
|
933
|
+
"intlRed": [1, "intl-red"],
|
|
934
|
+
"intlRgb": [1, "intl-rgb"],
|
|
935
|
+
"intlS": [1, "intl-s"],
|
|
936
|
+
"intlSaturation": [1, "intl-saturation"],
|
|
937
|
+
"intlSaveColor": [1, "intl-save-color"],
|
|
938
|
+
"intlSaved": [1, "intl-saved"],
|
|
939
|
+
"intlV": [1, "intl-v"],
|
|
940
|
+
"intlValue": [1, "intl-value"],
|
|
941
|
+
"scale": [513],
|
|
942
|
+
"storageId": [1, "storage-id"],
|
|
943
|
+
"numberingSystem": [1, "numbering-system"],
|
|
944
|
+
"value": [1025],
|
|
945
|
+
"colorFieldAndSliderInteractive": [32],
|
|
946
|
+
"channelMode": [32],
|
|
947
|
+
"channels": [32],
|
|
948
|
+
"dimensions": [32],
|
|
949
|
+
"savedColors": [32],
|
|
950
|
+
"colorFieldScopeTop": [32],
|
|
951
|
+
"colorFieldScopeLeft": [32],
|
|
952
|
+
"scopeOrientation": [32],
|
|
953
|
+
"hueScopeLeft": [32],
|
|
954
|
+
"hueScopeTop": [32],
|
|
955
|
+
"setFocus": [64]
|
|
956
|
+
}, [[2, "keydown", "handleChannelKeyUpOrDown"], [2, "keyup", "handleChannelKeyUpOrDown"]]]);
|
|
957
|
+
function defineCustomElement$1() {
|
|
958
|
+
if (typeof customElements === "undefined") {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
const components = ["calcite-color-picker", "calcite-button", "calcite-color-picker-hex-input", "calcite-color-picker-swatch", "calcite-icon", "calcite-input", "calcite-loader", "calcite-progress", "calcite-tab", "calcite-tab-nav", "calcite-tab-title", "calcite-tabs"];
|
|
962
|
+
components.forEach(tagName => { switch (tagName) {
|
|
963
|
+
case "calcite-color-picker":
|
|
964
|
+
if (!customElements.get(tagName)) {
|
|
965
|
+
customElements.define(tagName, ColorPicker);
|
|
966
|
+
}
|
|
967
|
+
break;
|
|
968
|
+
case "calcite-button":
|
|
969
|
+
if (!customElements.get(tagName)) {
|
|
970
|
+
defineCustomElement$c();
|
|
971
|
+
}
|
|
972
|
+
break;
|
|
973
|
+
case "calcite-color-picker-hex-input":
|
|
974
|
+
if (!customElements.get(tagName)) {
|
|
975
|
+
defineCustomElement$b();
|
|
976
|
+
}
|
|
977
|
+
break;
|
|
978
|
+
case "calcite-color-picker-swatch":
|
|
979
|
+
if (!customElements.get(tagName)) {
|
|
980
|
+
defineCustomElement$a();
|
|
981
|
+
}
|
|
982
|
+
break;
|
|
983
|
+
case "calcite-icon":
|
|
984
|
+
if (!customElements.get(tagName)) {
|
|
985
|
+
defineCustomElement$9();
|
|
986
|
+
}
|
|
987
|
+
break;
|
|
988
|
+
case "calcite-input":
|
|
989
|
+
if (!customElements.get(tagName)) {
|
|
990
|
+
defineCustomElement$8();
|
|
991
|
+
}
|
|
992
|
+
break;
|
|
993
|
+
case "calcite-loader":
|
|
994
|
+
if (!customElements.get(tagName)) {
|
|
995
|
+
defineCustomElement$7();
|
|
996
|
+
}
|
|
997
|
+
break;
|
|
998
|
+
case "calcite-progress":
|
|
999
|
+
if (!customElements.get(tagName)) {
|
|
1000
|
+
defineCustomElement$6();
|
|
1001
|
+
}
|
|
1002
|
+
break;
|
|
1003
|
+
case "calcite-tab":
|
|
1004
|
+
if (!customElements.get(tagName)) {
|
|
1005
|
+
defineCustomElement$5();
|
|
1006
|
+
}
|
|
1007
|
+
break;
|
|
1008
|
+
case "calcite-tab-nav":
|
|
1009
|
+
if (!customElements.get(tagName)) {
|
|
1010
|
+
defineCustomElement$4();
|
|
1011
|
+
}
|
|
1012
|
+
break;
|
|
1013
|
+
case "calcite-tab-title":
|
|
1014
|
+
if (!customElements.get(tagName)) {
|
|
1015
|
+
defineCustomElement$3();
|
|
1016
|
+
}
|
|
1017
|
+
break;
|
|
1018
|
+
case "calcite-tabs":
|
|
1019
|
+
if (!customElements.get(tagName)) {
|
|
1020
|
+
defineCustomElement$2();
|
|
1021
|
+
}
|
|
1022
|
+
break;
|
|
1023
|
+
} });
|
|
1024
|
+
}
|
|
1025
1025
|
defineCustomElement$1();
|
|
1026
1026
|
|
|
1027
1027
|
const CalciteColorPicker = ColorPicker;
|