@esri/calcite-components 1.0.0-beta.80 → 1.0.0-beta.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calcite/assets/date-picker/nls/ru.json +4 -4
- package/dist/calcite/assets/icon/compactness16.json +1 -0
- package/dist/calcite/assets/icon/compactness24.json +1 -0
- package/dist/calcite/assets/icon/compactness32.json +1 -0
- package/dist/calcite/assets/icon/configure16.json +1 -0
- package/dist/calcite/assets/icon/configure24.json +1 -0
- package/dist/calcite/assets/icon/configure32.json +1 -0
- package/dist/calcite/assets/icon/debugScript16.json +1 -0
- package/dist/calcite/assets/icon/debugScript24.json +1 -0
- package/dist/calcite/assets/icon/debugScript32.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures16.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures24.json +1 -0
- package/dist/calcite/assets/icon/dissolveFeatures32.json +1 -0
- package/dist/calcite/assets/icon/distanceType16.json +1 -0
- package/dist/calcite/assets/icon/distanceType24.json +1 -0
- package/dist/calcite/assets/icon/distanceType32.json +1 -0
- package/dist/calcite/assets/icon/fileEcd16.json +1 -0
- package/dist/calcite/assets/icon/fileEcd24.json +1 -0
- package/dist/calcite/assets/icon/fileEcd32.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond16.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond24.json +1 -0
- package/dist/calcite/assets/icon/gridDiamond32.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon16.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon24.json +1 -0
- package/dist/calcite/assets/icon/gridHexagon32.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle16.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle24.json +1 -0
- package/dist/calcite/assets/icon/gridTriangle32.json +1 -0
- package/dist/calcite/assets/icon/insets16.json +1 -0
- package/dist/calcite/assets/icon/insets24.json +1 -0
- package/dist/calcite/assets/icon/insets32.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll16.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll24.json +1 -0
- package/dist/calcite/assets/icon/listCheckAll32.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign16.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign24.json +1 -0
- package/dist/calcite/assets/icon/ltrElementsAlign32.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign16.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign24.json +1 -0
- package/dist/calcite/assets/icon/ltrParagraphAlign32.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/dist/calcite/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/dist/calcite/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories16.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories24.json +1 -0
- package/dist/calcite/assets/icon/numberOfTerritories32.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures16.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures24.json +1 -0
- package/dist/calcite/assets/icon/overlapFeatures32.json +1 -0
- package/dist/calcite/assets/icon/profileVariables16.json +1 -0
- package/dist/calcite/assets/icon/profileVariables24.json +1 -0
- package/dist/calcite/assets/icon/profileVariables32.json +1 -0
- package/dist/calcite/assets/icon/rangefinder16.json +1 -0
- package/dist/calcite/assets/icon/rangefinder24.json +1 -0
- package/dist/calcite/assets/icon/rangefinder32.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis16.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis24.json +1 -0
- package/dist/calcite/assets/icon/rasterAnalysis32.json +1 -0
- package/dist/calcite/assets/icon/recurrence16.json +1 -0
- package/dist/calcite/assets/icon/recurrence24.json +1 -0
- package/dist/calcite/assets/icon/recurrence32.json +1 -0
- package/dist/calcite/assets/icon/rfid16.json +1 -0
- package/dist/calcite/assets/icon/rfid24.json +1 -0
- package/dist/calcite/assets/icon/rfid32.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign16.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign24.json +1 -0
- package/dist/calcite/assets/icon/rtlElementsAlign32.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign16.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign24.json +1 -0
- package/dist/calcite/assets/icon/rtlParagraphAlign32.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures16.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures24.json +1 -0
- package/dist/calcite/assets/icon/splitFeatures32.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance16.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance24.json +1 -0
- package/dist/calcite/assets/icon/territoryBufferDistance32.json +1 -0
- package/dist/calcite/assets/icon/testData16.json +1 -0
- package/dist/calcite/assets/icon/testData24.json +1 -0
- package/dist/calcite/assets/icon/testData32.json +1 -0
- package/dist/calcite/calcite.css +1 -1
- package/dist/calcite/calcite.esm.js +2 -1
- package/dist/calcite/calcite.js +1 -1
- package/dist/calcite/index.esm.js +1 -0
- package/dist/calcite/p-004e3dc9.js +6 -0
- package/dist/calcite/p-07587a94.system.entry.js +6 -0
- package/dist/calcite/{p-e66a8ca1.system.entry.js → p-0804ce36.system.entry.js} +3 -2
- package/dist/calcite/{p-9385e4b4.system.js → p-08b6213a.system.js} +2 -1
- package/dist/calcite/{p-9ac86d6a.entry.js → p-0cbdfc7e.entry.js} +2 -1
- package/dist/calcite/p-0d37d621.system.entry.js +6 -0
- package/dist/calcite/p-0e1c259f.system.entry.js +6 -0
- package/dist/calcite/p-0f41fb58.entry.js +6 -0
- package/dist/calcite/p-0fc84480.js +6 -0
- package/dist/calcite/p-132b60fd.system.entry.js +6 -0
- package/dist/calcite/p-1571ede3.system.entry.js +6 -0
- package/dist/calcite/{p-c2adeae4.entry.js → p-1755cd6f.entry.js} +2 -1
- package/dist/calcite/{p-6a541e77.system.js → p-191d0802.system.js} +2 -1
- package/dist/calcite/p-1a07da7e.system.js +6 -0
- package/dist/calcite/{p-b2493735.entry.js → p-1a5fc48b.entry.js} +2 -1
- package/dist/calcite/{p-4de6f4fd.system.js → p-1ba93966.system.js} +1 -0
- package/dist/calcite/{p-5958acc8.system.js → p-1bc2d58d.system.js} +1 -0
- package/dist/calcite/{p-5394666a.entry.js → p-1eb6cfb5.entry.js} +2 -1
- package/dist/calcite/p-1f94715e.entry.js +6 -0
- package/dist/calcite/p-2111668f.system.entry.js +6 -0
- package/dist/calcite/{p-5802a565.entry.js → p-23188966.entry.js} +2 -1
- package/dist/calcite/p-24edad61.entry.js +6 -0
- package/dist/calcite/p-25fd5141.entry.js +6 -0
- package/dist/calcite/p-2609d345.system.entry.js +6 -0
- package/dist/calcite/{p-052ba882.system.entry.js → p-26526a6d.system.entry.js} +2 -1
- package/dist/calcite/{p-8a7596e3.entry.js → p-2778cb53.entry.js} +2 -1
- package/dist/calcite/p-2785ecb9.system.js +6 -0
- package/dist/calcite/{p-6b5776af.js → p-292c567d.js} +1 -0
- package/dist/calcite/{p-7fc69a9d.js → p-2c974b60.js} +1 -0
- package/dist/calcite/{p-03c92ad2.entry.js → p-2e57803f.entry.js} +2 -1
- package/dist/calcite/{p-ac4aec20.system.js → p-2f82a677.system.js} +1 -0
- package/dist/calcite/p-2fcac2cf.system.entry.js +6 -0
- package/dist/calcite/p-2fd30fee.entry.js +6 -0
- package/dist/calcite/{p-1aded388.system.entry.js → p-358cba5a.system.entry.js} +2 -1
- package/dist/calcite/p-37c23e83.system.entry.js +6 -0
- package/dist/calcite/p-3962123d.system.entry.js +6 -0
- package/dist/calcite/{p-079a3322.js → p-3981a495.js} +1 -0
- package/dist/calcite/p-3a256056.entry.js +6 -0
- package/dist/calcite/{p-a11ee541.system.entry.js → p-3b54c4a0.system.entry.js} +2 -1
- package/dist/calcite/p-3d4548a9.js +6 -0
- package/dist/calcite/p-3f00dc7c.entry.js +6 -0
- package/dist/calcite/p-3f80afb9.system.entry.js +6 -0
- package/dist/calcite/p-41b0a2a1.system.js +6 -0
- package/dist/calcite/p-4214c119.system.entry.js +6 -0
- package/dist/calcite/p-45b6d321.entry.js +6 -0
- package/dist/calcite/p-4620ae05.entry.js +6 -0
- package/dist/calcite/p-462cefe9.system.entry.js +6 -0
- package/dist/calcite/{p-e095517f.system.js → p-46d30c39.system.js} +1 -0
- package/dist/calcite/p-476e276f.entry.js +6 -0
- package/dist/calcite/p-47bf0f7d.entry.js +6 -0
- package/dist/calcite/p-47dd3632.entry.js +6 -0
- package/dist/calcite/p-4a88016c.system.entry.js +6 -0
- package/dist/calcite/{p-bd38ff21.js → p-4effc6db.js} +1 -0
- package/dist/calcite/p-4f71c68d.js +6 -0
- package/dist/calcite/p-4f82d10a.system.entry.js +6 -0
- package/dist/calcite/{p-ef17447d.system.entry.js → p-506f5631.system.entry.js} +2 -1
- package/dist/calcite/p-515e5f7e.system.entry.js +6 -0
- package/dist/calcite/p-5207385b.system.entry.js +6 -0
- package/dist/calcite/p-53b147dc.system.entry.js +6 -0
- package/dist/calcite/{p-7ed4c551.system.js → p-57ccba45.system.js} +1 -0
- package/dist/calcite/{p-5bb4d012.entry.js → p-5904a047.entry.js} +2 -1
- package/dist/calcite/{p-97904e9a.entry.js → p-59122590.entry.js} +2 -1
- package/dist/calcite/p-59aae748.entry.js +6 -0
- package/dist/calcite/{p-b9a38a28.system.entry.js → p-5ae3ce21.system.entry.js} +2 -1
- package/dist/calcite/{p-05bf835f.js → p-5afb0fbb.js} +2 -1
- package/dist/calcite/p-5b60d64c.system.entry.js +6 -0
- package/dist/calcite/p-5df0640c.system.entry.js +6 -0
- package/dist/calcite/p-5e07a875.system.entry.js +6 -0
- package/dist/calcite/p-5eb016b6.system.entry.js +6 -0
- package/dist/calcite/p-61483431.system.entry.js +6 -0
- package/dist/calcite/p-623f6224.entry.js +6 -0
- package/dist/calcite/{p-3e9d96c6.system.entry.js → p-636e43ac.system.entry.js} +2 -1
- package/dist/calcite/p-63d2bcec.system.entry.js +6 -0
- package/dist/calcite/p-64384786.entry.js +6 -0
- package/dist/calcite/p-6531fb85.entry.js +6 -0
- package/dist/calcite/p-67af4998.entry.js +6 -0
- package/dist/calcite/p-67ef236d.entry.js +6 -0
- package/dist/calcite/{p-cb57638c.system.js → p-68e3013f.system.js} +2 -1
- package/dist/calcite/p-6a966c2f.entry.js +6 -0
- package/dist/calcite/{p-02d7cf64.system.entry.js → p-6bcb5a71.system.entry.js} +2 -1
- package/dist/calcite/p-6d41e372.system.entry.js +6 -0
- package/dist/calcite/p-717fac51.entry.js +6 -0
- package/dist/calcite/p-773b540e.system.entry.js +6 -0
- package/dist/calcite/{p-e020662f.system.js → p-77762ff3.system.js} +1 -0
- package/dist/calcite/p-78f2801c.entry.js +6 -0
- package/dist/calcite/p-799f79af.entry.js +6 -0
- package/dist/calcite/{p-2d09cc25.js → p-7a8cddad.js} +1 -0
- package/dist/calcite/p-7a95bbeb.entry.js +6 -0
- package/dist/calcite/p-7bbfe1a2.system.entry.js +6 -0
- package/dist/calcite/p-7d8fe7b3.system.entry.js +6 -0
- package/dist/calcite/p-7e576c74.system.entry.js +6 -0
- package/dist/calcite/p-800a9250.entry.js +6 -0
- package/dist/calcite/p-834f407d.system.entry.js +6 -0
- package/dist/calcite/p-85a769d3.system.entry.js +6 -0
- package/dist/calcite/p-878d7c09.system.js +6 -0
- package/dist/calcite/{p-4570cf6c.js → p-8dfe7af3.js} +2 -1
- package/dist/calcite/p-8e2129c6.system.entry.js +6 -0
- package/dist/calcite/p-900fd30e.js +6 -0
- package/dist/calcite/{p-eb3c084f.system.entry.js → p-912c9e61.system.entry.js} +2 -1
- package/dist/calcite/p-940ac25d.system.entry.js +6 -0
- package/dist/calcite/p-9634f60d.entry.js +6 -0
- package/dist/calcite/{p-a7770d75.entry.js → p-98dc9493.entry.js} +2 -1
- package/dist/calcite/{p-65dbbfb5.system.js → p-994d99ff.system.js} +3 -1
- package/dist/calcite/{p-7432e5ef.system.entry.js → p-9ba769e3.system.entry.js} +2 -1
- package/dist/calcite/{p-7bee4942.system.entry.js → p-9c85d763.system.entry.js} +2 -1
- package/dist/calcite/p-9d3f8b0c.system.entry.js +6 -0
- package/dist/calcite/p-9ea395ee.js +6 -0
- package/dist/calcite/p-a1118db1.entry.js +6 -0
- package/dist/calcite/p-a1176eac.system.entry.js +6 -0
- package/dist/calcite/p-a3e19cec.entry.js +6 -0
- package/dist/calcite/{p-8e0dd0af.system.entry.js → p-a5fd7a87.system.entry.js} +2 -1
- package/dist/calcite/p-a73419ab.js +6 -0
- package/dist/calcite/{p-3119ffce.system.js → p-a75ad7cb.system.js} +1 -0
- package/dist/calcite/p-a81ad35a.entry.js +6 -0
- package/dist/calcite/p-a945b681.system.js +6 -0
- package/dist/calcite/{p-7b8707b2.system.js → p-acafe8ca.system.js} +1 -0
- package/dist/calcite/p-adc2b773.entry.js +6 -0
- package/dist/calcite/{p-63624a01.js → p-ae6f5622.js} +1 -0
- package/dist/calcite/{p-1d6404b5.system.js → p-ba349f22.system.js} +1 -0
- package/dist/calcite/p-c1548c19.js +6 -0
- package/dist/calcite/p-c470cecf.entry.js +6 -0
- package/dist/calcite/p-c5eec108.entry.js +6 -0
- package/dist/calcite/{p-f344e163.entry.js → p-c84f0dec.entry.js} +2 -1
- package/dist/calcite/p-c86b91ca.entry.js +6 -0
- package/dist/calcite/{p-3c34f20d.system.js → p-c96917cb.system.js} +2 -1
- package/dist/calcite/p-caea0782.js +7 -0
- package/dist/calcite/p-cbe3c2c0.entry.js +6 -0
- package/dist/calcite/p-ccb27d44.system.entry.js +6 -0
- package/dist/calcite/{p-b06207bb.js → p-ccb5a784.js} +1 -0
- package/dist/calcite/p-d1d05643.entry.js +6 -0
- package/dist/calcite/p-d901c470.system.js +12 -0
- package/dist/calcite/p-db63dc35.system.entry.js +6 -0
- package/dist/calcite/p-dc10e8bb.system.entry.js +6 -0
- package/dist/calcite/p-ddb96773.system.js +6 -0
- package/dist/calcite/{p-cafd98e8.entry.js → p-df419c8b.entry.js} +2 -1
- package/dist/calcite/p-e0ff045a.js +6 -0
- package/dist/calcite/{p-1fc943d5.system.entry.js → p-e117fad1.system.entry.js} +2 -1
- package/dist/calcite/{p-c51699d3.system.js → p-e3076302.system.js} +2 -1
- package/dist/calcite/p-e321018b.js +12 -0
- package/dist/calcite/p-e6ef10e2.js +6 -0
- package/dist/calcite/p-e7336cab.entry.js +6 -0
- package/dist/calcite/{p-482885ae.system.entry.js → p-e9e34c7f.system.entry.js} +2 -1
- package/dist/calcite/p-ed0608ea.system.entry.js +6 -0
- package/dist/calcite/p-eda11878.entry.js +6 -0
- package/dist/calcite/{p-8ab345f2.js → p-edf3436f.js} +2 -1
- package/dist/calcite/p-ee47a382.system.entry.js +6 -0
- package/dist/calcite/p-ee8f8d7e.entry.js +6 -0
- package/dist/calcite/{p-cc6e7726.entry.js → p-ef4ca55d.entry.js} +2 -1
- package/dist/calcite/p-f1935a52.entry.js +6 -0
- package/dist/calcite/p-f313806e.entry.js +6 -0
- package/dist/calcite/p-f39d0565.system.entry.js +6 -0
- package/dist/calcite/{p-0a5d059d.js → p-f46cf640.js} +1 -0
- package/dist/calcite/{p-8a63221d.js → p-f54288ad.js} +1 -0
- package/dist/calcite/{p-a117af56.system.js → p-f7546789.system.js} +1 -0
- package/dist/calcite/p-f828bc9b.entry.js +6 -0
- package/dist/calcite/p-f850e63f.system.js +6 -0
- package/dist/calcite/{p-f68725d7.entry.js → p-f91e835d.entry.js} +2 -1
- package/dist/calcite/{p-f78023f1.system.js → p-f9687b03.system.js} +1 -0
- package/dist/calcite/p-f96d2623.system.entry.js +6 -0
- package/dist/calcite/{p-3b4662a5.entry.js → p-faaa959a.entry.js} +2 -1
- package/dist/calcite/p-fba2fa9f.system.js +6 -0
- package/dist/calcite/{p-78bc502f.entry.js → p-fd5a2277.entry.js} +2 -1
- package/dist/calcite/{p-18be4438.entry.js → p-fd70b6c1.entry.js} +2 -1
- package/dist/calcite/p-feb71776.system.entry.js +6 -0
- package/dist/cjs/{ExpandToggle-f7682a15.js → ExpandToggle-988c63cd.js} +9 -6
- package/dist/cjs/{Heading-ec707493.js → Heading-19d7669b.js} +2 -1
- package/dist/cjs/{array-a5dedf5a.js → array-d5bca414.js} +1 -0
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +24 -17
- package/dist/cjs/calcite-action-bar.cjs.entry.js +17 -11
- package/dist/cjs/calcite-action-group.cjs.entry.js +8 -7
- package/dist/cjs/calcite-action-menu.cjs.entry.js +28 -23
- package/dist/cjs/calcite-action-pad.cjs.entry.js +15 -10
- package/dist/cjs/calcite-action.cjs.entry.js +11 -6
- package/dist/cjs/calcite-alert.cjs.entry.js +18 -14
- package/dist/cjs/calcite-avatar.cjs.entry.js +11 -5
- package/dist/cjs/calcite-block_2.cjs.entry.js +32 -15
- package/dist/cjs/calcite-button.cjs.entry.js +24 -20
- package/dist/cjs/calcite-card.cjs.entry.js +23 -13
- package/dist/cjs/calcite-checkbox.cjs.entry.js +11 -9
- package/dist/cjs/calcite-chip.cjs.entry.js +16 -12
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1417 -1389
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +105 -58
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +117 -44
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +89 -48
- package/dist/cjs/calcite-fab.cjs.entry.js +6 -4
- package/dist/cjs/calcite-filter.cjs.entry.js +28 -21
- package/dist/cjs/calcite-flow.cjs.entry.js +13 -18
- package/dist/cjs/calcite-graph_2.cjs.entry.js +123 -48
- package/dist/cjs/calcite-handle.cjs.entry.js +7 -4
- package/dist/cjs/calcite-icon.cjs.entry.js +10 -5
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +23 -18
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +82 -32
- package/dist/cjs/calcite-input-message.cjs.entry.js +5 -4
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +90 -42
- package/dist/cjs/calcite-input.cjs.entry.js +76 -47
- package/dist/cjs/calcite-label.cjs.entry.js +7 -5
- package/dist/cjs/calcite-link.cjs.entry.js +8 -6
- package/dist/cjs/calcite-list_3.cjs.entry.js +21 -14
- package/dist/cjs/calcite-loader.cjs.entry.js +11 -8
- package/dist/cjs/calcite-modal.cjs.entry.js +31 -21
- package/dist/cjs/calcite-notice.cjs.entry.js +17 -14
- package/dist/cjs/calcite-option_3.cjs.entry.js +14 -13
- package/dist/cjs/calcite-pagination.cjs.entry.js +91 -5
- package/dist/cjs/calcite-panel.cjs.entry.js +44 -13
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +33 -23
- package/dist/cjs/calcite-popover_2.cjs.entry.js +162 -56
- package/dist/cjs/calcite-progress.cjs.entry.js +2 -1
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -2
- package/dist/cjs/calcite-radio-button.cjs.entry.js +13 -9
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +12 -11
- package/dist/cjs/calcite-rating.cjs.entry.js +14 -9
- package/dist/cjs/calcite-scrim.cjs.entry.js +5 -2
- package/dist/cjs/calcite-shell_3.cjs.entry.js +10 -8
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -4
- package/dist/cjs/calcite-split-button.cjs.entry.js +9 -5
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +140 -117
- package/dist/cjs/calcite-switch.cjs.entry.js +13 -9
- package/dist/cjs/calcite-tab_4.cjs.entry.js +122 -81
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +6 -5
- package/dist/cjs/calcite-tile.cjs.entry.js +9 -7
- package/dist/cjs/calcite-tip_3.cjs.entry.js +13 -10
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +188 -144
- package/dist/cjs/calcite-tree_2.cjs.entry.js +33 -21
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +40 -31
- package/dist/cjs/calcite.cjs.js +4 -3
- package/dist/cjs/{conditionalSlot-64f9bfd3.js → conditionalSlot-462ae1f4.js} +7 -2
- package/dist/cjs/{debounce-95979061.js → debounce-5127bc67.js} +1 -0
- package/dist/cjs/{dom-f3df220d.js → dom-b0904219.js} +28 -2
- package/dist/cjs/{forIn-a5d553af.js → forIn-265c8eb3.js} +2 -1
- package/dist/cjs/{form-0ef859c8.js → form-4c32a5c7.js} +36 -2
- package/dist/cjs/{guid-b270f0db.js → guid-8af0f93c.js} +1 -0
- package/dist/cjs/{index-1af0efd3.js → index-82ee13f7.js} +7 -7
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/{interactive-87406231.js → interactive-15f9fd28.js} +7 -3
- package/dist/cjs/{interfaces-7216af30.js → interfaces-86334104.js} +1 -0
- package/dist/cjs/{label-980508de.js → label-131d9cce.js} +26 -18
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{locale-02462821.js → locale-6c28abd8.js} +31 -28
- package/dist/cjs/{math-145c80e2.js → math-2f83830f.js} +1 -0
- package/dist/cjs/{number-e813e801.js → number-6f1151e7.js} +2 -1
- package/dist/cjs/{observers-79bfb8bc.js → observers-f672f664.js} +1 -0
- package/dist/cjs/{popper-64d89ef7.js → popper-5ca144d4.js} +29 -3
- package/dist/cjs/{resources-ac80e82c.js → resources-06f33bd4.js} +1 -0
- package/dist/cjs/{resources-7d5449fb.js → resources-08dc0a5e.js} +1 -0
- package/dist/cjs/{resources-e43fc9f3.js → resources-0de59f13.js} +9 -8
- package/dist/cjs/{resources-7811eb2c.js → resources-24a7ca1a.js} +44 -2
- package/dist/cjs/{sortable.esm-d7a4560b.js → sortable.esm-8e944897.js} +63 -54
- package/dist/cjs/{utils-6579522f.js → utils-f3a37c0a.js} +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/accordion.js +16 -10
- package/dist/collection/components/accordion/interfaces.js +1 -0
- package/dist/collection/components/accordion-item/accordion-item.css +0 -2
- package/dist/collection/components/accordion-item/accordion-item.js +16 -14
- package/dist/collection/components/action/action.css +1 -3
- package/dist/collection/components/action/action.js +6 -2
- package/dist/collection/components/action/resources.js +1 -0
- package/dist/collection/components/action-bar/action-bar.js +16 -4
- package/dist/collection/components/action-bar/resources.js +1 -0
- package/dist/collection/components/action-bar/utils.js +1 -0
- package/dist/collection/components/action-group/action-group.js +1 -0
- package/dist/collection/components/action-group/resources.js +1 -0
- package/dist/collection/components/action-menu/action-menu.css +0 -2
- package/dist/collection/components/action-menu/action-menu.js +21 -16
- package/dist/collection/components/action-menu/resources.js +1 -0
- package/dist/collection/components/action-pad/action-pad.js +15 -4
- package/dist/collection/components/action-pad/resources.js +1 -0
- package/dist/collection/components/alert/alert.css +11 -24
- package/dist/collection/components/alert/alert.js +20 -15
- package/dist/collection/components/alert/interfaces.js +1 -0
- package/dist/collection/components/alert/resources.js +1 -0
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/avatar/avatar.js +1 -0
- package/dist/collection/components/avatar/utils.js +6 -0
- package/dist/collection/components/block/block.css +0 -2
- package/dist/collection/components/block/block.js +37 -12
- package/dist/collection/components/block/resources.js +1 -0
- package/dist/collection/components/block-section/block-section.css +0 -2
- package/dist/collection/components/block-section/block-section.js +3 -2
- package/dist/collection/components/block-section/interfaces.js +1 -0
- package/dist/collection/components/block-section/resources.js +1 -0
- package/dist/collection/components/button/button.css +1 -3
- package/dist/collection/components/button/button.js +20 -15
- package/dist/collection/components/button/interfaces.js +1 -0
- package/dist/collection/components/button/resources.js +1 -0
- package/dist/collection/components/card/card.css +19 -5
- package/dist/collection/components/card/card.js +45 -10
- package/dist/collection/components/card/resources.js +3 -2
- package/dist/collection/components/checkbox/checkbox.css +13 -10
- package/dist/collection/components/checkbox/checkbox.js +5 -2
- package/dist/collection/components/chip/chip.css +23 -25
- package/dist/collection/components/chip/chip.js +7 -4
- package/dist/collection/components/chip/interfaces.js +1 -0
- package/dist/collection/components/chip/resources.js +4 -2
- package/dist/collection/components/color-picker/color-picker.css +2 -12
- package/dist/collection/components/color-picker/color-picker.js +76 -36
- package/dist/collection/components/color-picker/interfaces.js +1 -0
- package/dist/collection/components/color-picker/resources.js +1 -0
- package/dist/collection/components/color-picker/utils.js +1 -0
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +48 -50
- package/dist/collection/components/color-picker-hex-input/resources.js +1 -0
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +1 -0
- package/dist/collection/components/color-picker-swatch/resources.js +1 -0
- package/dist/collection/components/combobox/combobox.css +0 -2
- package/dist/collection/components/combobox/combobox.js +95 -47
- package/dist/collection/components/combobox/interfaces.js +1 -0
- package/dist/collection/components/combobox/resources.js +5 -0
- package/dist/collection/components/combobox/utils.js +1 -0
- package/dist/collection/components/combobox-item/combobox-item.css +1 -3
- package/dist/collection/components/combobox-item/combobox-item.js +11 -2
- package/dist/collection/components/combobox-item/resources.js +1 -0
- package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -0
- package/dist/collection/components/combobox-item-group/resources.js +1 -0
- package/dist/collection/components/date-picker/assets/date-picker/nls/ru.json +4 -4
- package/dist/collection/components/date-picker/date-picker.js +36 -6
- package/dist/collection/components/date-picker/interfaces.js +1 -0
- package/dist/collection/components/date-picker/resources.js +1 -0
- package/dist/collection/components/date-picker/utils.js +7 -0
- package/dist/collection/components/date-picker-day/date-picker-day.css +7 -9
- package/dist/collection/components/date-picker-day/date-picker-day.js +4 -3
- package/dist/collection/components/date-picker-month/date-picker-month.js +38 -9
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +1 -7
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +35 -19
- package/dist/collection/components/dropdown/dropdown.css +0 -1
- package/dist/collection/components/dropdown/dropdown.js +76 -35
- package/dist/collection/components/dropdown/interfaces.js +1 -0
- package/dist/collection/components/dropdown/resources.js +1 -0
- package/dist/collection/components/dropdown-group/dropdown-group.css +4 -0
- package/dist/collection/components/dropdown-group/dropdown-group.js +9 -6
- package/dist/collection/components/dropdown-group/interfaces.js +1 -0
- package/dist/collection/components/dropdown-group/resources.js +1 -0
- package/dist/collection/components/dropdown-item/dropdown-item.css +1 -2
- package/dist/collection/components/dropdown-item/dropdown-item.js +19 -19
- package/dist/collection/components/dropdown-item/resources.js +1 -0
- package/dist/collection/components/fab/fab.js +2 -0
- package/dist/collection/components/fab/resources.js +1 -0
- package/dist/collection/components/filter/filter.css +2 -2
- package/dist/collection/components/filter/filter.js +20 -15
- package/dist/collection/components/filter/resources.js +3 -2
- package/dist/collection/components/flow/flow.css +1 -9
- package/dist/collection/components/flow/flow.js +12 -17
- package/dist/collection/components/flow/interfaces.js +1 -0
- package/dist/collection/components/flow/resources.js +1 -0
- package/dist/collection/components/functional/ExpandToggle.js +5 -2
- package/dist/collection/components/functional/Heading.js +1 -0
- package/dist/collection/components/graph/graph.css +1 -0
- package/dist/collection/components/graph/graph.js +1 -0
- package/dist/collection/components/graph/interfaces.js +1 -0
- package/dist/collection/components/graph/util.js +29 -0
- package/dist/collection/components/handle/handle.css +0 -2
- package/dist/collection/components/handle/handle.js +5 -3
- package/dist/collection/components/handle/resources.js +1 -0
- package/dist/collection/components/icon/assets/icon/compactness16.json +1 -0
- package/dist/collection/components/icon/assets/icon/compactness24.json +1 -0
- package/dist/collection/components/icon/assets/icon/compactness32.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure16.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure24.json +1 -0
- package/dist/collection/components/icon/assets/icon/configure32.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript16.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript24.json +1 -0
- package/dist/collection/components/icon/assets/icon/debugScript32.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/dissolveFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType16.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType24.json +1 -0
- package/dist/collection/components/icon/assets/icon/distanceType32.json +1 -0
- package/dist/collection/components/icon/assets/icon/fileEcd16.json +1 -0
- package/dist/collection/components/icon/assets/icon/fileEcd24.json +1 -0
- package/dist/collection/components/icon/assets/icon/fileEcd32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridDiamond32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridHexagon32.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle16.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle24.json +1 -0
- package/dist/collection/components/icon/assets/icon/gridTriangle32.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets16.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets24.json +1 -0
- package/dist/collection/components/icon/assets/icon/insets32.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll16.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll24.json +1 -0
- package/dist/collection/components/icon/assets/icon/listCheckAll32.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrElementsAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/ltrParagraphAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories16.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories24.json +1 -0
- package/dist/collection/components/icon/assets/icon/numberOfTerritories32.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/overlapFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables16.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables24.json +1 -0
- package/dist/collection/components/icon/assets/icon/profileVariables32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rangefinder32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rasterAnalysis32.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence16.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence24.json +1 -0
- package/dist/collection/components/icon/assets/icon/recurrence32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rfid32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlElementsAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign16.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign24.json +1 -0
- package/dist/collection/components/icon/assets/icon/rtlParagraphAlign32.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures16.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures24.json +1 -0
- package/dist/collection/components/icon/assets/icon/splitFeatures32.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance16.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance24.json +1 -0
- package/dist/collection/components/icon/assets/icon/territoryBufferDistance32.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData16.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData24.json +1 -0
- package/dist/collection/components/icon/assets/icon/testData32.json +1 -0
- package/dist/collection/components/icon/icon.js +3 -2
- package/dist/collection/components/icon/resources.js +1 -0
- package/dist/collection/components/icon/utils.js +5 -0
- package/dist/collection/components/inline-editable/inline-editable.css +1 -4
- package/dist/collection/components/inline-editable/inline-editable.js +18 -13
- package/dist/collection/components/inline-editable/resources.js +1 -0
- package/dist/collection/components/input/input.css +14 -36
- package/dist/collection/components/input/input.js +106 -46
- package/dist/collection/components/input/interfaces.js +1 -0
- package/dist/collection/components/input/resources.js +4 -0
- package/dist/collection/components/input-date-picker/input-date-picker.css +1 -1
- package/dist/collection/components/input-date-picker/input-date-picker.js +107 -28
- package/dist/collection/components/input-message/input-message.css +11 -16
- package/dist/collection/components/input-message/input-message.js +1 -0
- package/dist/collection/components/input-message/interfaces.js +1 -0
- package/dist/collection/components/input-time-picker/input-time-picker.js +83 -14
- package/dist/collection/components/interfaces.js +1 -0
- package/dist/collection/components/label/label.css +2 -2
- package/dist/collection/components/label/label.js +2 -0
- package/dist/collection/components/label/resources.js +1 -0
- package/dist/collection/components/link/link.css +3 -14
- package/dist/collection/components/link/link.js +3 -1
- package/dist/collection/components/list/list.js +4 -3
- package/dist/collection/components/list/resources.js +1 -0
- package/dist/collection/components/list-item/list-item.css +20 -7
- package/dist/collection/components/list-item/list-item.js +12 -6
- package/dist/collection/components/list-item/resources.js +3 -1
- package/dist/collection/components/list-item-group/list-item-group.css +1 -1
- package/dist/collection/components/list-item-group/list-item-group.js +3 -2
- package/dist/collection/components/list-item-group/resources.js +1 -0
- package/dist/collection/components/loader/loader.css +3 -3
- package/dist/collection/components/loader/loader.js +18 -15
- package/dist/collection/components/modal/interfaces.js +1 -0
- package/dist/collection/components/modal/modal.css +7 -48
- package/dist/collection/components/modal/modal.js +79 -64
- package/dist/collection/components/modal/resources.js +1 -0
- package/dist/collection/components/notice/notice.css +5 -16
- package/dist/collection/components/notice/notice.js +27 -23
- package/dist/collection/components/notice/resources.js +1 -0
- package/dist/collection/components/option/option.js +5 -4
- package/dist/collection/components/option-group/option-group.js +4 -3
- package/dist/collection/components/pagination/pagination.css +2 -7
- package/dist/collection/components/pagination/pagination.js +32 -4
- package/dist/collection/components/pagination/resources.js +1 -0
- package/dist/collection/components/panel/panel.css +2 -1
- package/dist/collection/components/panel/panel.js +73 -12
- package/dist/collection/components/panel/resources.js +1 -0
- package/dist/collection/components/pick-list/pick-list.js +23 -11
- package/dist/collection/components/pick-list/resources.js +1 -0
- package/dist/collection/components/pick-list/shared-list-logic.js +3 -2
- package/dist/collection/components/pick-list/shared-list-render.js +3 -1
- package/dist/collection/components/pick-list-group/pick-list-group.js +1 -0
- package/dist/collection/components/pick-list-group/resources.js +1 -0
- package/dist/collection/components/pick-list-item/pick-list-item.css +1 -3
- package/dist/collection/components/pick-list-item/pick-list-item.js +25 -14
- package/dist/collection/components/pick-list-item/resources.js +1 -0
- package/dist/collection/components/popover/PopoverManager.js +75 -0
- package/dist/collection/components/popover/popover.css +5 -0
- package/dist/collection/components/popover/popover.js +121 -27
- package/dist/collection/components/popover/resources.js +1 -1
- package/dist/collection/components/popover-manager/popover-manager.js +33 -44
- package/dist/collection/components/progress/progress.js +1 -0
- package/dist/collection/components/radio-button/radio-button.css +10 -6
- package/dist/collection/components/radio-button/radio-button.js +6 -2
- package/dist/collection/components/radio-button/resources.js +1 -0
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -0
- package/dist/collection/components/radio-group/interfaces.js +1 -0
- package/dist/collection/components/radio-group/radio-group.js +3 -2
- package/dist/collection/components/radio-group-item/radio-group-item.css +0 -2
- package/dist/collection/components/radio-group-item/radio-group-item.js +6 -5
- package/dist/collection/components/radio-group-item/resources.js +1 -0
- package/dist/collection/components/rating/rating.css +2 -12
- package/dist/collection/components/rating/rating.js +7 -2
- package/dist/collection/components/rating/resources.js +1 -0
- package/dist/collection/components/scrim/resources.js +1 -0
- package/dist/collection/components/scrim/scrim.js +4 -1
- package/dist/collection/components/select/resources.js +1 -0
- package/dist/collection/components/select/select.css +0 -2
- package/dist/collection/components/select/select.js +3 -2
- package/dist/collection/components/shell/resources.js +1 -0
- package/dist/collection/components/shell/shell.js +1 -0
- package/dist/collection/components/shell-center-row/resources.js +1 -0
- package/dist/collection/components/shell-center-row/shell-center-row.css +1 -1
- package/dist/collection/components/shell-center-row/shell-center-row.js +1 -0
- package/dist/collection/components/shell-panel/resources.js +1 -0
- package/dist/collection/components/shell-panel/shell-panel.css +3 -6
- package/dist/collection/components/shell-panel/shell-panel.js +6 -1
- package/dist/collection/components/slider/slider.css +29 -2
- package/dist/collection/components/slider/slider.js +94 -41
- package/dist/collection/components/sortable-list/resources.js +1 -0
- package/dist/collection/components/sortable-list/sortable-list.js +1 -0
- package/dist/collection/components/split-button/resources.js +1 -0
- package/dist/collection/components/split-button/split-button.css +1 -4
- package/dist/collection/components/split-button/split-button.js +6 -2
- package/dist/{calcite/p-accdb0ce.js → collection/components/stepper/interfaces.js} +2 -1
- package/dist/collection/components/stepper/stepper.js +107 -67
- package/dist/collection/components/stepper-item/stepper-item.css +27 -2
- package/dist/collection/components/stepper-item/stepper-item.js +83 -82
- package/dist/collection/components/switch/switch.css +0 -2
- package/dist/collection/components/switch/switch.js +8 -4
- package/dist/collection/components/tab/interfaces.js +1 -0
- package/dist/collection/components/tab/tab.js +38 -22
- package/dist/collection/components/tab-nav/tab-nav.css +6 -0
- package/dist/collection/components/tab-nav/tab-nav.js +87 -37
- package/dist/collection/components/tab-title/tab-title.css +30 -15
- package/dist/collection/components/tab-title/tab-title.js +92 -44
- package/dist/collection/components/tabs/interfaces.js +1 -0
- package/dist/collection/components/tabs/resources.js +1 -0
- package/dist/collection/components/tabs/tabs.css +13 -1
- package/dist/collection/components/tabs/tabs.js +11 -9
- package/dist/collection/components/tile/resources.js +1 -0
- package/dist/collection/components/tile/tile.css +3 -4
- package/dist/collection/components/tile/tile.js +2 -0
- package/dist/collection/components/tile-select/interfaces.js +1 -0
- package/dist/collection/components/tile-select/resources.js +1 -0
- package/dist/collection/components/tile-select/tile-select.css +7 -2
- package/dist/collection/components/tile-select/tile-select.js +1 -0
- package/dist/collection/components/tile-select-group/interfaces.js +1 -0
- package/dist/collection/components/tile-select-group/tile-select-group.css +1 -1
- package/dist/collection/components/tile-select-group/tile-select-group.js +1 -0
- package/dist/collection/components/time-picker/resources.js +1 -0
- package/dist/collection/components/time-picker/time-picker.js +61 -33
- package/dist/collection/components/tip/resources.js +1 -0
- package/dist/collection/components/tip/tip.css +0 -2
- package/dist/collection/components/tip/tip.js +1 -0
- package/dist/collection/components/tip-group/tip-group.js +1 -0
- package/dist/collection/components/tip-manager/resources.js +1 -0
- package/dist/collection/components/tip-manager/tip-manager.css +1 -13
- package/dist/collection/components/tip-manager/tip-manager.js +25 -5
- package/dist/collection/components/tooltip/TooltipManager.js +161 -0
- package/dist/collection/components/tooltip/resources.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +7 -4
- package/dist/collection/components/tooltip/tooltip.js +58 -29
- package/dist/collection/components/tooltip-manager/tooltip-manager.js +6 -163
- package/dist/collection/components/tree/interfaces.js +1 -0
- package/dist/collection/components/tree/tree.js +18 -12
- package/dist/collection/components/tree-item/interfaces.js +1 -0
- package/dist/collection/components/tree-item/resources.js +1 -0
- package/dist/collection/components/tree-item/tree-item.css +8 -14
- package/dist/collection/components/tree-item/tree-item.js +31 -24
- package/dist/collection/components/value-list/resources.js +1 -0
- package/dist/collection/components/value-list/value-list.js +41 -29
- package/dist/collection/components/value-list-item/resources.js +1 -0
- package/dist/collection/components/value-list-item/value-list-item.css +0 -2
- package/dist/collection/components/value-list-item/value-list-item.js +33 -23
- package/dist/collection/demos/_assets/demo-spacer.js +17 -0
- package/dist/collection/demos/_assets/demo-template.js +13 -0
- package/dist/collection/demos/_assets/head.js +45 -0
- package/dist/collection/demos/_assets/locales.js +223 -0
- package/dist/collection/utils/array.js +1 -0
- package/dist/collection/utils/conditionalSlot.js +5 -0
- package/dist/collection/utils/date.js +36 -0
- package/dist/collection/utils/dom.js +26 -1
- package/dist/collection/utils/filter.js +2 -1
- package/dist/collection/utils/form.js +32 -0
- package/dist/collection/utils/globalAttributes.js +6 -0
- package/dist/collection/utils/guid.js +1 -0
- package/dist/collection/utils/interactive.js +7 -3
- package/dist/collection/utils/key.js +1 -0
- package/dist/collection/utils/label.js +25 -17
- package/dist/collection/utils/locale.js +31 -27
- package/dist/collection/utils/math.js +1 -0
- package/dist/collection/utils/number.js +2 -1
- package/dist/collection/utils/observers.js +1 -0
- package/dist/collection/utils/popper.js +17 -2
- package/dist/collection/utils/resources.js +1 -0
- package/dist/collection/utils/time.js +1 -0
- package/dist/components/ExpandToggle.js +5 -2
- package/dist/components/Heading.js +1 -0
- package/dist/components/action-group.js +11 -16
- package/dist/components/action-menu.js +30 -31
- package/dist/components/action.js +7 -3
- package/dist/components/array.js +1 -0
- package/dist/components/button.js +19 -15
- package/dist/components/calcite-accordion-item.js +13 -11
- package/dist/components/calcite-accordion.js +12 -6
- package/dist/components/calcite-action-bar.js +20 -20
- package/dist/components/calcite-action-group.js +1 -0
- package/dist/components/calcite-action-menu.js +1 -0
- package/dist/components/calcite-action-pad.js +19 -20
- package/dist/components/calcite-action.js +1 -0
- package/dist/components/calcite-alert.js +16 -12
- package/dist/components/calcite-avatar.js +8 -2
- package/dist/components/calcite-block-section.js +4 -3
- package/dist/components/calcite-block.js +38 -27
- package/dist/components/calcite-button.js +1 -0
- package/dist/components/calcite-card.js +21 -10
- package/dist/components/calcite-checkbox.js +1 -0
- package/dist/components/calcite-chip.js +1 -0
- package/dist/components/calcite-color-picker-hex-input.js +1 -0
- package/dist/components/calcite-color-picker-swatch.js +1 -0
- package/dist/components/calcite-color-picker.js +77 -37
- package/dist/components/calcite-combobox-item-group.js +1 -0
- package/dist/components/calcite-combobox-item.js +4 -1
- package/dist/components/calcite-combobox.js +94 -48
- package/dist/components/calcite-date-picker-day.js +1 -0
- package/dist/components/calcite-date-picker-month-header.js +1 -0
- package/dist/components/calcite-date-picker-month.js +1 -0
- package/dist/components/calcite-date-picker.js +1 -0
- package/dist/components/calcite-dropdown-group.js +9 -6
- package/dist/components/calcite-dropdown-item.js +17 -17
- package/dist/components/calcite-dropdown.js +1 -0
- package/dist/components/calcite-fab.js +2 -0
- package/dist/components/calcite-filter.js +1 -0
- package/dist/components/calcite-flow.js +12 -17
- package/dist/components/calcite-graph.js +1 -0
- package/dist/components/calcite-handle.js +1 -0
- package/dist/components/calcite-icon.js +1 -0
- package/dist/components/calcite-inline-editable.js +18 -13
- package/dist/components/calcite-input-date-picker.js +76 -24
- package/dist/components/calcite-input-message.js +2 -1
- package/dist/components/calcite-input-time-picker.js +38 -11
- package/dist/components/calcite-input.js +1 -0
- package/dist/components/calcite-label.js +1 -0
- package/dist/components/calcite-link.js +1 -0
- package/dist/components/calcite-list-item-group.js +2 -1
- package/dist/components/calcite-list-item.js +12 -5
- package/dist/components/calcite-list.js +2 -1
- package/dist/components/calcite-loader.js +1 -0
- package/dist/components/calcite-modal.js +27 -18
- package/dist/components/calcite-notice.js +11 -8
- package/dist/components/calcite-option-group.js +3 -2
- package/dist/components/calcite-option.js +4 -3
- package/dist/components/calcite-pagination.js +90 -4
- package/dist/components/calcite-panel.js +50 -24
- package/dist/components/calcite-pick-list-group.js +2 -1
- package/dist/components/calcite-pick-list-item.js +1 -0
- package/dist/components/calcite-pick-list.js +13 -7
- package/dist/components/calcite-popover-manager.js +31 -37
- package/dist/components/calcite-popover.js +1 -0
- package/dist/components/calcite-progress.js +1 -0
- package/dist/components/calcite-radio-button-group.js +1 -0
- package/dist/components/calcite-radio-button.js +7 -3
- package/dist/components/calcite-radio-group-item.js +6 -5
- package/dist/components/calcite-radio-group.js +3 -2
- package/dist/components/calcite-rating.js +8 -3
- package/dist/components/calcite-scrim.js +1 -0
- package/dist/components/calcite-select.js +3 -2
- package/dist/components/calcite-shell-center-row.js +2 -1
- package/dist/components/calcite-shell-panel.js +3 -1
- package/dist/components/calcite-shell.js +1 -0
- package/dist/components/calcite-slider.js +86 -39
- package/dist/components/calcite-sortable-list.js +1 -0
- package/dist/components/calcite-split-button.js +7 -3
- package/dist/components/calcite-stepper-item.js +56 -64
- package/dist/components/calcite-stepper.js +83 -51
- package/dist/components/calcite-switch.js +1 -0
- package/dist/components/calcite-tab-nav.js +1 -0
- package/dist/components/calcite-tab-title.js +1 -0
- package/dist/components/calcite-tab.js +1 -0
- package/dist/components/calcite-tabs.js +1 -0
- package/dist/components/calcite-tile-select-group.js +2 -1
- package/dist/components/calcite-tile-select.js +2 -1
- package/dist/components/calcite-tile.js +1 -0
- package/dist/components/calcite-time-picker.js +1 -0
- package/dist/components/calcite-tip-group.js +1 -0
- package/dist/components/calcite-tip-manager.js +8 -5
- package/dist/components/calcite-tip.js +3 -2
- package/dist/components/calcite-tooltip-manager.js +48 -1
- package/dist/components/calcite-tooltip.js +195 -23
- package/dist/components/calcite-tree-item.js +19 -12
- package/dist/components/calcite-tree.js +12 -6
- package/dist/components/calcite-value-list-item.js +15 -11
- package/dist/components/calcite-value-list.js +20 -14
- package/dist/components/checkbox.js +6 -3
- package/dist/components/chip.js +11 -7
- package/dist/components/color-picker-hex-input.js +48 -50
- package/dist/components/color-picker-swatch.js +1337 -1345
- package/dist/components/conditionalSlot.js +5 -0
- package/dist/components/date-picker-day.js +4 -3
- package/dist/components/date-picker-month-header.js +36 -20
- package/dist/components/date-picker-month.js +36 -7
- package/dist/components/date-picker.js +42 -6
- package/dist/components/date.js +36 -0
- package/dist/components/debounce.js +1 -0
- package/dist/components/dom.js +27 -2
- package/dist/components/dropdown.js +65 -25
- package/dist/components/filter.js +22 -15
- package/dist/components/forIn.js +1 -0
- package/dist/components/form.js +34 -2
- package/dist/components/graph.js +30 -1
- package/dist/components/guid.js +1 -0
- package/dist/components/handle.js +5 -3
- package/dist/components/icon.js +7 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/input.js +71 -40
- package/dist/components/interactive.js +7 -3
- package/dist/components/interfaces.js +1 -0
- package/dist/components/interfaces2.js +1 -0
- package/dist/components/label.js +26 -18
- package/dist/components/label2.js +3 -1
- package/dist/components/link.js +4 -2
- package/dist/components/loader.js +9 -6
- package/dist/components/locale.js +31 -28
- package/dist/components/math.js +1 -0
- package/dist/components/number.js +2 -1
- package/dist/components/observers.js +1 -0
- package/dist/components/pick-list-item.js +16 -11
- package/dist/components/popover.js +152 -19
- package/dist/components/popper.js +27 -2
- package/dist/components/progress.js +1 -0
- package/dist/components/resources.js +11 -18
- package/dist/components/resources2.js +8 -5
- package/dist/components/resources3.js +25 -10
- package/dist/components/scrim.js +4 -1
- package/dist/components/shared-list-render.js +8 -7
- package/dist/components/sortable.esm.js +63 -54
- package/dist/components/switch.js +8 -4
- package/dist/components/tab-nav.js +53 -25
- package/dist/components/tab-title.js +45 -34
- package/dist/components/tab.js +21 -17
- package/dist/components/tabs.js +9 -7
- package/dist/components/tile.js +3 -1
- package/dist/components/time-picker.js +51 -27
- package/dist/components/utils.js +1 -0
- package/dist/components/utils2.js +1 -0
- package/dist/custom-elements/index.js +3712 -2723
- package/dist/esm/{ExpandToggle-af224c1e.js → ExpandToggle-ce794961.js} +9 -6
- package/dist/esm/{Heading-d5f1710a.js → Heading-9ccb3452.js} +2 -1
- package/dist/esm/{array-91a648e2.js → array-7a76d321.js} +1 -0
- package/dist/esm/calcite-accordion_2.entry.js +24 -17
- package/dist/esm/calcite-action-bar.entry.js +17 -11
- package/dist/esm/calcite-action-group.entry.js +8 -7
- package/dist/esm/calcite-action-menu.entry.js +28 -23
- package/dist/esm/calcite-action-pad.entry.js +15 -10
- package/dist/esm/calcite-action.entry.js +11 -6
- package/dist/esm/calcite-alert.entry.js +18 -14
- package/dist/esm/calcite-avatar.entry.js +11 -5
- package/dist/esm/calcite-block_2.entry.js +32 -15
- package/dist/esm/calcite-button.entry.js +24 -20
- package/dist/esm/calcite-card.entry.js +23 -13
- package/dist/esm/calcite-checkbox.entry.js +11 -9
- package/dist/esm/calcite-chip.entry.js +16 -12
- package/dist/esm/calcite-color-picker_3.entry.js +1417 -1389
- package/dist/esm/calcite-combobox_3.entry.js +105 -58
- package/dist/esm/calcite-date-picker_4.entry.js +117 -44
- package/dist/esm/calcite-dropdown_3.entry.js +89 -48
- package/dist/esm/calcite-fab.entry.js +6 -4
- package/dist/esm/calcite-filter.entry.js +28 -21
- package/dist/esm/calcite-flow.entry.js +13 -18
- package/dist/esm/calcite-graph_2.entry.js +123 -48
- package/dist/esm/calcite-handle.entry.js +7 -4
- package/dist/esm/calcite-icon.entry.js +10 -5
- package/dist/esm/calcite-inline-editable.entry.js +23 -18
- package/dist/esm/calcite-input-date-picker.entry.js +82 -32
- package/dist/esm/calcite-input-message.entry.js +5 -4
- package/dist/esm/calcite-input-time-picker_2.entry.js +90 -42
- package/dist/esm/calcite-input.entry.js +77 -48
- package/dist/esm/calcite-label.entry.js +7 -5
- package/dist/esm/calcite-link.entry.js +8 -6
- package/dist/esm/calcite-list_3.entry.js +21 -14
- package/dist/esm/calcite-loader.entry.js +11 -8
- package/dist/esm/calcite-modal.entry.js +31 -21
- package/dist/esm/calcite-notice.entry.js +17 -14
- package/dist/esm/calcite-option_3.entry.js +14 -13
- package/dist/esm/calcite-pagination.entry.js +91 -5
- package/dist/esm/calcite-panel.entry.js +44 -13
- package/dist/esm/calcite-pick-list_3.entry.js +33 -23
- package/dist/esm/calcite-popover_2.entry.js +162 -56
- package/dist/esm/calcite-progress.entry.js +2 -1
- package/dist/esm/calcite-radio-button-group.entry.js +3 -2
- package/dist/esm/calcite-radio-button.entry.js +13 -9
- package/dist/esm/calcite-radio-group_2.entry.js +12 -11
- package/dist/esm/calcite-rating.entry.js +14 -9
- package/dist/esm/calcite-scrim.entry.js +5 -2
- package/dist/esm/calcite-shell_3.entry.js +10 -8
- package/dist/esm/calcite-sortable-list.entry.js +5 -4
- package/dist/esm/calcite-split-button.entry.js +9 -5
- package/dist/esm/calcite-stepper_2.entry.js +140 -117
- package/dist/esm/calcite-switch.entry.js +13 -9
- package/dist/esm/calcite-tab_4.entry.js +122 -81
- package/dist/esm/calcite-tile-select_2.entry.js +6 -5
- package/dist/esm/calcite-tile.entry.js +9 -7
- package/dist/esm/calcite-tip_3.entry.js +13 -10
- package/dist/esm/calcite-tooltip_2.entry.js +188 -144
- package/dist/esm/calcite-tree_2.entry.js +33 -21
- package/dist/esm/calcite-value-list_2.entry.js +40 -31
- package/dist/esm/calcite.js +4 -3
- package/dist/esm/{conditionalSlot-67f579ff.js → conditionalSlot-6be8f3bd.js} +7 -2
- package/dist/esm/{debounce-79648d42.js → debounce-9626aac0.js} +1 -0
- package/dist/esm/{dom-e7fa77b9.js → dom-4caa79e4.js} +28 -3
- package/dist/esm/{forIn-48d8fb84.js → forIn-091a9d50.js} +2 -1
- package/dist/esm/{form-5e4609eb.js → form-7c2e444b.js} +35 -3
- package/dist/esm/{guid-196bd5ea.js → guid-27925469.js} +1 -0
- package/dist/esm/{index-bd94948c.js → index-1e02e91b.js} +7 -7
- package/dist/esm/index.js +1 -0
- package/dist/esm/{interactive-48b5cc0f.js → interactive-32803ed8.js} +7 -3
- package/dist/esm/{interfaces-0e5b954c.js → interfaces-64ad1cde.js} +1 -0
- package/dist/esm/{label-68f22660.js → label-ccf07634.js} +26 -18
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{locale-fc850b7c.js → locale-705ed382.js} +31 -28
- package/dist/esm/{math-456207f5.js → math-351ff0de.js} +1 -0
- package/dist/esm/{number-8779395f.js → number-bb265f44.js} +2 -1
- package/dist/esm/{observers-46118290.js → observers-c18e9524.js} +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{popper-da45ec93.js → popper-44b3ba83.js} +28 -3
- package/dist/esm/{resources-73dac782.js → resources-0aacb21d.js} +44 -2
- package/dist/esm/{resources-b5c3d9a7.js → resources-529884cb.js} +9 -8
- package/dist/esm/{resources-027bd8f9.js → resources-a2cad43d.js} +1 -0
- package/dist/esm/{resources-34334875.js → resources-a32d1180.js} +1 -0
- package/dist/esm/{sortable.esm-04824d33.js → sortable.esm-4e7d5c7b.js} +63 -54
- package/dist/esm/{utils-e84055a3.js → utils-2f763d44.js} +1 -0
- package/dist/esm-es5/{ExpandToggle-af224c1e.js → ExpandToggle-ce794961.js} +2 -1
- package/dist/esm-es5/{Heading-d5f1710a.js → Heading-9ccb3452.js} +2 -1
- package/dist/esm-es5/{array-91a648e2.js → array-7a76d321.js} +1 -0
- package/dist/esm-es5/calcite-accordion_2.entry.js +2 -1
- package/dist/esm-es5/calcite-action-bar.entry.js +2 -1
- package/dist/esm-es5/calcite-action-group.entry.js +2 -1
- package/dist/esm-es5/calcite-action-menu.entry.js +3 -2
- package/dist/esm-es5/calcite-action-pad.entry.js +3 -2
- package/dist/esm-es5/calcite-action.entry.js +2 -1
- package/dist/esm-es5/calcite-alert.entry.js +3 -2
- package/dist/esm-es5/calcite-avatar.entry.js +2 -1
- package/dist/esm-es5/calcite-block_2.entry.js +2 -1
- package/dist/esm-es5/calcite-button.entry.js +2 -1
- package/dist/esm-es5/calcite-card.entry.js +2 -1
- package/dist/esm-es5/calcite-checkbox.entry.js +3 -2
- package/dist/esm-es5/calcite-chip.entry.js +3 -2
- package/dist/esm-es5/calcite-color-picker_3.entry.js +3 -2
- package/dist/esm-es5/calcite-combobox_3.entry.js +3 -2
- package/dist/esm-es5/calcite-date-picker_4.entry.js +3 -2
- package/dist/esm-es5/calcite-dropdown_3.entry.js +3 -2
- package/dist/esm-es5/calcite-fab.entry.js +2 -1
- package/dist/esm-es5/calcite-filter.entry.js +2 -1
- package/dist/esm-es5/calcite-flow.entry.js +2 -1
- package/dist/esm-es5/calcite-graph_2.entry.js +2 -1
- package/dist/esm-es5/calcite-handle.entry.js +2 -1
- package/dist/esm-es5/calcite-icon.entry.js +2 -1
- package/dist/esm-es5/calcite-inline-editable.entry.js +3 -2
- package/dist/esm-es5/calcite-input-date-picker.entry.js +2 -1
- package/dist/esm-es5/calcite-input-message.entry.js +2 -1
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +3 -2
- package/dist/esm-es5/calcite-input.entry.js +3 -2
- package/dist/esm-es5/calcite-label.entry.js +2 -1
- package/dist/esm-es5/calcite-link.entry.js +3 -2
- package/dist/esm-es5/calcite-list_3.entry.js +3 -2
- package/dist/esm-es5/calcite-loader.entry.js +2 -1
- package/dist/esm-es5/calcite-modal.entry.js +3 -2
- package/dist/esm-es5/calcite-notice.entry.js +3 -2
- package/dist/esm-es5/calcite-option_3.entry.js +2 -1
- package/dist/esm-es5/calcite-pagination.entry.js +2 -1
- package/dist/esm-es5/calcite-panel.entry.js +3 -2
- package/dist/esm-es5/calcite-pick-list_3.entry.js +3 -2
- package/dist/esm-es5/calcite-popover_2.entry.js +2 -1
- package/dist/esm-es5/calcite-progress.entry.js +2 -1
- package/dist/esm-es5/calcite-radio-button-group.entry.js +2 -1
- package/dist/esm-es5/calcite-radio-button.entry.js +2 -1
- package/dist/esm-es5/calcite-radio-group_2.entry.js +2 -1
- package/dist/esm-es5/calcite-rating.entry.js +2 -1
- package/dist/esm-es5/calcite-scrim.entry.js +2 -1
- package/dist/esm-es5/calcite-shell_3.entry.js +2 -1
- package/dist/esm-es5/calcite-sortable-list.entry.js +2 -1
- package/dist/esm-es5/calcite-split-button.entry.js +2 -1
- package/dist/esm-es5/calcite-stepper_2.entry.js +3 -2
- package/dist/esm-es5/calcite-switch.entry.js +3 -2
- package/dist/esm-es5/calcite-tab_4.entry.js +3 -2
- package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -1
- package/dist/esm-es5/calcite-tile.entry.js +2 -1
- package/dist/esm-es5/calcite-tip_3.entry.js +3 -2
- package/dist/esm-es5/calcite-tooltip_2.entry.js +3 -2
- package/dist/esm-es5/calcite-tree_2.entry.js +2 -1
- package/dist/esm-es5/calcite-value-list_2.entry.js +2 -1
- package/dist/esm-es5/calcite.js +2 -1
- package/dist/esm-es5/{conditionalSlot-67f579ff.js → conditionalSlot-6be8f3bd.js} +2 -1
- package/dist/esm-es5/{debounce-79648d42.js → debounce-9626aac0.js} +1 -0
- package/dist/esm-es5/dom-4caa79e4.js +6 -0
- package/dist/esm-es5/{forIn-48d8fb84.js → forIn-091a9d50.js} +2 -1
- package/dist/esm-es5/form-7c2e444b.js +6 -0
- package/dist/esm-es5/{guid-196bd5ea.js → guid-27925469.js} +1 -0
- package/dist/esm-es5/{index-bd94948c.js → index-1e02e91b.js} +4 -2
- package/dist/esm-es5/index.js +1 -0
- package/dist/esm-es5/{interactive-48b5cc0f.js → interactive-32803ed8.js} +1 -0
- package/dist/esm-es5/{interfaces-0e5b954c.js → interfaces-64ad1cde.js} +1 -0
- package/dist/esm-es5/label-ccf07634.js +6 -0
- package/dist/esm-es5/loader.js +2 -1
- package/dist/esm-es5/locale-705ed382.js +6 -0
- package/dist/esm-es5/{math-456207f5.js → math-351ff0de.js} +1 -0
- package/dist/esm-es5/number-bb265f44.js +6 -0
- package/dist/esm-es5/{observers-46118290.js → observers-c18e9524.js} +1 -0
- package/dist/esm-es5/{popper-da45ec93.js → popper-44b3ba83.js} +2 -1
- package/dist/esm-es5/{resources-73dac782.js → resources-0aacb21d.js} +3 -2
- package/dist/esm-es5/resources-529884cb.js +6 -0
- package/dist/esm-es5/{resources-027bd8f9.js → resources-a2cad43d.js} +1 -0
- package/dist/esm-es5/{resources-34334875.js → resources-a32d1180.js} +1 -0
- package/dist/esm-es5/sortable.esm-4e7d5c7b.js +12 -0
- package/dist/esm-es5/{utils-e84055a3.js → utils-2f763d44.js} +1 -0
- package/dist/extras/docs-json.d.ts +3 -0
- package/dist/extras/docs-json.json +577 -301
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/types/components/accordion/accordion.d.ts +6 -4
- package/dist/types/components/accordion-item/accordion-item.d.ts +4 -4
- package/dist/types/components/action/action.d.ts +4 -1
- package/dist/types/components/action-bar/action-bar.d.ts +6 -1
- package/dist/types/components/action-menu/action-menu.d.ts +4 -2
- package/dist/types/components/action-pad/action-pad.d.ts +5 -1
- package/dist/types/components/alert/alert.d.ts +11 -6
- package/dist/types/components/avatar/utils.d.ts +5 -0
- package/dist/types/components/block/block.d.ts +12 -4
- package/dist/types/components/button/button.d.ts +7 -4
- package/dist/types/components/card/card.d.ts +13 -4
- package/dist/types/components/card/resources.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +3 -1
- package/dist/types/components/chip/chip.d.ts +3 -1
- package/dist/types/components/chip/resources.d.ts +3 -2
- package/dist/types/components/color-picker/color-picker.d.ts +58 -18
- package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +5 -1
- package/dist/types/components/combobox/combobox.d.ts +15 -4
- package/dist/types/components/combobox/resources.d.ts +4 -0
- package/dist/types/components/combobox-item/combobox-item.d.ts +2 -0
- package/dist/types/components/date-picker/date-picker.d.ts +32 -3
- package/dist/types/components/date-picker/utils.d.ts +5 -0
- package/dist/types/components/date-picker-day/date-picker-day.d.ts +2 -1
- package/dist/types/components/date-picker-month/date-picker-month.d.ts +30 -2
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +10 -1
- package/dist/types/components/dropdown/dropdown.d.ts +18 -9
- package/dist/types/components/dropdown-group/dropdown-group.d.ts +5 -3
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +3 -3
- package/dist/types/components/fab/fab.d.ts +1 -0
- package/dist/types/components/filter/filter.d.ts +3 -3
- package/dist/types/components/filter/resources.d.ts +1 -1
- package/dist/types/components/flow/flow.d.ts +1 -4
- package/dist/types/components/graph/util.d.ts +14 -0
- package/dist/types/components/handle/handle.d.ts +1 -1
- package/dist/types/components/icon/utils.d.ts +4 -0
- package/dist/types/components/inline-editable/inline-editable.d.ts +10 -5
- package/dist/types/components/input/input.d.ts +32 -13
- package/dist/types/components/input/resources.d.ts +3 -0
- package/dist/types/components/input-date-picker/input-date-picker.d.ts +35 -7
- package/dist/types/components/input-message/input-message.d.ts +7 -3
- package/dist/types/components/input-time-picker/input-time-picker.d.ts +15 -2
- package/dist/types/components/interfaces.d.ts +1 -0
- package/dist/types/components/label/label.d.ts +1 -0
- package/dist/types/components/link/link.d.ts +2 -1
- package/dist/types/components/list/list.d.ts +2 -2
- package/dist/types/components/list-item/list-item.d.ts +3 -3
- package/dist/types/components/list-item/resources.d.ts +1 -0
- package/dist/types/components/list-item-group/list-item-group.d.ts +2 -2
- package/dist/types/components/loader/loader.d.ts +11 -9
- package/dist/types/components/modal/modal.d.ts +37 -28
- package/dist/types/components/notice/notice.d.ts +24 -19
- package/dist/types/components/option/option.d.ts +1 -1
- package/dist/types/components/option-group/option-group.d.ts +1 -1
- package/dist/types/components/pagination/pagination.d.ts +13 -3
- package/dist/types/components/panel/panel.d.ts +18 -2
- package/dist/types/components/pick-list/pick-list.d.ts +7 -3
- package/dist/types/components/pick-list/shared-list-logic.d.ts +1 -1
- package/dist/types/components/pick-list-item/pick-list-item.d.ts +9 -3
- package/dist/types/components/popover/PopoverManager.d.ts +13 -0
- package/dist/types/components/popover/popover.d.ts +32 -7
- package/dist/types/components/popover/resources.d.ts +0 -1
- package/dist/types/components/popover-manager/popover-manager.d.ts +7 -2
- package/dist/types/components/radio-button/radio-button.d.ts +6 -0
- package/dist/types/components/radio-group-item/radio-group-item.d.ts +2 -1
- package/dist/types/components/rating/rating.d.ts +6 -2
- package/dist/types/components/scrim/scrim.d.ts +3 -1
- package/dist/types/components/shell-panel/shell-panel.d.ts +3 -0
- package/dist/types/components/slider/slider.d.ts +24 -2
- package/dist/types/components/split-button/split-button.d.ts +5 -2
- package/dist/types/components/stepper/interfaces.d.ts +10 -0
- package/dist/types/components/stepper/stepper.d.ts +20 -11
- package/dist/types/components/stepper-item/stepper-item.d.ts +7 -8
- package/dist/types/components/switch/switch.d.ts +3 -1
- package/dist/types/components/tab/tab.d.ts +11 -8
- package/dist/types/components/tab-nav/tab-nav.d.ts +34 -21
- package/dist/types/components/tab-title/tab-title.d.ts +37 -28
- package/dist/types/components/tabs/tabs.d.ts +7 -6
- package/dist/types/components/tile/tile.d.ts +1 -0
- package/dist/types/components/time-picker/time-picker.d.ts +45 -17
- package/dist/types/components/tip-manager/tip-manager.d.ts +7 -1
- package/dist/types/components/tooltip/TooltipManager.d.ts +28 -0
- package/dist/types/components/tooltip/resources.d.ts +0 -1
- package/dist/types/components/tooltip/tooltip.d.ts +15 -13
- package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +2 -29
- package/dist/types/components/tree/tree.d.ts +14 -7
- package/dist/types/components/tree-item/tree-item.d.ts +28 -14
- package/dist/types/components/value-list/value-list.d.ts +20 -16
- package/dist/types/components/value-list-item/value-list-item.d.ts +15 -12
- package/dist/types/components.d.ts +606 -252
- package/dist/types/preact.d.ts +63 -59
- package/dist/types/utils/conditionalSlot.d.ts +4 -0
- package/dist/types/utils/date.d.ts +35 -0
- package/dist/types/utils/dom.d.ts +18 -2
- package/dist/types/utils/form.d.ts +34 -5
- package/dist/types/utils/globalAttributes.d.ts +5 -0
- package/dist/types/utils/interactive.d.ts +7 -4
- package/dist/types/utils/label.d.ts +7 -0
- package/dist/types/utils/locale.d.ts +2 -1
- package/dist/types/utils/popper.d.ts +6 -4
- package/hydrate/index.d.ts +1 -1
- package/hydrate/index.js +3805 -2797
- package/package.json +49 -48
- package/readme.md +4 -5
- package/dist/calcite/p-07f1f162.system.entry.js +0 -5
- package/dist/calcite/p-1263bcc0.entry.js +0 -5
- package/dist/calcite/p-162604a0.entry.js +0 -5
- package/dist/calcite/p-193749c1.entry.js +0 -5
- package/dist/calcite/p-1aeca42a.system.entry.js +0 -5
- package/dist/calcite/p-23145377.entry.js +0 -5
- package/dist/calcite/p-28c333d0.entry.js +0 -5
- package/dist/calcite/p-2bcaed33.entry.js +0 -5
- package/dist/calcite/p-2dd22e8c.system.entry.js +0 -5
- package/dist/calcite/p-2fae8516.system.entry.js +0 -5
- package/dist/calcite/p-31c58f25.entry.js +0 -5
- package/dist/calcite/p-32d6b962.entry.js +0 -5
- package/dist/calcite/p-32efc4cd.system.entry.js +0 -5
- package/dist/calcite/p-34730e94.entry.js +0 -5
- package/dist/calcite/p-364db271.entry.js +0 -5
- package/dist/calcite/p-364f0abe.system.entry.js +0 -5
- package/dist/calcite/p-3915705c.entry.js +0 -5
- package/dist/calcite/p-3e149640.system.entry.js +0 -5
- package/dist/calcite/p-42227a04.entry.js +0 -5
- package/dist/calcite/p-426f011a.entry.js +0 -5
- package/dist/calcite/p-46071f17.entry.js +0 -5
- package/dist/calcite/p-47d38839.entry.js +0 -5
- package/dist/calcite/p-48637359.system.entry.js +0 -5
- package/dist/calcite/p-4905189e.system.entry.js +0 -5
- package/dist/calcite/p-496e907a.system.entry.js +0 -5
- package/dist/calcite/p-4aecbaef.entry.js +0 -5
- package/dist/calcite/p-4afb5a1b.system.entry.js +0 -5
- package/dist/calcite/p-4eae61c5.entry.js +0 -5
- package/dist/calcite/p-54c49493.entry.js +0 -5
- package/dist/calcite/p-55e1a3a0.system.entry.js +0 -5
- package/dist/calcite/p-569150ab.system.entry.js +0 -5
- package/dist/calcite/p-588bfa74.system.js +0 -5
- package/dist/calcite/p-5a8829cd.entry.js +0 -5
- package/dist/calcite/p-5c637131.entry.js +0 -5
- package/dist/calcite/p-5f6e35f3.entry.js +0 -5
- package/dist/calcite/p-614d8925.js +0 -5
- package/dist/calcite/p-6261469d.entry.js +0 -5
- package/dist/calcite/p-653bd7bf.entry.js +0 -5
- package/dist/calcite/p-69d2d9cf.system.entry.js +0 -5
- package/dist/calcite/p-6ab3e489.entry.js +0 -5
- package/dist/calcite/p-6b7b23d0.js +0 -5
- package/dist/calcite/p-6c4a7041.system.entry.js +0 -5
- package/dist/calcite/p-6e0103f5.system.entry.js +0 -5
- package/dist/calcite/p-6ed27595.system.entry.js +0 -5
- package/dist/calcite/p-6fba3e1b.system.entry.js +0 -5
- package/dist/calcite/p-7247b667.system.entry.js +0 -5
- package/dist/calcite/p-7260c869.system.entry.js +0 -5
- package/dist/calcite/p-765c9bef.entry.js +0 -5
- package/dist/calcite/p-7c88d545.js +0 -5
- package/dist/calcite/p-824da4be.entry.js +0 -5
- package/dist/calcite/p-867f7b7a.system.entry.js +0 -5
- package/dist/calcite/p-872e82a6.system.entry.js +0 -5
- package/dist/calcite/p-87888359.entry.js +0 -5
- package/dist/calcite/p-895d22f3.entry.js +0 -5
- package/dist/calcite/p-8b982f91.entry.js +0 -5
- package/dist/calcite/p-8f3a3e4e.js +0 -5
- package/dist/calcite/p-963e9aec.system.entry.js +0 -5
- package/dist/calcite/p-9940b82a.system.entry.js +0 -5
- package/dist/calcite/p-9ad8c7c5.system.entry.js +0 -5
- package/dist/calcite/p-9c913e3a.entry.js +0 -5
- package/dist/calcite/p-9e61d89d.entry.js +0 -5
- package/dist/calcite/p-a9b3ef39.js +0 -5
- package/dist/calcite/p-a9ea7f4f.entry.js +0 -5
- package/dist/calcite/p-aaa21a84.system.entry.js +0 -5
- package/dist/calcite/p-aad14a5d.system.entry.js +0 -5
- package/dist/calcite/p-ac9607f2.system.js +0 -11
- package/dist/calcite/p-afe59546.entry.js +0 -5
- package/dist/calcite/p-b0827b8c.system.entry.js +0 -5
- package/dist/calcite/p-b10af2b4.entry.js +0 -5
- package/dist/calcite/p-b2b6f712.js +0 -5
- package/dist/calcite/p-b3c5247b.system.entry.js +0 -5
- package/dist/calcite/p-b47dc903.system.entry.js +0 -5
- package/dist/calcite/p-b765d197.system.js +0 -5
- package/dist/calcite/p-bb401f25.system.js +0 -5
- package/dist/calcite/p-bccbf58a.entry.js +0 -5
- package/dist/calcite/p-bdcb43b1.system.entry.js +0 -5
- package/dist/calcite/p-bffb4da3.system.entry.js +0 -5
- package/dist/calcite/p-c228a1da.system.entry.js +0 -5
- package/dist/calcite/p-c2caeb2a.system.entry.js +0 -5
- package/dist/calcite/p-c4cb35ba.system.entry.js +0 -5
- package/dist/calcite/p-c5ec8d74.js +0 -11
- package/dist/calcite/p-c9fc13b9.system.entry.js +0 -5
- package/dist/calcite/p-cb847074.entry.js +0 -5
- package/dist/calcite/p-cbc6fee6.entry.js +0 -5
- package/dist/calcite/p-cd5f5c8f.js +0 -5
- package/dist/calcite/p-cd9226a1.system.entry.js +0 -5
- package/dist/calcite/p-daf5f04c.system.js +0 -5
- package/dist/calcite/p-dcf33bb2.js +0 -5
- package/dist/calcite/p-dd9f2e61.js +0 -5
- package/dist/calcite/p-e22ab8fa.entry.js +0 -5
- package/dist/calcite/p-e3280a36.system.entry.js +0 -5
- package/dist/calcite/p-e43605c5.entry.js +0 -5
- package/dist/calcite/p-e4d1651b.system.entry.js +0 -5
- package/dist/calcite/p-e55c5bb4.entry.js +0 -5
- package/dist/calcite/p-ea4119b1.system.entry.js +0 -5
- package/dist/calcite/p-ec9bab33.system.js +0 -5
- package/dist/calcite/p-ecc31b40.system.entry.js +0 -5
- package/dist/calcite/p-edf1e815.system.entry.js +0 -5
- package/dist/calcite/p-ee522afa.system.entry.js +0 -5
- package/dist/calcite/p-ef6b4184.js +0 -5
- package/dist/calcite/p-f09e27b0.system.js +0 -5
- package/dist/calcite/p-fa922721.system.js +0 -5
- package/dist/calcite/p-fe9380a0.system.js +0 -5
- package/dist/components/resources4.js +0 -15
- package/dist/components/resources5.js +0 -32
- package/dist/components/tooltip-manager.js +0 -175
- package/dist/esm-es5/dom-e7fa77b9.js +0 -5
- package/dist/esm-es5/form-5e4609eb.js +0 -5
- package/dist/esm-es5/label-68f22660.js +0 -5
- package/dist/esm-es5/locale-fc850b7c.js +0 -5
- package/dist/esm-es5/number-8779395f.js +0 -5
- package/dist/esm-es5/resources-b5c3d9a7.js +0 -5
- package/dist/esm-es5/sortable.esm-04824d33.js +0 -11
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
+
* v1.0.0-beta.83
|
|
4
5
|
*/
|
|
5
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
6
|
-
import { f as focusElement, b as getThemeName } from './dom-
|
|
7
|
-
import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex,
|
|
8
|
-
import { c as clamp } from './math-
|
|
9
|
-
import { u as updateHostInteraction } from './interactive-
|
|
10
|
-
import { d as debounce, i as isObject } from './debounce-
|
|
11
|
-
import './guid-
|
|
6
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-1e02e91b.js';
|
|
7
|
+
import { a as getElementDir, f as focusElement, b as getThemeName } from './dom-4caa79e4.js';
|
|
8
|
+
import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './utils-2f763d44.js';
|
|
9
|
+
import { c as clamp } from './math-351ff0de.js';
|
|
10
|
+
import { u as updateHostInteraction } from './interactive-32803ed8.js';
|
|
11
|
+
import { d as debounce, i as isObject } from './debounce-9626aac0.js';
|
|
12
|
+
import './guid-27925469.js';
|
|
12
13
|
|
|
13
14
|
/** Error message constants. */
|
|
14
15
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -526,1023 +527,995 @@ function hexDouble(num) {
|
|
|
526
527
|
}
|
|
527
528
|
});
|
|
528
529
|
|
|
529
|
-
var colorName = {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
530
|
+
var colorName = {
|
|
531
|
+
"aliceblue": [240, 248, 255],
|
|
532
|
+
"antiquewhite": [250, 235, 215],
|
|
533
|
+
"aqua": [0, 255, 255],
|
|
534
|
+
"aquamarine": [127, 255, 212],
|
|
535
|
+
"azure": [240, 255, 255],
|
|
536
|
+
"beige": [245, 245, 220],
|
|
537
|
+
"bisque": [255, 228, 196],
|
|
538
|
+
"black": [0, 0, 0],
|
|
539
|
+
"blanchedalmond": [255, 235, 205],
|
|
540
|
+
"blue": [0, 0, 255],
|
|
541
|
+
"blueviolet": [138, 43, 226],
|
|
542
|
+
"brown": [165, 42, 42],
|
|
543
|
+
"burlywood": [222, 184, 135],
|
|
544
|
+
"cadetblue": [95, 158, 160],
|
|
545
|
+
"chartreuse": [127, 255, 0],
|
|
546
|
+
"chocolate": [210, 105, 30],
|
|
547
|
+
"coral": [255, 127, 80],
|
|
548
|
+
"cornflowerblue": [100, 149, 237],
|
|
549
|
+
"cornsilk": [255, 248, 220],
|
|
550
|
+
"crimson": [220, 20, 60],
|
|
551
|
+
"cyan": [0, 255, 255],
|
|
552
|
+
"darkblue": [0, 0, 139],
|
|
553
|
+
"darkcyan": [0, 139, 139],
|
|
554
|
+
"darkgoldenrod": [184, 134, 11],
|
|
555
|
+
"darkgray": [169, 169, 169],
|
|
556
|
+
"darkgreen": [0, 100, 0],
|
|
557
|
+
"darkgrey": [169, 169, 169],
|
|
558
|
+
"darkkhaki": [189, 183, 107],
|
|
559
|
+
"darkmagenta": [139, 0, 139],
|
|
560
|
+
"darkolivegreen": [85, 107, 47],
|
|
561
|
+
"darkorange": [255, 140, 0],
|
|
562
|
+
"darkorchid": [153, 50, 204],
|
|
563
|
+
"darkred": [139, 0, 0],
|
|
564
|
+
"darksalmon": [233, 150, 122],
|
|
565
|
+
"darkseagreen": [143, 188, 143],
|
|
566
|
+
"darkslateblue": [72, 61, 139],
|
|
567
|
+
"darkslategray": [47, 79, 79],
|
|
568
|
+
"darkslategrey": [47, 79, 79],
|
|
569
|
+
"darkturquoise": [0, 206, 209],
|
|
570
|
+
"darkviolet": [148, 0, 211],
|
|
571
|
+
"deeppink": [255, 20, 147],
|
|
572
|
+
"deepskyblue": [0, 191, 255],
|
|
573
|
+
"dimgray": [105, 105, 105],
|
|
574
|
+
"dimgrey": [105, 105, 105],
|
|
575
|
+
"dodgerblue": [30, 144, 255],
|
|
576
|
+
"firebrick": [178, 34, 34],
|
|
577
|
+
"floralwhite": [255, 250, 240],
|
|
578
|
+
"forestgreen": [34, 139, 34],
|
|
579
|
+
"fuchsia": [255, 0, 255],
|
|
580
|
+
"gainsboro": [220, 220, 220],
|
|
581
|
+
"ghostwhite": [248, 248, 255],
|
|
582
|
+
"gold": [255, 215, 0],
|
|
583
|
+
"goldenrod": [218, 165, 32],
|
|
584
|
+
"gray": [128, 128, 128],
|
|
585
|
+
"green": [0, 128, 0],
|
|
586
|
+
"greenyellow": [173, 255, 47],
|
|
587
|
+
"grey": [128, 128, 128],
|
|
588
|
+
"honeydew": [240, 255, 240],
|
|
589
|
+
"hotpink": [255, 105, 180],
|
|
590
|
+
"indianred": [205, 92, 92],
|
|
591
|
+
"indigo": [75, 0, 130],
|
|
592
|
+
"ivory": [255, 255, 240],
|
|
593
|
+
"khaki": [240, 230, 140],
|
|
594
|
+
"lavender": [230, 230, 250],
|
|
595
|
+
"lavenderblush": [255, 240, 245],
|
|
596
|
+
"lawngreen": [124, 252, 0],
|
|
597
|
+
"lemonchiffon": [255, 250, 205],
|
|
598
|
+
"lightblue": [173, 216, 230],
|
|
599
|
+
"lightcoral": [240, 128, 128],
|
|
600
|
+
"lightcyan": [224, 255, 255],
|
|
601
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
602
|
+
"lightgray": [211, 211, 211],
|
|
603
|
+
"lightgreen": [144, 238, 144],
|
|
604
|
+
"lightgrey": [211, 211, 211],
|
|
605
|
+
"lightpink": [255, 182, 193],
|
|
606
|
+
"lightsalmon": [255, 160, 122],
|
|
607
|
+
"lightseagreen": [32, 178, 170],
|
|
608
|
+
"lightskyblue": [135, 206, 250],
|
|
609
|
+
"lightslategray": [119, 136, 153],
|
|
610
|
+
"lightslategrey": [119, 136, 153],
|
|
611
|
+
"lightsteelblue": [176, 196, 222],
|
|
612
|
+
"lightyellow": [255, 255, 224],
|
|
613
|
+
"lime": [0, 255, 0],
|
|
614
|
+
"limegreen": [50, 205, 50],
|
|
615
|
+
"linen": [250, 240, 230],
|
|
616
|
+
"magenta": [255, 0, 255],
|
|
617
|
+
"maroon": [128, 0, 0],
|
|
618
|
+
"mediumaquamarine": [102, 205, 170],
|
|
619
|
+
"mediumblue": [0, 0, 205],
|
|
620
|
+
"mediumorchid": [186, 85, 211],
|
|
621
|
+
"mediumpurple": [147, 112, 219],
|
|
622
|
+
"mediumseagreen": [60, 179, 113],
|
|
623
|
+
"mediumslateblue": [123, 104, 238],
|
|
624
|
+
"mediumspringgreen": [0, 250, 154],
|
|
625
|
+
"mediumturquoise": [72, 209, 204],
|
|
626
|
+
"mediumvioletred": [199, 21, 133],
|
|
627
|
+
"midnightblue": [25, 25, 112],
|
|
628
|
+
"mintcream": [245, 255, 250],
|
|
629
|
+
"mistyrose": [255, 228, 225],
|
|
630
|
+
"moccasin": [255, 228, 181],
|
|
631
|
+
"navajowhite": [255, 222, 173],
|
|
632
|
+
"navy": [0, 0, 128],
|
|
633
|
+
"oldlace": [253, 245, 230],
|
|
634
|
+
"olive": [128, 128, 0],
|
|
635
|
+
"olivedrab": [107, 142, 35],
|
|
636
|
+
"orange": [255, 165, 0],
|
|
637
|
+
"orangered": [255, 69, 0],
|
|
638
|
+
"orchid": [218, 112, 214],
|
|
639
|
+
"palegoldenrod": [238, 232, 170],
|
|
640
|
+
"palegreen": [152, 251, 152],
|
|
641
|
+
"paleturquoise": [175, 238, 238],
|
|
642
|
+
"palevioletred": [219, 112, 147],
|
|
643
|
+
"papayawhip": [255, 239, 213],
|
|
644
|
+
"peachpuff": [255, 218, 185],
|
|
645
|
+
"peru": [205, 133, 63],
|
|
646
|
+
"pink": [255, 192, 203],
|
|
647
|
+
"plum": [221, 160, 221],
|
|
648
|
+
"powderblue": [176, 224, 230],
|
|
649
|
+
"purple": [128, 0, 128],
|
|
650
|
+
"rebeccapurple": [102, 51, 153],
|
|
651
|
+
"red": [255, 0, 0],
|
|
652
|
+
"rosybrown": [188, 143, 143],
|
|
653
|
+
"royalblue": [65, 105, 225],
|
|
654
|
+
"saddlebrown": [139, 69, 19],
|
|
655
|
+
"salmon": [250, 128, 114],
|
|
656
|
+
"sandybrown": [244, 164, 96],
|
|
657
|
+
"seagreen": [46, 139, 87],
|
|
658
|
+
"seashell": [255, 245, 238],
|
|
659
|
+
"sienna": [160, 82, 45],
|
|
660
|
+
"silver": [192, 192, 192],
|
|
661
|
+
"skyblue": [135, 206, 235],
|
|
662
|
+
"slateblue": [106, 90, 205],
|
|
663
|
+
"slategray": [112, 128, 144],
|
|
664
|
+
"slategrey": [112, 128, 144],
|
|
665
|
+
"snow": [255, 250, 250],
|
|
666
|
+
"springgreen": [0, 255, 127],
|
|
667
|
+
"steelblue": [70, 130, 180],
|
|
668
|
+
"tan": [210, 180, 140],
|
|
669
|
+
"teal": [0, 128, 128],
|
|
670
|
+
"thistle": [216, 191, 216],
|
|
671
|
+
"tomato": [255, 99, 71],
|
|
672
|
+
"turquoise": [64, 224, 208],
|
|
673
|
+
"violet": [238, 130, 238],
|
|
674
|
+
"wheat": [245, 222, 179],
|
|
675
|
+
"white": [255, 255, 255],
|
|
676
|
+
"whitesmoke": [245, 245, 245],
|
|
677
|
+
"yellow": [255, 255, 0],
|
|
678
|
+
"yellowgreen": [154, 205, 50]
|
|
678
679
|
};
|
|
679
680
|
|
|
680
681
|
/* MIT license */
|
|
681
|
-
|
|
682
682
|
/* eslint-disable no-mixed-operators */
|
|
683
|
+
|
|
684
|
+
|
|
683
685
|
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
684
686
|
// values that give correct `typeof` results).
|
|
685
687
|
// do not use box values types (i.e. Number(), String(), etc.)
|
|
686
688
|
|
|
687
689
|
const reverseKeywords = {};
|
|
688
|
-
|
|
689
690
|
for (const key of Object.keys(colorName)) {
|
|
690
|
-
|
|
691
|
+
reverseKeywords[colorName[key]] = key;
|
|
691
692
|
}
|
|
692
693
|
|
|
693
694
|
const convert$1 = {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
xyz: {
|
|
715
|
-
channels: 3,
|
|
716
|
-
labels: 'xyz'
|
|
717
|
-
},
|
|
718
|
-
lab: {
|
|
719
|
-
channels: 3,
|
|
720
|
-
labels: 'lab'
|
|
721
|
-
},
|
|
722
|
-
lch: {
|
|
723
|
-
channels: 3,
|
|
724
|
-
labels: 'lch'
|
|
725
|
-
},
|
|
726
|
-
hex: {
|
|
727
|
-
channels: 1,
|
|
728
|
-
labels: ['hex']
|
|
729
|
-
},
|
|
730
|
-
keyword: {
|
|
731
|
-
channels: 1,
|
|
732
|
-
labels: ['keyword']
|
|
733
|
-
},
|
|
734
|
-
ansi16: {
|
|
735
|
-
channels: 1,
|
|
736
|
-
labels: ['ansi16']
|
|
737
|
-
},
|
|
738
|
-
ansi256: {
|
|
739
|
-
channels: 1,
|
|
740
|
-
labels: ['ansi256']
|
|
741
|
-
},
|
|
742
|
-
hcg: {
|
|
743
|
-
channels: 3,
|
|
744
|
-
labels: ['h', 'c', 'g']
|
|
745
|
-
},
|
|
746
|
-
apple: {
|
|
747
|
-
channels: 3,
|
|
748
|
-
labels: ['r16', 'g16', 'b16']
|
|
749
|
-
},
|
|
750
|
-
gray: {
|
|
751
|
-
channels: 1,
|
|
752
|
-
labels: ['gray']
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
var conversions = convert$1; // Hide .channels and .labels properties
|
|
756
|
-
|
|
695
|
+
rgb: {channels: 3, labels: 'rgb'},
|
|
696
|
+
hsl: {channels: 3, labels: 'hsl'},
|
|
697
|
+
hsv: {channels: 3, labels: 'hsv'},
|
|
698
|
+
hwb: {channels: 3, labels: 'hwb'},
|
|
699
|
+
cmyk: {channels: 4, labels: 'cmyk'},
|
|
700
|
+
xyz: {channels: 3, labels: 'xyz'},
|
|
701
|
+
lab: {channels: 3, labels: 'lab'},
|
|
702
|
+
lch: {channels: 3, labels: 'lch'},
|
|
703
|
+
hex: {channels: 1, labels: ['hex']},
|
|
704
|
+
keyword: {channels: 1, labels: ['keyword']},
|
|
705
|
+
ansi16: {channels: 1, labels: ['ansi16']},
|
|
706
|
+
ansi256: {channels: 1, labels: ['ansi256']},
|
|
707
|
+
hcg: {channels: 3, labels: ['h', 'c', 'g']},
|
|
708
|
+
apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
|
|
709
|
+
gray: {channels: 1, labels: ['gray']}
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
var conversions = convert$1;
|
|
713
|
+
|
|
714
|
+
// Hide .channels and .labels properties
|
|
757
715
|
for (const model of Object.keys(convert$1)) {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
716
|
+
if (!('channels' in convert$1[model])) {
|
|
717
|
+
throw new Error('missing channels property: ' + model);
|
|
718
|
+
}
|
|
761
719
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
720
|
+
if (!('labels' in convert$1[model])) {
|
|
721
|
+
throw new Error('missing channel labels property: ' + model);
|
|
722
|
+
}
|
|
765
723
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
724
|
+
if (convert$1[model].labels.length !== convert$1[model].channels) {
|
|
725
|
+
throw new Error('channel and label counts mismatch: ' + model);
|
|
726
|
+
}
|
|
769
727
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
delete convert$1[model].labels;
|
|
776
|
-
Object.defineProperty(convert$1[model], 'channels', {
|
|
777
|
-
value: channels
|
|
778
|
-
});
|
|
779
|
-
Object.defineProperty(convert$1[model], 'labels', {
|
|
780
|
-
value: labels
|
|
781
|
-
});
|
|
728
|
+
const {channels, labels} = convert$1[model];
|
|
729
|
+
delete convert$1[model].channels;
|
|
730
|
+
delete convert$1[model].labels;
|
|
731
|
+
Object.defineProperty(convert$1[model], 'channels', {value: channels});
|
|
732
|
+
Object.defineProperty(convert$1[model], 'labels', {value: labels});
|
|
782
733
|
}
|
|
783
734
|
|
|
784
735
|
convert$1.rgb.hsl = function (rgb) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
736
|
+
const r = rgb[0] / 255;
|
|
737
|
+
const g = rgb[1] / 255;
|
|
738
|
+
const b = rgb[2] / 255;
|
|
739
|
+
const min = Math.min(r, g, b);
|
|
740
|
+
const max = Math.max(r, g, b);
|
|
741
|
+
const delta = max - min;
|
|
742
|
+
let h;
|
|
743
|
+
let s;
|
|
744
|
+
|
|
745
|
+
if (max === min) {
|
|
746
|
+
h = 0;
|
|
747
|
+
} else if (r === max) {
|
|
748
|
+
h = (g - b) / delta;
|
|
749
|
+
} else if (g === max) {
|
|
750
|
+
h = 2 + (b - r) / delta;
|
|
751
|
+
} else if (b === max) {
|
|
752
|
+
h = 4 + (r - g) / delta;
|
|
753
|
+
}
|
|
803
754
|
|
|
804
|
-
|
|
755
|
+
h = Math.min(h * 60, 360);
|
|
805
756
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
757
|
+
if (h < 0) {
|
|
758
|
+
h += 360;
|
|
759
|
+
}
|
|
809
760
|
|
|
810
|
-
|
|
761
|
+
const l = (min + max) / 2;
|
|
811
762
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
763
|
+
if (max === min) {
|
|
764
|
+
s = 0;
|
|
765
|
+
} else if (l <= 0.5) {
|
|
766
|
+
s = delta / (max + min);
|
|
767
|
+
} else {
|
|
768
|
+
s = delta / (2 - max - min);
|
|
769
|
+
}
|
|
819
770
|
|
|
820
|
-
|
|
771
|
+
return [h, s * 100, l * 100];
|
|
821
772
|
};
|
|
822
773
|
|
|
823
774
|
convert$1.rgb.hsv = function (rgb) {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
if (diff === 0) {
|
|
840
|
-
h = 0;
|
|
841
|
-
s = 0;
|
|
842
|
-
} else {
|
|
843
|
-
s = diff / v;
|
|
844
|
-
rdif = diffc(r);
|
|
845
|
-
gdif = diffc(g);
|
|
846
|
-
bdif = diffc(b);
|
|
847
|
-
|
|
848
|
-
if (r === v) {
|
|
849
|
-
h = bdif - gdif;
|
|
850
|
-
} else if (g === v) {
|
|
851
|
-
h = 1 / 3 + rdif - bdif;
|
|
852
|
-
} else if (b === v) {
|
|
853
|
-
h = 2 / 3 + gdif - rdif;
|
|
854
|
-
}
|
|
775
|
+
let rdif;
|
|
776
|
+
let gdif;
|
|
777
|
+
let bdif;
|
|
778
|
+
let h;
|
|
779
|
+
let s;
|
|
780
|
+
|
|
781
|
+
const r = rgb[0] / 255;
|
|
782
|
+
const g = rgb[1] / 255;
|
|
783
|
+
const b = rgb[2] / 255;
|
|
784
|
+
const v = Math.max(r, g, b);
|
|
785
|
+
const diff = v - Math.min(r, g, b);
|
|
786
|
+
const diffc = function (c) {
|
|
787
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
788
|
+
};
|
|
855
789
|
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
790
|
+
if (diff === 0) {
|
|
791
|
+
h = 0;
|
|
792
|
+
s = 0;
|
|
793
|
+
} else {
|
|
794
|
+
s = diff / v;
|
|
795
|
+
rdif = diffc(r);
|
|
796
|
+
gdif = diffc(g);
|
|
797
|
+
bdif = diffc(b);
|
|
798
|
+
|
|
799
|
+
if (r === v) {
|
|
800
|
+
h = bdif - gdif;
|
|
801
|
+
} else if (g === v) {
|
|
802
|
+
h = (1 / 3) + rdif - bdif;
|
|
803
|
+
} else if (b === v) {
|
|
804
|
+
h = (2 / 3) + gdif - rdif;
|
|
805
|
+
}
|
|
862
806
|
|
|
863
|
-
|
|
807
|
+
if (h < 0) {
|
|
808
|
+
h += 1;
|
|
809
|
+
} else if (h > 1) {
|
|
810
|
+
h -= 1;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
return [
|
|
815
|
+
h * 360,
|
|
816
|
+
s * 100,
|
|
817
|
+
v * 100
|
|
818
|
+
];
|
|
864
819
|
};
|
|
865
820
|
|
|
866
821
|
convert$1.rgb.hwb = function (rgb) {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
822
|
+
const r = rgb[0];
|
|
823
|
+
const g = rgb[1];
|
|
824
|
+
let b = rgb[2];
|
|
825
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
826
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
827
|
+
|
|
828
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
829
|
+
|
|
830
|
+
return [h, w * 100, b * 100];
|
|
874
831
|
};
|
|
875
832
|
|
|
876
833
|
convert$1.rgb.cmyk = function (rgb) {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
834
|
+
const r = rgb[0] / 255;
|
|
835
|
+
const g = rgb[1] / 255;
|
|
836
|
+
const b = rgb[2] / 255;
|
|
837
|
+
|
|
838
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
839
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
840
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
841
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
842
|
+
|
|
843
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
885
844
|
};
|
|
886
845
|
|
|
887
846
|
function comparativeDistance(x, y) {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
847
|
+
/*
|
|
848
|
+
See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
|
849
|
+
*/
|
|
850
|
+
return (
|
|
851
|
+
((x[0] - y[0]) ** 2) +
|
|
852
|
+
((x[1] - y[1]) ** 2) +
|
|
853
|
+
((x[2] - y[2]) ** 2)
|
|
854
|
+
);
|
|
892
855
|
}
|
|
893
856
|
|
|
894
857
|
convert$1.rgb.keyword = function (rgb) {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}
|
|
858
|
+
const reversed = reverseKeywords[rgb];
|
|
859
|
+
if (reversed) {
|
|
860
|
+
return reversed;
|
|
861
|
+
}
|
|
900
862
|
|
|
901
|
-
|
|
902
|
-
|
|
863
|
+
let currentClosestDistance = Infinity;
|
|
864
|
+
let currentClosestKeyword;
|
|
903
865
|
|
|
904
|
-
|
|
905
|
-
|
|
866
|
+
for (const keyword of Object.keys(colorName)) {
|
|
867
|
+
const value = colorName[keyword];
|
|
906
868
|
|
|
907
|
-
|
|
869
|
+
// Compute comparative distance
|
|
870
|
+
const distance = comparativeDistance(rgb, value);
|
|
908
871
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
872
|
+
// Check if its less, if so set as closest
|
|
873
|
+
if (distance < currentClosestDistance) {
|
|
874
|
+
currentClosestDistance = distance;
|
|
875
|
+
currentClosestKeyword = keyword;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
914
878
|
|
|
915
|
-
|
|
879
|
+
return currentClosestKeyword;
|
|
916
880
|
};
|
|
917
881
|
|
|
918
882
|
convert$1.keyword.rgb = function (keyword) {
|
|
919
|
-
|
|
883
|
+
return colorName[keyword];
|
|
920
884
|
};
|
|
921
885
|
|
|
922
886
|
convert$1.rgb.xyz = function (rgb) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
887
|
+
let r = rgb[0] / 255;
|
|
888
|
+
let g = rgb[1] / 255;
|
|
889
|
+
let b = rgb[2] / 255;
|
|
926
890
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
891
|
+
// Assume sRGB
|
|
892
|
+
r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
|
|
893
|
+
g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
|
|
894
|
+
b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
|
|
895
|
+
|
|
896
|
+
const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
|
|
897
|
+
const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
|
|
898
|
+
const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
|
|
899
|
+
|
|
900
|
+
return [x * 100, y * 100, z * 100];
|
|
934
901
|
};
|
|
935
902
|
|
|
936
903
|
convert$1.rgb.lab = function (rgb) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
904
|
+
const xyz = convert$1.rgb.xyz(rgb);
|
|
905
|
+
let x = xyz[0];
|
|
906
|
+
let y = xyz[1];
|
|
907
|
+
let z = xyz[2];
|
|
908
|
+
|
|
909
|
+
x /= 95.047;
|
|
910
|
+
y /= 100;
|
|
911
|
+
z /= 108.883;
|
|
912
|
+
|
|
913
|
+
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
|
914
|
+
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
|
915
|
+
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
|
916
|
+
|
|
917
|
+
const l = (116 * y) - 16;
|
|
918
|
+
const a = 500 * (x - y);
|
|
919
|
+
const b = 200 * (y - z);
|
|
920
|
+
|
|
921
|
+
return [l, a, b];
|
|
951
922
|
};
|
|
952
923
|
|
|
953
924
|
convert$1.hsl.rgb = function (hsl) {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
if (l < 0.5) {
|
|
967
|
-
t2 = l * (1 + s);
|
|
968
|
-
} else {
|
|
969
|
-
t2 = l + s - l * s;
|
|
970
|
-
}
|
|
925
|
+
const h = hsl[0] / 360;
|
|
926
|
+
const s = hsl[1] / 100;
|
|
927
|
+
const l = hsl[2] / 100;
|
|
928
|
+
let t2;
|
|
929
|
+
let t3;
|
|
930
|
+
let val;
|
|
931
|
+
|
|
932
|
+
if (s === 0) {
|
|
933
|
+
val = l * 255;
|
|
934
|
+
return [val, val, val];
|
|
935
|
+
}
|
|
971
936
|
|
|
972
|
-
|
|
973
|
-
|
|
937
|
+
if (l < 0.5) {
|
|
938
|
+
t2 = l * (1 + s);
|
|
939
|
+
} else {
|
|
940
|
+
t2 = l + s - l * s;
|
|
941
|
+
}
|
|
974
942
|
|
|
975
|
-
|
|
976
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
943
|
+
const t1 = 2 * l - t2;
|
|
977
944
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
945
|
+
const rgb = [0, 0, 0];
|
|
946
|
+
for (let i = 0; i < 3; i++) {
|
|
947
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
948
|
+
if (t3 < 0) {
|
|
949
|
+
t3++;
|
|
950
|
+
}
|
|
981
951
|
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
952
|
+
if (t3 > 1) {
|
|
953
|
+
t3--;
|
|
954
|
+
}
|
|
985
955
|
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
956
|
+
if (6 * t3 < 1) {
|
|
957
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
958
|
+
} else if (2 * t3 < 1) {
|
|
959
|
+
val = t2;
|
|
960
|
+
} else if (3 * t3 < 2) {
|
|
961
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
962
|
+
} else {
|
|
963
|
+
val = t1;
|
|
964
|
+
}
|
|
995
965
|
|
|
996
|
-
|
|
997
|
-
|
|
966
|
+
rgb[i] = val * 255;
|
|
967
|
+
}
|
|
998
968
|
|
|
999
|
-
|
|
969
|
+
return rgb;
|
|
1000
970
|
};
|
|
1001
971
|
|
|
1002
972
|
convert$1.hsl.hsv = function (hsl) {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
973
|
+
const h = hsl[0];
|
|
974
|
+
let s = hsl[1] / 100;
|
|
975
|
+
let l = hsl[2] / 100;
|
|
976
|
+
let smin = s;
|
|
977
|
+
const lmin = Math.max(l, 0.01);
|
|
978
|
+
|
|
979
|
+
l *= 2;
|
|
980
|
+
s *= (l <= 1) ? l : 2 - l;
|
|
981
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
982
|
+
const v = (l + s) / 2;
|
|
983
|
+
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
|
984
|
+
|
|
985
|
+
return [h, sv * 100, v * 100];
|
|
1014
986
|
};
|
|
1015
987
|
|
|
1016
988
|
convert$1.hsv.rgb = function (hsv) {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
case 5:
|
|
1044
|
-
return [v, p, q];
|
|
1045
|
-
}
|
|
989
|
+
const h = hsv[0] / 60;
|
|
990
|
+
const s = hsv[1] / 100;
|
|
991
|
+
let v = hsv[2] / 100;
|
|
992
|
+
const hi = Math.floor(h) % 6;
|
|
993
|
+
|
|
994
|
+
const f = h - Math.floor(h);
|
|
995
|
+
const p = 255 * v * (1 - s);
|
|
996
|
+
const q = 255 * v * (1 - (s * f));
|
|
997
|
+
const t = 255 * v * (1 - (s * (1 - f)));
|
|
998
|
+
v *= 255;
|
|
999
|
+
|
|
1000
|
+
switch (hi) {
|
|
1001
|
+
case 0:
|
|
1002
|
+
return [v, t, p];
|
|
1003
|
+
case 1:
|
|
1004
|
+
return [q, v, p];
|
|
1005
|
+
case 2:
|
|
1006
|
+
return [p, v, t];
|
|
1007
|
+
case 3:
|
|
1008
|
+
return [p, q, v];
|
|
1009
|
+
case 4:
|
|
1010
|
+
return [t, p, v];
|
|
1011
|
+
case 5:
|
|
1012
|
+
return [v, p, q];
|
|
1013
|
+
}
|
|
1046
1014
|
};
|
|
1047
1015
|
|
|
1048
1016
|
convert$1.hsv.hsl = function (hsv) {
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
1017
|
+
const h = hsv[0];
|
|
1018
|
+
const s = hsv[1] / 100;
|
|
1019
|
+
const v = hsv[2] / 100;
|
|
1020
|
+
const vmin = Math.max(v, 0.01);
|
|
1021
|
+
let sl;
|
|
1022
|
+
let l;
|
|
1023
|
+
|
|
1024
|
+
l = (2 - s) * v;
|
|
1025
|
+
const lmin = (2 - s) * vmin;
|
|
1026
|
+
sl = s * vmin;
|
|
1027
|
+
sl /= (lmin <= 1) ? lmin : 2 - lmin;
|
|
1028
|
+
sl = sl || 0;
|
|
1029
|
+
l /= 2;
|
|
1063
1030
|
|
|
1031
|
+
return [h, sl * 100, l * 100];
|
|
1032
|
+
};
|
|
1064
1033
|
|
|
1034
|
+
// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
1065
1035
|
convert$1.hwb.rgb = function (hwb) {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1036
|
+
const h = hwb[0] / 360;
|
|
1037
|
+
let wh = hwb[1] / 100;
|
|
1038
|
+
let bl = hwb[2] / 100;
|
|
1039
|
+
const ratio = wh + bl;
|
|
1040
|
+
let f;
|
|
1041
|
+
|
|
1042
|
+
// Wh + bl cant be > 1
|
|
1043
|
+
if (ratio > 1) {
|
|
1044
|
+
wh /= ratio;
|
|
1045
|
+
bl /= ratio;
|
|
1046
|
+
}
|
|
1076
1047
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1048
|
+
const i = Math.floor(6 * h);
|
|
1049
|
+
const v = 1 - bl;
|
|
1050
|
+
f = 6 * h - i;
|
|
1080
1051
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1052
|
+
if ((i & 0x01) !== 0) {
|
|
1053
|
+
f = 1 - f;
|
|
1054
|
+
}
|
|
1084
1055
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
let r;
|
|
1088
|
-
let g;
|
|
1089
|
-
let b;
|
|
1090
|
-
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
|
1091
|
-
|
|
1092
|
-
switch (i) {
|
|
1093
|
-
default:
|
|
1094
|
-
case 6:
|
|
1095
|
-
case 0:
|
|
1096
|
-
r = v;
|
|
1097
|
-
g = n;
|
|
1098
|
-
b = wh;
|
|
1099
|
-
break;
|
|
1100
|
-
|
|
1101
|
-
case 1:
|
|
1102
|
-
r = n;
|
|
1103
|
-
g = v;
|
|
1104
|
-
b = wh;
|
|
1105
|
-
break;
|
|
1106
|
-
|
|
1107
|
-
case 2:
|
|
1108
|
-
r = wh;
|
|
1109
|
-
g = v;
|
|
1110
|
-
b = n;
|
|
1111
|
-
break;
|
|
1112
|
-
|
|
1113
|
-
case 3:
|
|
1114
|
-
r = wh;
|
|
1115
|
-
g = n;
|
|
1116
|
-
b = v;
|
|
1117
|
-
break;
|
|
1118
|
-
|
|
1119
|
-
case 4:
|
|
1120
|
-
r = n;
|
|
1121
|
-
g = wh;
|
|
1122
|
-
b = v;
|
|
1123
|
-
break;
|
|
1124
|
-
|
|
1125
|
-
case 5:
|
|
1126
|
-
r = v;
|
|
1127
|
-
g = wh;
|
|
1128
|
-
b = n;
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
|
1056
|
+
const n = wh + f * (v - wh); // Linear interpolation
|
|
1132
1057
|
|
|
1058
|
+
let r;
|
|
1059
|
+
let g;
|
|
1060
|
+
let b;
|
|
1061
|
+
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
|
1062
|
+
switch (i) {
|
|
1063
|
+
default:
|
|
1064
|
+
case 6:
|
|
1065
|
+
case 0: r = v; g = n; b = wh; break;
|
|
1066
|
+
case 1: r = n; g = v; b = wh; break;
|
|
1067
|
+
case 2: r = wh; g = v; b = n; break;
|
|
1068
|
+
case 3: r = wh; g = n; b = v; break;
|
|
1069
|
+
case 4: r = n; g = wh; b = v; break;
|
|
1070
|
+
case 5: r = v; g = wh; b = n; break;
|
|
1071
|
+
}
|
|
1072
|
+
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
|
1133
1073
|
|
|
1134
|
-
|
|
1074
|
+
return [r * 255, g * 255, b * 255];
|
|
1135
1075
|
};
|
|
1136
1076
|
|
|
1137
1077
|
convert$1.cmyk.rgb = function (cmyk) {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1078
|
+
const c = cmyk[0] / 100;
|
|
1079
|
+
const m = cmyk[1] / 100;
|
|
1080
|
+
const y = cmyk[2] / 100;
|
|
1081
|
+
const k = cmyk[3] / 100;
|
|
1082
|
+
|
|
1083
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1084
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1085
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1086
|
+
|
|
1087
|
+
return [r * 255, g * 255, b * 255];
|
|
1146
1088
|
};
|
|
1147
1089
|
|
|
1148
1090
|
convert$1.xyz.rgb = function (xyz) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1091
|
+
const x = xyz[0] / 100;
|
|
1092
|
+
const y = xyz[1] / 100;
|
|
1093
|
+
const z = xyz[2] / 100;
|
|
1094
|
+
let r;
|
|
1095
|
+
let g;
|
|
1096
|
+
let b;
|
|
1097
|
+
|
|
1098
|
+
r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
|
|
1099
|
+
g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
|
|
1100
|
+
b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
|
|
1101
|
+
|
|
1102
|
+
// Assume sRGB
|
|
1103
|
+
r = r > 0.0031308
|
|
1104
|
+
? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
|
|
1105
|
+
: r * 12.92;
|
|
1106
|
+
|
|
1107
|
+
g = g > 0.0031308
|
|
1108
|
+
? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
|
|
1109
|
+
: g * 12.92;
|
|
1110
|
+
|
|
1111
|
+
b = b > 0.0031308
|
|
1112
|
+
? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
|
|
1113
|
+
: b * 12.92;
|
|
1114
|
+
|
|
1115
|
+
r = Math.min(Math.max(0, r), 1);
|
|
1116
|
+
g = Math.min(Math.max(0, g), 1);
|
|
1117
|
+
b = Math.min(Math.max(0, b), 1);
|
|
1118
|
+
|
|
1119
|
+
return [r * 255, g * 255, b * 255];
|
|
1166
1120
|
};
|
|
1167
1121
|
|
|
1168
1122
|
convert$1.xyz.lab = function (xyz) {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1123
|
+
let x = xyz[0];
|
|
1124
|
+
let y = xyz[1];
|
|
1125
|
+
let z = xyz[2];
|
|
1126
|
+
|
|
1127
|
+
x /= 95.047;
|
|
1128
|
+
y /= 100;
|
|
1129
|
+
z /= 108.883;
|
|
1130
|
+
|
|
1131
|
+
x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
|
|
1132
|
+
y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
|
|
1133
|
+
z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
|
|
1134
|
+
|
|
1135
|
+
const l = (116 * y) - 16;
|
|
1136
|
+
const a = 500 * (x - y);
|
|
1137
|
+
const b = 200 * (y - z);
|
|
1138
|
+
|
|
1139
|
+
return [l, a, b];
|
|
1182
1140
|
};
|
|
1183
1141
|
|
|
1184
1142
|
convert$1.lab.xyz = function (lab) {
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1143
|
+
const l = lab[0];
|
|
1144
|
+
const a = lab[1];
|
|
1145
|
+
const b = lab[2];
|
|
1146
|
+
let x;
|
|
1147
|
+
let y;
|
|
1148
|
+
let z;
|
|
1149
|
+
|
|
1150
|
+
y = (l + 16) / 116;
|
|
1151
|
+
x = a / 500 + y;
|
|
1152
|
+
z = y - b / 200;
|
|
1153
|
+
|
|
1154
|
+
const y2 = y ** 3;
|
|
1155
|
+
const x2 = x ** 3;
|
|
1156
|
+
const z2 = z ** 3;
|
|
1157
|
+
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1158
|
+
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1159
|
+
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1160
|
+
|
|
1161
|
+
x *= 95.047;
|
|
1162
|
+
y *= 100;
|
|
1163
|
+
z *= 108.883;
|
|
1164
|
+
|
|
1165
|
+
return [x, y, z];
|
|
1204
1166
|
};
|
|
1205
1167
|
|
|
1206
1168
|
convert$1.lab.lch = function (lab) {
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
if (h < 0) {
|
|
1215
|
-
h += 360;
|
|
1216
|
-
}
|
|
1169
|
+
const l = lab[0];
|
|
1170
|
+
const a = lab[1];
|
|
1171
|
+
const b = lab[2];
|
|
1172
|
+
let h;
|
|
1173
|
+
|
|
1174
|
+
const hr = Math.atan2(b, a);
|
|
1175
|
+
h = hr * 360 / 2 / Math.PI;
|
|
1217
1176
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1177
|
+
if (h < 0) {
|
|
1178
|
+
h += 360;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
const c = Math.sqrt(a * a + b * b);
|
|
1182
|
+
|
|
1183
|
+
return [l, c, h];
|
|
1220
1184
|
};
|
|
1221
1185
|
|
|
1222
1186
|
convert$1.lch.lab = function (lch) {
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1187
|
+
const l = lch[0];
|
|
1188
|
+
const c = lch[1];
|
|
1189
|
+
const h = lch[2];
|
|
1190
|
+
|
|
1191
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
1192
|
+
const a = c * Math.cos(hr);
|
|
1193
|
+
const b = c * Math.sin(hr);
|
|
1194
|
+
|
|
1195
|
+
return [l, a, b];
|
|
1230
1196
|
};
|
|
1231
1197
|
|
|
1232
1198
|
convert$1.rgb.ansi16 = function (args, saturation = null) {
|
|
1233
|
-
|
|
1234
|
-
|
|
1199
|
+
const [r, g, b] = args;
|
|
1200
|
+
let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
|
|
1235
1201
|
|
|
1236
|
-
|
|
1202
|
+
value = Math.round(value / 50);
|
|
1237
1203
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1204
|
+
if (value === 0) {
|
|
1205
|
+
return 30;
|
|
1206
|
+
}
|
|
1241
1207
|
|
|
1242
|
-
|
|
1208
|
+
let ansi = 30
|
|
1209
|
+
+ ((Math.round(b / 255) << 2)
|
|
1210
|
+
| (Math.round(g / 255) << 1)
|
|
1211
|
+
| Math.round(r / 255));
|
|
1243
1212
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1213
|
+
if (value === 2) {
|
|
1214
|
+
ansi += 60;
|
|
1215
|
+
}
|
|
1247
1216
|
|
|
1248
|
-
|
|
1217
|
+
return ansi;
|
|
1249
1218
|
};
|
|
1250
1219
|
|
|
1251
1220
|
convert$1.hsv.ansi16 = function (args) {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1221
|
+
// Optimization here; we already know the value and don't need to get
|
|
1222
|
+
// it converted for us.
|
|
1223
|
+
return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
|
|
1255
1224
|
};
|
|
1256
1225
|
|
|
1257
1226
|
convert$1.rgb.ansi256 = function (args) {
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1227
|
+
const r = args[0];
|
|
1228
|
+
const g = args[1];
|
|
1229
|
+
const b = args[2];
|
|
1230
|
+
|
|
1231
|
+
// We use the extended greyscale palette here, with the exception of
|
|
1232
|
+
// black and white. normal palette only has 4 greyscale shades.
|
|
1233
|
+
if (r === g && g === b) {
|
|
1234
|
+
if (r < 8) {
|
|
1235
|
+
return 16;
|
|
1236
|
+
}
|
|
1267
1237
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1238
|
+
if (r > 248) {
|
|
1239
|
+
return 231;
|
|
1240
|
+
}
|
|
1271
1241
|
|
|
1272
|
-
|
|
1273
|
-
|
|
1242
|
+
return Math.round(((r - 8) / 247) * 24) + 232;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
const ansi = 16
|
|
1246
|
+
+ (36 * Math.round(r / 255 * 5))
|
|
1247
|
+
+ (6 * Math.round(g / 255 * 5))
|
|
1248
|
+
+ Math.round(b / 255 * 5);
|
|
1274
1249
|
|
|
1275
|
-
|
|
1276
|
-
return ansi;
|
|
1250
|
+
return ansi;
|
|
1277
1251
|
};
|
|
1278
1252
|
|
|
1279
1253
|
convert$1.ansi16.rgb = function (args) {
|
|
1280
|
-
|
|
1254
|
+
let color = args % 10;
|
|
1281
1255
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1256
|
+
// Handle greyscale
|
|
1257
|
+
if (color === 0 || color === 7) {
|
|
1258
|
+
if (args > 50) {
|
|
1259
|
+
color += 3.5;
|
|
1260
|
+
}
|
|
1286
1261
|
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1262
|
+
color = color / 10.5 * 255;
|
|
1263
|
+
|
|
1264
|
+
return [color, color, color];
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
1268
|
+
const r = ((color & 1) * mult) * 255;
|
|
1269
|
+
const g = (((color >> 1) & 1) * mult) * 255;
|
|
1270
|
+
const b = (((color >> 2) & 1) * mult) * 255;
|
|
1290
1271
|
|
|
1291
|
-
|
|
1292
|
-
const r = (color & 1) * mult * 255;
|
|
1293
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
1294
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
1295
|
-
return [r, g, b];
|
|
1272
|
+
return [r, g, b];
|
|
1296
1273
|
};
|
|
1297
1274
|
|
|
1298
1275
|
convert$1.ansi256.rgb = function (args) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1276
|
+
// Handle greyscale
|
|
1277
|
+
if (args >= 232) {
|
|
1278
|
+
const c = (args - 232) * 10 + 8;
|
|
1279
|
+
return [c, c, c];
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
args -= 16;
|
|
1283
|
+
|
|
1284
|
+
let rem;
|
|
1285
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
1286
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1287
|
+
const b = (rem % 6) / 5 * 255;
|
|
1304
1288
|
|
|
1305
|
-
|
|
1306
|
-
let rem;
|
|
1307
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
1308
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1309
|
-
const b = rem % 6 / 5 * 255;
|
|
1310
|
-
return [r, g, b];
|
|
1289
|
+
return [r, g, b];
|
|
1311
1290
|
};
|
|
1312
1291
|
|
|
1313
1292
|
convert$1.rgb.hex = function (args) {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1293
|
+
const integer = ((Math.round(args[0]) & 0xFF) << 16)
|
|
1294
|
+
+ ((Math.round(args[1]) & 0xFF) << 8)
|
|
1295
|
+
+ (Math.round(args[2]) & 0xFF);
|
|
1296
|
+
|
|
1297
|
+
const string = integer.toString(16).toUpperCase();
|
|
1298
|
+
return '000000'.substring(string.length) + string;
|
|
1317
1299
|
};
|
|
1318
1300
|
|
|
1319
1301
|
convert$1.hex.rgb = function (args) {
|
|
1320
|
-
|
|
1302
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1303
|
+
if (!match) {
|
|
1304
|
+
return [0, 0, 0];
|
|
1305
|
+
}
|
|
1321
1306
|
|
|
1322
|
-
|
|
1323
|
-
return [0, 0, 0];
|
|
1324
|
-
}
|
|
1307
|
+
let colorString = match[0];
|
|
1325
1308
|
|
|
1326
|
-
|
|
1309
|
+
if (match[0].length === 3) {
|
|
1310
|
+
colorString = colorString.split('').map(char => {
|
|
1311
|
+
return char + char;
|
|
1312
|
+
}).join('');
|
|
1313
|
+
}
|
|
1327
1314
|
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
}
|
|
1315
|
+
const integer = parseInt(colorString, 16);
|
|
1316
|
+
const r = (integer >> 16) & 0xFF;
|
|
1317
|
+
const g = (integer >> 8) & 0xFF;
|
|
1318
|
+
const b = integer & 0xFF;
|
|
1333
1319
|
|
|
1334
|
-
|
|
1335
|
-
const r = integer >> 16 & 0xFF;
|
|
1336
|
-
const g = integer >> 8 & 0xFF;
|
|
1337
|
-
const b = integer & 0xFF;
|
|
1338
|
-
return [r, g, b];
|
|
1320
|
+
return [r, g, b];
|
|
1339
1321
|
};
|
|
1340
1322
|
|
|
1341
1323
|
convert$1.rgb.hcg = function (rgb) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1324
|
+
const r = rgb[0] / 255;
|
|
1325
|
+
const g = rgb[1] / 255;
|
|
1326
|
+
const b = rgb[2] / 255;
|
|
1327
|
+
const max = Math.max(Math.max(r, g), b);
|
|
1328
|
+
const min = Math.min(Math.min(r, g), b);
|
|
1329
|
+
const chroma = (max - min);
|
|
1330
|
+
let grayscale;
|
|
1331
|
+
let hue;
|
|
1332
|
+
|
|
1333
|
+
if (chroma < 1) {
|
|
1334
|
+
grayscale = min / (1 - chroma);
|
|
1335
|
+
} else {
|
|
1336
|
+
grayscale = 0;
|
|
1337
|
+
}
|
|
1356
1338
|
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1339
|
+
if (chroma <= 0) {
|
|
1340
|
+
hue = 0;
|
|
1341
|
+
} else
|
|
1342
|
+
if (max === r) {
|
|
1343
|
+
hue = ((g - b) / chroma) % 6;
|
|
1344
|
+
} else
|
|
1345
|
+
if (max === g) {
|
|
1346
|
+
hue = 2 + (b - r) / chroma;
|
|
1347
|
+
} else {
|
|
1348
|
+
hue = 4 + (r - g) / chroma;
|
|
1349
|
+
}
|
|
1366
1350
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1351
|
+
hue /= 6;
|
|
1352
|
+
hue %= 1;
|
|
1353
|
+
|
|
1354
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1370
1355
|
};
|
|
1371
1356
|
|
|
1372
1357
|
convert$1.hsl.hcg = function (hsl) {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
|
|
1376
|
-
let f = 0;
|
|
1358
|
+
const s = hsl[1] / 100;
|
|
1359
|
+
const l = hsl[2] / 100;
|
|
1377
1360
|
|
|
1378
|
-
|
|
1379
|
-
f = (l - 0.5 * c) / (1.0 - c);
|
|
1380
|
-
}
|
|
1361
|
+
const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
|
|
1381
1362
|
|
|
1382
|
-
|
|
1363
|
+
let f = 0;
|
|
1364
|
+
if (c < 1.0) {
|
|
1365
|
+
f = (l - 0.5 * c) / (1.0 - c);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
return [hsl[0], c * 100, f * 100];
|
|
1383
1369
|
};
|
|
1384
1370
|
|
|
1385
1371
|
convert$1.hsv.hcg = function (hsv) {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
const c = s * v;
|
|
1389
|
-
let f = 0;
|
|
1372
|
+
const s = hsv[1] / 100;
|
|
1373
|
+
const v = hsv[2] / 100;
|
|
1390
1374
|
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1375
|
+
const c = s * v;
|
|
1376
|
+
let f = 0;
|
|
1394
1377
|
|
|
1395
|
-
|
|
1378
|
+
if (c < 1.0) {
|
|
1379
|
+
f = (v - c) / (1 - c);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
return [hsv[0], c * 100, f * 100];
|
|
1396
1383
|
};
|
|
1397
1384
|
|
|
1398
1385
|
convert$1.hcg.rgb = function (hcg) {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1386
|
+
const h = hcg[0] / 360;
|
|
1387
|
+
const c = hcg[1] / 100;
|
|
1388
|
+
const g = hcg[2] / 100;
|
|
1402
1389
|
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1390
|
+
if (c === 0.0) {
|
|
1391
|
+
return [g * 255, g * 255, g * 255];
|
|
1392
|
+
}
|
|
1406
1393
|
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
pure[1] = 1;
|
|
1430
|
-
pure[2] = v;
|
|
1431
|
-
break;
|
|
1432
|
-
|
|
1433
|
-
case 3:
|
|
1434
|
-
pure[0] = 0;
|
|
1435
|
-
pure[1] = w;
|
|
1436
|
-
pure[2] = 1;
|
|
1437
|
-
break;
|
|
1438
|
-
|
|
1439
|
-
case 4:
|
|
1440
|
-
pure[0] = v;
|
|
1441
|
-
pure[1] = 0;
|
|
1442
|
-
pure[2] = 1;
|
|
1443
|
-
break;
|
|
1444
|
-
|
|
1445
|
-
default:
|
|
1446
|
-
pure[0] = 1;
|
|
1447
|
-
pure[1] = 0;
|
|
1448
|
-
pure[2] = w;
|
|
1449
|
-
}
|
|
1450
|
-
/* eslint-enable max-statements-per-line */
|
|
1394
|
+
const pure = [0, 0, 0];
|
|
1395
|
+
const hi = (h % 1) * 6;
|
|
1396
|
+
const v = hi % 1;
|
|
1397
|
+
const w = 1 - v;
|
|
1398
|
+
let mg = 0;
|
|
1399
|
+
|
|
1400
|
+
/* eslint-disable max-statements-per-line */
|
|
1401
|
+
switch (Math.floor(hi)) {
|
|
1402
|
+
case 0:
|
|
1403
|
+
pure[0] = 1; pure[1] = v; pure[2] = 0; break;
|
|
1404
|
+
case 1:
|
|
1405
|
+
pure[0] = w; pure[1] = 1; pure[2] = 0; break;
|
|
1406
|
+
case 2:
|
|
1407
|
+
pure[0] = 0; pure[1] = 1; pure[2] = v; break;
|
|
1408
|
+
case 3:
|
|
1409
|
+
pure[0] = 0; pure[1] = w; pure[2] = 1; break;
|
|
1410
|
+
case 4:
|
|
1411
|
+
pure[0] = v; pure[1] = 0; pure[2] = 1; break;
|
|
1412
|
+
default:
|
|
1413
|
+
pure[0] = 1; pure[1] = 0; pure[2] = w;
|
|
1414
|
+
}
|
|
1415
|
+
/* eslint-enable max-statements-per-line */
|
|
1451
1416
|
|
|
1417
|
+
mg = (1.0 - c) * g;
|
|
1452
1418
|
|
|
1453
|
-
|
|
1454
|
-
|
|
1419
|
+
return [
|
|
1420
|
+
(c * pure[0] + mg) * 255,
|
|
1421
|
+
(c * pure[1] + mg) * 255,
|
|
1422
|
+
(c * pure[2] + mg) * 255
|
|
1423
|
+
];
|
|
1455
1424
|
};
|
|
1456
1425
|
|
|
1457
1426
|
convert$1.hcg.hsv = function (hcg) {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
const v = c + g * (1.0 - c);
|
|
1461
|
-
let f = 0;
|
|
1427
|
+
const c = hcg[1] / 100;
|
|
1428
|
+
const g = hcg[2] / 100;
|
|
1462
1429
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
}
|
|
1430
|
+
const v = c + g * (1.0 - c);
|
|
1431
|
+
let f = 0;
|
|
1466
1432
|
|
|
1467
|
-
|
|
1433
|
+
if (v > 0.0) {
|
|
1434
|
+
f = c / v;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
return [hcg[0], f * 100, v * 100];
|
|
1468
1438
|
};
|
|
1469
1439
|
|
|
1470
1440
|
convert$1.hcg.hsl = function (hcg) {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1441
|
+
const c = hcg[1] / 100;
|
|
1442
|
+
const g = hcg[2] / 100;
|
|
1443
|
+
|
|
1444
|
+
const l = g * (1.0 - c) + 0.5 * c;
|
|
1445
|
+
let s = 0;
|
|
1446
|
+
|
|
1447
|
+
if (l > 0.0 && l < 0.5) {
|
|
1448
|
+
s = c / (2 * l);
|
|
1449
|
+
} else
|
|
1450
|
+
if (l >= 0.5 && l < 1.0) {
|
|
1451
|
+
s = c / (2 * (1 - l));
|
|
1452
|
+
}
|
|
1481
1453
|
|
|
1482
|
-
|
|
1454
|
+
return [hcg[0], s * 100, l * 100];
|
|
1483
1455
|
};
|
|
1484
1456
|
|
|
1485
1457
|
convert$1.hcg.hwb = function (hcg) {
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1458
|
+
const c = hcg[1] / 100;
|
|
1459
|
+
const g = hcg[2] / 100;
|
|
1460
|
+
const v = c + g * (1.0 - c);
|
|
1461
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
1490
1462
|
};
|
|
1491
1463
|
|
|
1492
1464
|
convert$1.hwb.hcg = function (hwb) {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1465
|
+
const w = hwb[1] / 100;
|
|
1466
|
+
const b = hwb[2] / 100;
|
|
1467
|
+
const v = 1 - b;
|
|
1468
|
+
const c = v - w;
|
|
1469
|
+
let g = 0;
|
|
1470
|
+
|
|
1471
|
+
if (c < 1) {
|
|
1472
|
+
g = (v - c) / (1 - c);
|
|
1473
|
+
}
|
|
1502
1474
|
|
|
1503
|
-
|
|
1475
|
+
return [hwb[0], c * 100, g * 100];
|
|
1504
1476
|
};
|
|
1505
1477
|
|
|
1506
1478
|
convert$1.apple.rgb = function (apple) {
|
|
1507
|
-
|
|
1479
|
+
return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
|
|
1508
1480
|
};
|
|
1509
1481
|
|
|
1510
1482
|
convert$1.rgb.apple = function (rgb) {
|
|
1511
|
-
|
|
1483
|
+
return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
|
|
1512
1484
|
};
|
|
1513
1485
|
|
|
1514
1486
|
convert$1.gray.rgb = function (args) {
|
|
1515
|
-
|
|
1487
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
1516
1488
|
};
|
|
1517
1489
|
|
|
1518
1490
|
convert$1.gray.hsl = function (args) {
|
|
1519
|
-
|
|
1491
|
+
return [0, 0, args[0]];
|
|
1520
1492
|
};
|
|
1521
1493
|
|
|
1522
1494
|
convert$1.gray.hsv = convert$1.gray.hsl;
|
|
1523
1495
|
|
|
1524
1496
|
convert$1.gray.hwb = function (gray) {
|
|
1525
|
-
|
|
1497
|
+
return [0, 100, gray[0]];
|
|
1526
1498
|
};
|
|
1527
1499
|
|
|
1528
1500
|
convert$1.gray.cmyk = function (gray) {
|
|
1529
|
-
|
|
1501
|
+
return [0, 0, 0, gray[0]];
|
|
1530
1502
|
};
|
|
1531
1503
|
|
|
1532
1504
|
convert$1.gray.lab = function (gray) {
|
|
1533
|
-
|
|
1505
|
+
return [gray[0], 0, 0];
|
|
1534
1506
|
};
|
|
1535
1507
|
|
|
1536
1508
|
convert$1.gray.hex = function (gray) {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1509
|
+
const val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
|
1510
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
1511
|
+
|
|
1512
|
+
const string = integer.toString(16).toUpperCase();
|
|
1513
|
+
return '000000'.substring(string.length) + string;
|
|
1541
1514
|
};
|
|
1542
1515
|
|
|
1543
1516
|
convert$1.rgb.gray = function (rgb) {
|
|
1544
|
-
|
|
1545
|
-
|
|
1517
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
1518
|
+
return [val / 255 * 100];
|
|
1546
1519
|
};
|
|
1547
1520
|
|
|
1548
1521
|
/*
|
|
@@ -1557,639 +1530,658 @@ convert$1.rgb.gray = function (rgb) {
|
|
|
1557
1530
|
*/
|
|
1558
1531
|
|
|
1559
1532
|
function buildGraph() {
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
return graph;
|
|
1574
|
-
} // https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1533
|
+
const graph = {};
|
|
1534
|
+
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
1535
|
+
const models = Object.keys(conversions);
|
|
1536
|
+
|
|
1537
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1538
|
+
graph[models[i]] = {
|
|
1539
|
+
// http://jsperf.com/1-vs-infinity
|
|
1540
|
+
// micro-opt, but this is simple.
|
|
1541
|
+
distance: -1,
|
|
1542
|
+
parent: null
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1575
1545
|
|
|
1546
|
+
return graph;
|
|
1547
|
+
}
|
|
1576
1548
|
|
|
1549
|
+
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1577
1550
|
function deriveBFS(fromModel) {
|
|
1578
|
-
|
|
1579
|
-
|
|
1551
|
+
const graph = buildGraph();
|
|
1552
|
+
const queue = [fromModel]; // Unshift -> queue -> pop
|
|
1580
1553
|
|
|
1581
|
-
|
|
1554
|
+
graph[fromModel].distance = 0;
|
|
1582
1555
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1556
|
+
while (queue.length) {
|
|
1557
|
+
const current = queue.pop();
|
|
1558
|
+
const adjacents = Object.keys(conversions[current]);
|
|
1586
1559
|
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1560
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1561
|
+
const adjacent = adjacents[i];
|
|
1562
|
+
const node = graph[adjacent];
|
|
1590
1563
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1564
|
+
if (node.distance === -1) {
|
|
1565
|
+
node.distance = graph[current].distance + 1;
|
|
1566
|
+
node.parent = current;
|
|
1567
|
+
queue.unshift(adjacent);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1598
1571
|
|
|
1599
|
-
|
|
1572
|
+
return graph;
|
|
1600
1573
|
}
|
|
1601
1574
|
|
|
1602
1575
|
function link(from, to) {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1576
|
+
return function (args) {
|
|
1577
|
+
return to(from(args));
|
|
1578
|
+
};
|
|
1606
1579
|
}
|
|
1607
1580
|
|
|
1608
1581
|
function wrapConversion(toModel, graph) {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1582
|
+
const path = [graph[toModel].parent, toModel];
|
|
1583
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
1584
|
+
|
|
1585
|
+
let cur = graph[toModel].parent;
|
|
1586
|
+
while (graph[cur].parent) {
|
|
1587
|
+
path.unshift(graph[cur].parent);
|
|
1588
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1589
|
+
cur = graph[cur].parent;
|
|
1590
|
+
}
|
|
1618
1591
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1592
|
+
fn.conversion = path;
|
|
1593
|
+
return fn;
|
|
1621
1594
|
}
|
|
1622
1595
|
|
|
1623
1596
|
var route = function (fromModel) {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
const models = Object.keys(graph);
|
|
1597
|
+
const graph = deriveBFS(fromModel);
|
|
1598
|
+
const conversion = {};
|
|
1627
1599
|
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1600
|
+
const models = Object.keys(graph);
|
|
1601
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1602
|
+
const toModel = models[i];
|
|
1603
|
+
const node = graph[toModel];
|
|
1631
1604
|
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1605
|
+
if (node.parent === null) {
|
|
1606
|
+
// No possible conversion, or this node is the source model.
|
|
1607
|
+
continue;
|
|
1608
|
+
}
|
|
1636
1609
|
|
|
1637
|
-
|
|
1638
|
-
|
|
1610
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1611
|
+
}
|
|
1639
1612
|
|
|
1640
|
-
|
|
1613
|
+
return conversion;
|
|
1641
1614
|
};
|
|
1642
1615
|
|
|
1643
1616
|
const convert = {};
|
|
1617
|
+
|
|
1644
1618
|
const models = Object.keys(conversions);
|
|
1645
1619
|
|
|
1646
1620
|
function wrapRaw(fn) {
|
|
1647
|
-
|
|
1648
|
-
|
|
1621
|
+
const wrappedFn = function (...args) {
|
|
1622
|
+
const arg0 = args[0];
|
|
1623
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1624
|
+
return arg0;
|
|
1625
|
+
}
|
|
1649
1626
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1627
|
+
if (arg0.length > 1) {
|
|
1628
|
+
args = arg0;
|
|
1629
|
+
}
|
|
1653
1630
|
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}
|
|
1631
|
+
return fn(args);
|
|
1632
|
+
};
|
|
1657
1633
|
|
|
1658
|
-
|
|
1659
|
-
|
|
1634
|
+
// Preserve .conversion property if there is one
|
|
1635
|
+
if ('conversion' in fn) {
|
|
1636
|
+
wrappedFn.conversion = fn.conversion;
|
|
1637
|
+
}
|
|
1660
1638
|
|
|
1639
|
+
return wrappedFn;
|
|
1640
|
+
}
|
|
1661
1641
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1642
|
+
function wrapRounded(fn) {
|
|
1643
|
+
const wrappedFn = function (...args) {
|
|
1644
|
+
const arg0 = args[0];
|
|
1645
|
+
|
|
1646
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1647
|
+
return arg0;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
if (arg0.length > 1) {
|
|
1651
|
+
args = arg0;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
const result = fn(args);
|
|
1655
|
+
|
|
1656
|
+
// We're assuming the result is an array here.
|
|
1657
|
+
// see notice in conversions.js; don't use box types
|
|
1658
|
+
// in conversion functions.
|
|
1659
|
+
if (typeof result === 'object') {
|
|
1660
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
1661
|
+
result[i] = Math.round(result[i]);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
return result;
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
// Preserve .conversion property if there is one
|
|
1669
|
+
if ('conversion' in fn) {
|
|
1670
|
+
wrappedFn.conversion = fn.conversion;
|
|
1671
|
+
}
|
|
1665
1672
|
|
|
1666
|
-
|
|
1673
|
+
return wrappedFn;
|
|
1667
1674
|
}
|
|
1668
1675
|
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
const arg0 = args[0];
|
|
1672
|
-
|
|
1673
|
-
if (arg0 === undefined || arg0 === null) {
|
|
1674
|
-
return arg0;
|
|
1675
|
-
}
|
|
1676
|
+
models.forEach(fromModel => {
|
|
1677
|
+
convert[fromModel] = {};
|
|
1676
1678
|
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
}
|
|
1679
|
+
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
|
1680
|
+
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
|
1680
1681
|
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
// in conversion functions.
|
|
1682
|
+
const routes = route(fromModel);
|
|
1683
|
+
const routeModels = Object.keys(routes);
|
|
1684
1684
|
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
result[i] = Math.round(result[i]);
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1685
|
+
routeModels.forEach(toModel => {
|
|
1686
|
+
const fn = routes[toModel];
|
|
1690
1687
|
|
|
1691
|
-
|
|
1692
|
-
|
|
1688
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1689
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1690
|
+
});
|
|
1691
|
+
});
|
|
1693
1692
|
|
|
1693
|
+
var colorConvert = convert;
|
|
1694
1694
|
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1695
|
+
const skippedModels = [
|
|
1696
|
+
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
1697
|
+
'keyword',
|
|
1698
1698
|
|
|
1699
|
-
|
|
1700
|
-
|
|
1699
|
+
// Gray conflicts with some method names, and has its own method defined.
|
|
1700
|
+
'gray',
|
|
1701
1701
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
value: conversions[fromModel].channels
|
|
1706
|
-
});
|
|
1707
|
-
Object.defineProperty(convert[fromModel], 'labels', {
|
|
1708
|
-
value: conversions[fromModel].labels
|
|
1709
|
-
});
|
|
1710
|
-
const routes = route(fromModel);
|
|
1711
|
-
const routeModels = Object.keys(routes);
|
|
1712
|
-
routeModels.forEach(toModel => {
|
|
1713
|
-
const fn = routes[toModel];
|
|
1714
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1715
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1716
|
-
});
|
|
1717
|
-
});
|
|
1718
|
-
var colorConvert = convert;
|
|
1702
|
+
// Shouldn't really be in color-convert either...
|
|
1703
|
+
'hex',
|
|
1704
|
+
];
|
|
1719
1705
|
|
|
1720
|
-
const _slice = [].slice;
|
|
1721
|
-
const skippedModels = [// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
1722
|
-
'keyword', // Gray conflicts with some method names, and has its own method defined.
|
|
1723
|
-
'gray', // Shouldn't really be in color-convert either...
|
|
1724
|
-
'hex'];
|
|
1725
1706
|
const hashedModelKeys = {};
|
|
1726
|
-
|
|
1727
1707
|
for (const model of Object.keys(colorConvert)) {
|
|
1728
|
-
|
|
1708
|
+
hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
|
|
1729
1709
|
}
|
|
1730
1710
|
|
|
1731
1711
|
const limiters = {};
|
|
1732
1712
|
|
|
1733
1713
|
function Color(object, model) {
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
if (model && model in skippedModels) {
|
|
1739
|
-
model = null;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
if (model && !(model in colorConvert)) {
|
|
1743
|
-
throw new Error('Unknown model: ' + model);
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
let i;
|
|
1747
|
-
let channels;
|
|
1748
|
-
|
|
1749
|
-
if (object == null) {
|
|
1750
|
-
// eslint-disable-line no-eq-null,eqeqeq
|
|
1751
|
-
this.model = 'rgb';
|
|
1752
|
-
this.color = [0, 0, 0];
|
|
1753
|
-
this.valpha = 1;
|
|
1754
|
-
} else if (object instanceof Color) {
|
|
1755
|
-
this.model = object.model;
|
|
1756
|
-
this.color = object.color.slice();
|
|
1757
|
-
this.valpha = object.valpha;
|
|
1758
|
-
} else if (typeof object === 'string') {
|
|
1759
|
-
const result = colorString.get(object);
|
|
1760
|
-
|
|
1761
|
-
if (result === null) {
|
|
1762
|
-
throw new Error('Unable to parse color from string: ' + object);
|
|
1763
|
-
}
|
|
1714
|
+
if (!(this instanceof Color)) {
|
|
1715
|
+
return new Color(object, model);
|
|
1716
|
+
}
|
|
1764
1717
|
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
|
|
1769
|
-
} else if (object.length > 0) {
|
|
1770
|
-
this.model = model || 'rgb';
|
|
1771
|
-
channels = colorConvert[this.model].channels;
|
|
1772
|
-
|
|
1773
|
-
const newArray = _slice.call(object, 0, channels);
|
|
1774
|
-
|
|
1775
|
-
this.color = zeroArray(newArray, channels);
|
|
1776
|
-
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
|
|
1777
|
-
} else if (typeof object === 'number') {
|
|
1778
|
-
// This is always RGB - can be converted later on.
|
|
1779
|
-
this.model = 'rgb';
|
|
1780
|
-
this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
|
|
1781
|
-
this.valpha = 1;
|
|
1782
|
-
} else {
|
|
1783
|
-
this.valpha = 1;
|
|
1784
|
-
const keys = Object.keys(object);
|
|
1785
|
-
|
|
1786
|
-
if ('alpha' in object) {
|
|
1787
|
-
keys.splice(keys.indexOf('alpha'), 1);
|
|
1788
|
-
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
|
|
1789
|
-
}
|
|
1718
|
+
if (model && model in skippedModels) {
|
|
1719
|
+
model = null;
|
|
1720
|
+
}
|
|
1790
1721
|
|
|
1791
|
-
|
|
1722
|
+
if (model && !(model in colorConvert)) {
|
|
1723
|
+
throw new Error('Unknown model: ' + model);
|
|
1724
|
+
}
|
|
1792
1725
|
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1726
|
+
let i;
|
|
1727
|
+
let channels;
|
|
1728
|
+
|
|
1729
|
+
if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
|
|
1730
|
+
this.model = 'rgb';
|
|
1731
|
+
this.color = [0, 0, 0];
|
|
1732
|
+
this.valpha = 1;
|
|
1733
|
+
} else if (object instanceof Color) {
|
|
1734
|
+
this.model = object.model;
|
|
1735
|
+
this.color = [...object.color];
|
|
1736
|
+
this.valpha = object.valpha;
|
|
1737
|
+
} else if (typeof object === 'string') {
|
|
1738
|
+
const result = colorString.get(object);
|
|
1739
|
+
if (result === null) {
|
|
1740
|
+
throw new Error('Unable to parse color from string: ' + object);
|
|
1741
|
+
}
|
|
1796
1742
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1743
|
+
this.model = result.model;
|
|
1744
|
+
channels = colorConvert[this.model].channels;
|
|
1745
|
+
this.color = result.value.slice(0, channels);
|
|
1746
|
+
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
|
|
1747
|
+
} else if (object.length > 0) {
|
|
1748
|
+
this.model = model || 'rgb';
|
|
1749
|
+
channels = colorConvert[this.model].channels;
|
|
1750
|
+
const newArray = Array.prototype.slice.call(object, 0, channels);
|
|
1751
|
+
this.color = zeroArray(newArray, channels);
|
|
1752
|
+
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
|
|
1753
|
+
} else if (typeof object === 'number') {
|
|
1754
|
+
// This is always RGB - can be converted later on.
|
|
1755
|
+
this.model = 'rgb';
|
|
1756
|
+
this.color = [
|
|
1757
|
+
(object >> 16) & 0xFF,
|
|
1758
|
+
(object >> 8) & 0xFF,
|
|
1759
|
+
object & 0xFF,
|
|
1760
|
+
];
|
|
1761
|
+
this.valpha = 1;
|
|
1762
|
+
} else {
|
|
1763
|
+
this.valpha = 1;
|
|
1800
1764
|
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1765
|
+
const keys = Object.keys(object);
|
|
1766
|
+
if ('alpha' in object) {
|
|
1767
|
+
keys.splice(keys.indexOf('alpha'), 1);
|
|
1768
|
+
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
|
|
1769
|
+
}
|
|
1804
1770
|
|
|
1805
|
-
|
|
1806
|
-
|
|
1771
|
+
const hashedKeys = keys.sort().join('');
|
|
1772
|
+
if (!(hashedKeys in hashedModelKeys)) {
|
|
1773
|
+
throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
|
|
1774
|
+
}
|
|
1807
1775
|
|
|
1776
|
+
this.model = hashedModelKeys[hashedKeys];
|
|
1808
1777
|
|
|
1809
|
-
|
|
1810
|
-
|
|
1778
|
+
const {labels} = colorConvert[this.model];
|
|
1779
|
+
const color = [];
|
|
1780
|
+
for (i = 0; i < labels.length; i++) {
|
|
1781
|
+
color.push(object[labels[i]]);
|
|
1782
|
+
}
|
|
1811
1783
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1784
|
+
this.color = zeroArray(color);
|
|
1785
|
+
}
|
|
1814
1786
|
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1787
|
+
// Perform limitations (clamping, etc.)
|
|
1788
|
+
if (limiters[this.model]) {
|
|
1789
|
+
channels = colorConvert[this.model].channels;
|
|
1790
|
+
for (i = 0; i < channels; i++) {
|
|
1791
|
+
const limit = limiters[this.model][i];
|
|
1792
|
+
if (limit) {
|
|
1793
|
+
this.color[i] = limit(this.color[i]);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1820
1797
|
|
|
1821
|
-
|
|
1798
|
+
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
1822
1799
|
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1800
|
+
if (Object.freeze) {
|
|
1801
|
+
Object.freeze(this);
|
|
1802
|
+
}
|
|
1826
1803
|
}
|
|
1827
1804
|
|
|
1828
1805
|
Color.prototype = {
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
if (this.valpha !== 1) {
|
|
1864
|
-
result.alpha = this.valpha;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
return result;
|
|
1868
|
-
},
|
|
1806
|
+
toString() {
|
|
1807
|
+
return this.string();
|
|
1808
|
+
},
|
|
1809
|
+
|
|
1810
|
+
toJSON() {
|
|
1811
|
+
return this[this.model]();
|
|
1812
|
+
},
|
|
1813
|
+
|
|
1814
|
+
string(places) {
|
|
1815
|
+
let self = this.model in colorString.to ? this : this.rgb();
|
|
1816
|
+
self = self.round(typeof places === 'number' ? places : 1);
|
|
1817
|
+
const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
|
|
1818
|
+
return colorString.to[self.model](args);
|
|
1819
|
+
},
|
|
1820
|
+
|
|
1821
|
+
percentString(places) {
|
|
1822
|
+
const self = this.rgb().round(typeof places === 'number' ? places : 1);
|
|
1823
|
+
const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
|
|
1824
|
+
return colorString.to.rgb.percent(args);
|
|
1825
|
+
},
|
|
1826
|
+
|
|
1827
|
+
array() {
|
|
1828
|
+
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
1829
|
+
},
|
|
1830
|
+
|
|
1831
|
+
object() {
|
|
1832
|
+
const result = {};
|
|
1833
|
+
const {channels} = colorConvert[this.model];
|
|
1834
|
+
const {labels} = colorConvert[this.model];
|
|
1835
|
+
|
|
1836
|
+
for (let i = 0; i < channels; i++) {
|
|
1837
|
+
result[labels[i]] = this.color[i];
|
|
1838
|
+
}
|
|
1869
1839
|
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
rgb[1] /= 255;
|
|
1874
|
-
rgb[2] /= 255;
|
|
1840
|
+
if (this.valpha !== 1) {
|
|
1841
|
+
result.alpha = this.valpha;
|
|
1842
|
+
}
|
|
1875
1843
|
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
}
|
|
1844
|
+
return result;
|
|
1845
|
+
},
|
|
1879
1846
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1847
|
+
unitArray() {
|
|
1848
|
+
const rgb = this.rgb().color;
|
|
1849
|
+
rgb[0] /= 255;
|
|
1850
|
+
rgb[1] /= 255;
|
|
1851
|
+
rgb[2] /= 255;
|
|
1882
1852
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
rgb.g /= 255;
|
|
1887
|
-
rgb.b /= 255;
|
|
1853
|
+
if (this.valpha !== 1) {
|
|
1854
|
+
rgb.push(this.valpha);
|
|
1855
|
+
}
|
|
1888
1856
|
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
}
|
|
1857
|
+
return rgb;
|
|
1858
|
+
},
|
|
1892
1859
|
|
|
1893
|
-
|
|
1894
|
-
|
|
1860
|
+
unitObject() {
|
|
1861
|
+
const rgb = this.rgb().object();
|
|
1862
|
+
rgb.r /= 255;
|
|
1863
|
+
rgb.g /= 255;
|
|
1864
|
+
rgb.b /= 255;
|
|
1895
1865
|
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
},
|
|
1866
|
+
if (this.valpha !== 1) {
|
|
1867
|
+
rgb.alpha = this.valpha;
|
|
1868
|
+
}
|
|
1900
1869
|
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
return new Color(this.color.concat(Math.max(0, Math.min(1, value))), this.model);
|
|
1904
|
-
}
|
|
1870
|
+
return rgb;
|
|
1871
|
+
},
|
|
1905
1872
|
|
|
1906
|
-
|
|
1907
|
-
|
|
1873
|
+
round(places) {
|
|
1874
|
+
places = Math.max(places || 0, 0);
|
|
1875
|
+
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
|
|
1876
|
+
},
|
|
1908
1877
|
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
|
|
1914
|
-
saturationl: getset('hsl', 1, maxfn(100)),
|
|
1915
|
-
lightness: getset('hsl', 2, maxfn(100)),
|
|
1916
|
-
saturationv: getset('hsv', 1, maxfn(100)),
|
|
1917
|
-
value: getset('hsv', 2, maxfn(100)),
|
|
1918
|
-
chroma: getset('hcg', 1, maxfn(100)),
|
|
1919
|
-
gray: getset('hcg', 2, maxfn(100)),
|
|
1920
|
-
white: getset('hwb', 1, maxfn(100)),
|
|
1921
|
-
wblack: getset('hwb', 2, maxfn(100)),
|
|
1922
|
-
cyan: getset('cmyk', 0, maxfn(100)),
|
|
1923
|
-
magenta: getset('cmyk', 1, maxfn(100)),
|
|
1924
|
-
yellow: getset('cmyk', 2, maxfn(100)),
|
|
1925
|
-
black: getset('cmyk', 3, maxfn(100)),
|
|
1926
|
-
x: getset('xyz', 0, maxfn(100)),
|
|
1927
|
-
y: getset('xyz', 1, maxfn(100)),
|
|
1928
|
-
z: getset('xyz', 2, maxfn(100)),
|
|
1929
|
-
l: getset('lab', 0, maxfn(100)),
|
|
1930
|
-
a: getset('lab', 1),
|
|
1931
|
-
b: getset('lab', 2),
|
|
1932
|
-
|
|
1933
|
-
keyword(value) {
|
|
1934
|
-
if (arguments.length > 0) {
|
|
1935
|
-
return new Color(value);
|
|
1936
|
-
}
|
|
1878
|
+
alpha(value) {
|
|
1879
|
+
if (value !== undefined) {
|
|
1880
|
+
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
1881
|
+
}
|
|
1937
1882
|
|
|
1938
|
-
|
|
1939
|
-
|
|
1883
|
+
return this.valpha;
|
|
1884
|
+
},
|
|
1940
1885
|
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1886
|
+
// Rgb
|
|
1887
|
+
red: getset('rgb', 0, maxfn(255)),
|
|
1888
|
+
green: getset('rgb', 1, maxfn(255)),
|
|
1889
|
+
blue: getset('rgb', 2, maxfn(255)),
|
|
1945
1890
|
|
|
1946
|
-
|
|
1947
|
-
},
|
|
1891
|
+
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
|
|
1948
1892
|
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
return new Color(value);
|
|
1952
|
-
}
|
|
1893
|
+
saturationl: getset('hsl', 1, maxfn(100)),
|
|
1894
|
+
lightness: getset('hsl', 2, maxfn(100)),
|
|
1953
1895
|
|
|
1954
|
-
|
|
1955
|
-
|
|
1896
|
+
saturationv: getset('hsv', 1, maxfn(100)),
|
|
1897
|
+
value: getset('hsv', 2, maxfn(100)),
|
|
1956
1898
|
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}
|
|
1899
|
+
chroma: getset('hcg', 1, maxfn(100)),
|
|
1900
|
+
gray: getset('hcg', 2, maxfn(100)),
|
|
1960
1901
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1902
|
+
white: getset('hwb', 1, maxfn(100)),
|
|
1903
|
+
wblack: getset('hwb', 2, maxfn(100)),
|
|
1963
1904
|
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1905
|
+
cyan: getset('cmyk', 0, maxfn(100)),
|
|
1906
|
+
magenta: getset('cmyk', 1, maxfn(100)),
|
|
1907
|
+
yellow: getset('cmyk', 2, maxfn(100)),
|
|
1908
|
+
black: getset('cmyk', 3, maxfn(100)),
|
|
1968
1909
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
const lum = [];
|
|
1910
|
+
x: getset('xyz', 0, maxfn(95.047)),
|
|
1911
|
+
y: getset('xyz', 1, maxfn(100)),
|
|
1912
|
+
z: getset('xyz', 2, maxfn(108.833)),
|
|
1973
1913
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
}
|
|
1914
|
+
l: getset('lab', 0, maxfn(100)),
|
|
1915
|
+
a: getset('lab', 1),
|
|
1916
|
+
b: getset('lab', 2),
|
|
1978
1917
|
|
|
1979
|
-
|
|
1980
|
-
|
|
1918
|
+
keyword(value) {
|
|
1919
|
+
if (value !== undefined) {
|
|
1920
|
+
return new Color(value);
|
|
1921
|
+
}
|
|
1981
1922
|
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
const lum1 = this.luminosity();
|
|
1985
|
-
const lum2 = color2.luminosity();
|
|
1923
|
+
return colorConvert[this.model].keyword(this.color);
|
|
1924
|
+
},
|
|
1986
1925
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1926
|
+
hex(value) {
|
|
1927
|
+
if (value !== undefined) {
|
|
1928
|
+
return new Color(value);
|
|
1929
|
+
}
|
|
1990
1930
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1931
|
+
return colorString.to.hex(this.rgb().round().color);
|
|
1932
|
+
},
|
|
1993
1933
|
|
|
1994
|
-
|
|
1995
|
-
|
|
1934
|
+
hexa(value) {
|
|
1935
|
+
if (value !== undefined) {
|
|
1936
|
+
return new Color(value);
|
|
1937
|
+
}
|
|
1996
1938
|
|
|
1997
|
-
|
|
1998
|
-
return 'AAA';
|
|
1999
|
-
}
|
|
1939
|
+
const rgbArray = this.rgb().round().color;
|
|
2000
1940
|
|
|
2001
|
-
|
|
2002
|
-
|
|
1941
|
+
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
1942
|
+
if (alphaHex.length === 1) {
|
|
1943
|
+
alphaHex = '0' + alphaHex;
|
|
1944
|
+
}
|
|
2003
1945
|
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
const rgb = this.rgb().color;
|
|
2007
|
-
const yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
|
|
2008
|
-
return yiq < 128;
|
|
2009
|
-
},
|
|
1946
|
+
return colorString.to.hex(rgbArray) + alphaHex;
|
|
1947
|
+
},
|
|
2010
1948
|
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
1949
|
+
rgbNumber() {
|
|
1950
|
+
const rgb = this.rgb().color;
|
|
1951
|
+
return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
|
|
1952
|
+
},
|
|
2014
1953
|
|
|
2015
|
-
|
|
2016
|
-
|
|
1954
|
+
luminosity() {
|
|
1955
|
+
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
1956
|
+
const rgb = this.rgb().color;
|
|
2017
1957
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
1958
|
+
const lum = [];
|
|
1959
|
+
for (const [i, element] of rgb.entries()) {
|
|
1960
|
+
const chan = element / 255;
|
|
1961
|
+
lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
|
|
1962
|
+
}
|
|
2021
1963
|
|
|
2022
|
-
|
|
2023
|
-
|
|
1964
|
+
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
1965
|
+
},
|
|
2024
1966
|
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
},
|
|
1967
|
+
contrast(color2) {
|
|
1968
|
+
// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
1969
|
+
const lum1 = this.luminosity();
|
|
1970
|
+
const lum2 = color2.luminosity();
|
|
2030
1971
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
return hsl;
|
|
2035
|
-
},
|
|
1972
|
+
if (lum1 > lum2) {
|
|
1973
|
+
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
1974
|
+
}
|
|
2036
1975
|
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
hsl.color[1] += hsl.color[1] * ratio;
|
|
2040
|
-
return hsl;
|
|
2041
|
-
},
|
|
1976
|
+
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
1977
|
+
},
|
|
2042
1978
|
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
1979
|
+
level(color2) {
|
|
1980
|
+
// https://www.w3.org/TR/WCAG/#contrast-enhanced
|
|
1981
|
+
const contrastRatio = this.contrast(color2);
|
|
1982
|
+
if (contrastRatio >= 7) {
|
|
1983
|
+
return 'AAA';
|
|
1984
|
+
}
|
|
2048
1985
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
hwb.color[1] += hwb.color[1] * ratio;
|
|
2052
|
-
return hwb;
|
|
2053
|
-
},
|
|
1986
|
+
return (contrastRatio >= 4.5) ? 'AA' : '';
|
|
1987
|
+
},
|
|
2054
1988
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
1989
|
+
isDark() {
|
|
1990
|
+
// YIQ equation from http://24ways.org/2010/calculating-color-contrast
|
|
1991
|
+
const rgb = this.rgb().color;
|
|
1992
|
+
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
|
|
1993
|
+
return yiq < 128;
|
|
1994
|
+
},
|
|
2060
1995
|
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
2065
|
-
return Color.rgb(value, value, value);
|
|
2066
|
-
},
|
|
1996
|
+
isLight() {
|
|
1997
|
+
return !this.isDark();
|
|
1998
|
+
},
|
|
2067
1999
|
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2000
|
+
negate() {
|
|
2001
|
+
const rgb = this.rgb();
|
|
2002
|
+
for (let i = 0; i < 3; i++) {
|
|
2003
|
+
rgb.color[i] = 255 - rgb.color[i];
|
|
2004
|
+
}
|
|
2071
2005
|
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2006
|
+
return rgb;
|
|
2007
|
+
},
|
|
2008
|
+
|
|
2009
|
+
lighten(ratio) {
|
|
2010
|
+
const hsl = this.hsl();
|
|
2011
|
+
hsl.color[2] += hsl.color[2] * ratio;
|
|
2012
|
+
return hsl;
|
|
2013
|
+
},
|
|
2014
|
+
|
|
2015
|
+
darken(ratio) {
|
|
2016
|
+
const hsl = this.hsl();
|
|
2017
|
+
hsl.color[2] -= hsl.color[2] * ratio;
|
|
2018
|
+
return hsl;
|
|
2019
|
+
},
|
|
2020
|
+
|
|
2021
|
+
saturate(ratio) {
|
|
2022
|
+
const hsl = this.hsl();
|
|
2023
|
+
hsl.color[1] += hsl.color[1] * ratio;
|
|
2024
|
+
return hsl;
|
|
2025
|
+
},
|
|
2026
|
+
|
|
2027
|
+
desaturate(ratio) {
|
|
2028
|
+
const hsl = this.hsl();
|
|
2029
|
+
hsl.color[1] -= hsl.color[1] * ratio;
|
|
2030
|
+
return hsl;
|
|
2031
|
+
},
|
|
2032
|
+
|
|
2033
|
+
whiten(ratio) {
|
|
2034
|
+
const hwb = this.hwb();
|
|
2035
|
+
hwb.color[1] += hwb.color[1] * ratio;
|
|
2036
|
+
return hwb;
|
|
2037
|
+
},
|
|
2038
|
+
|
|
2039
|
+
blacken(ratio) {
|
|
2040
|
+
const hwb = this.hwb();
|
|
2041
|
+
hwb.color[2] += hwb.color[2] * ratio;
|
|
2042
|
+
return hwb;
|
|
2043
|
+
},
|
|
2044
|
+
|
|
2045
|
+
grayscale() {
|
|
2046
|
+
// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
|
|
2047
|
+
const rgb = this.rgb().color;
|
|
2048
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
2049
|
+
return Color.rgb(value, value, value);
|
|
2050
|
+
},
|
|
2051
|
+
|
|
2052
|
+
fade(ratio) {
|
|
2053
|
+
return this.alpha(this.valpha - (this.valpha * ratio));
|
|
2054
|
+
},
|
|
2055
|
+
|
|
2056
|
+
opaquer(ratio) {
|
|
2057
|
+
return this.alpha(this.valpha + (this.valpha * ratio));
|
|
2058
|
+
},
|
|
2059
|
+
|
|
2060
|
+
rotate(degrees) {
|
|
2061
|
+
const hsl = this.hsl();
|
|
2062
|
+
let hue = hsl.color[0];
|
|
2063
|
+
hue = (hue + degrees) % 360;
|
|
2064
|
+
hue = hue < 0 ? 360 + hue : hue;
|
|
2065
|
+
hsl.color[0] = hue;
|
|
2066
|
+
return hsl;
|
|
2067
|
+
},
|
|
2068
|
+
|
|
2069
|
+
mix(mixinColor, weight) {
|
|
2070
|
+
// Ported from sass implementation in C
|
|
2071
|
+
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
|
|
2072
|
+
if (!mixinColor || !mixinColor.rgb) {
|
|
2073
|
+
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
2074
|
+
}
|
|
2075
2075
|
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
hue = (hue + degrees) % 360;
|
|
2080
|
-
hue = hue < 0 ? 360 + hue : hue;
|
|
2081
|
-
hsl.color[0] = hue;
|
|
2082
|
-
return hsl;
|
|
2083
|
-
},
|
|
2076
|
+
const color1 = mixinColor.rgb();
|
|
2077
|
+
const color2 = this.rgb();
|
|
2078
|
+
const p = weight === undefined ? 0.5 : weight;
|
|
2084
2079
|
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
|
|
2088
|
-
if (!mixinColor || !mixinColor.rgb) {
|
|
2089
|
-
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
2090
|
-
}
|
|
2080
|
+
const w = 2 * p - 1;
|
|
2081
|
+
const a = color1.alpha() - color2.alpha();
|
|
2091
2082
|
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
const p = weight === undefined ? 0.5 : weight;
|
|
2095
|
-
const w = 2 * p - 1;
|
|
2096
|
-
const a = color1.alpha() - color2.alpha();
|
|
2097
|
-
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
2098
|
-
const w2 = 1 - w1;
|
|
2099
|
-
return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
|
|
2100
|
-
}
|
|
2083
|
+
const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
2084
|
+
const w2 = 1 - w1;
|
|
2101
2085
|
|
|
2102
|
-
|
|
2086
|
+
return Color.rgb(
|
|
2087
|
+
w1 * color1.red() + w2 * color2.red(),
|
|
2088
|
+
w1 * color1.green() + w2 * color2.green(),
|
|
2089
|
+
w1 * color1.blue() + w2 * color2.blue(),
|
|
2090
|
+
color1.alpha() * p + color2.alpha() * (1 - p));
|
|
2091
|
+
},
|
|
2092
|
+
};
|
|
2103
2093
|
|
|
2094
|
+
// Model conversion methods and static constructors
|
|
2104
2095
|
for (const model of Object.keys(colorConvert)) {
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
const channels = colorConvert[model].channels; // Conversion methods
|
|
2096
|
+
if (skippedModels.includes(model)) {
|
|
2097
|
+
continue;
|
|
2098
|
+
}
|
|
2110
2099
|
|
|
2111
|
-
|
|
2112
|
-
if (this.model === model) {
|
|
2113
|
-
return new Color(this);
|
|
2114
|
-
}
|
|
2100
|
+
const {channels} = colorConvert[model];
|
|
2115
2101
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2102
|
+
// Conversion methods
|
|
2103
|
+
Color.prototype[model] = function (...args) {
|
|
2104
|
+
if (this.model === model) {
|
|
2105
|
+
return new Color(this);
|
|
2106
|
+
}
|
|
2119
2107
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2108
|
+
if (args.length > 0) {
|
|
2109
|
+
return new Color(args, model);
|
|
2110
|
+
}
|
|
2123
2111
|
|
|
2112
|
+
return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
|
|
2113
|
+
};
|
|
2124
2114
|
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2115
|
+
// 'static' construction methods
|
|
2116
|
+
Color[model] = function (...args) {
|
|
2117
|
+
let color = args[0];
|
|
2118
|
+
if (typeof color === 'number') {
|
|
2119
|
+
color = zeroArray(args, channels);
|
|
2120
|
+
}
|
|
2129
2121
|
|
|
2130
|
-
|
|
2131
|
-
|
|
2122
|
+
return new Color(color, model);
|
|
2123
|
+
};
|
|
2132
2124
|
}
|
|
2133
2125
|
|
|
2134
2126
|
function roundTo(number, places) {
|
|
2135
|
-
|
|
2127
|
+
return Number(number.toFixed(places));
|
|
2136
2128
|
}
|
|
2137
2129
|
|
|
2138
2130
|
function roundToPlace(places) {
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2131
|
+
return function (number) {
|
|
2132
|
+
return roundTo(number, places);
|
|
2133
|
+
};
|
|
2142
2134
|
}
|
|
2143
2135
|
|
|
2144
2136
|
function getset(model, channel, modifier) {
|
|
2145
|
-
|
|
2137
|
+
model = Array.isArray(model) ? model : [model];
|
|
2146
2138
|
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2139
|
+
for (const m of model) {
|
|
2140
|
+
(limiters[m] || (limiters[m] = []))[channel] = modifier;
|
|
2141
|
+
}
|
|
2150
2142
|
|
|
2151
|
-
|
|
2152
|
-
return function (value) {
|
|
2153
|
-
let result;
|
|
2143
|
+
model = model[0];
|
|
2154
2144
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
value = modifier(value);
|
|
2158
|
-
}
|
|
2145
|
+
return function (value) {
|
|
2146
|
+
let result;
|
|
2159
2147
|
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2148
|
+
if (value !== undefined) {
|
|
2149
|
+
if (modifier) {
|
|
2150
|
+
value = modifier(value);
|
|
2151
|
+
}
|
|
2164
2152
|
|
|
2165
|
-
|
|
2153
|
+
result = this[model]();
|
|
2154
|
+
result.color[channel] = value;
|
|
2155
|
+
return result;
|
|
2156
|
+
}
|
|
2166
2157
|
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2158
|
+
result = this[model]().color[channel];
|
|
2159
|
+
if (modifier) {
|
|
2160
|
+
result = modifier(result);
|
|
2161
|
+
}
|
|
2170
2162
|
|
|
2171
|
-
|
|
2172
|
-
|
|
2163
|
+
return result;
|
|
2164
|
+
};
|
|
2173
2165
|
}
|
|
2174
2166
|
|
|
2175
2167
|
function maxfn(max) {
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2168
|
+
return function (v) {
|
|
2169
|
+
return Math.max(0, Math.min(max, v));
|
|
2170
|
+
};
|
|
2179
2171
|
}
|
|
2180
2172
|
|
|
2181
2173
|
function assertArray(value) {
|
|
2182
|
-
|
|
2174
|
+
return Array.isArray(value) ? value : [value];
|
|
2183
2175
|
}
|
|
2184
2176
|
|
|
2185
2177
|
function zeroArray(array, length) {
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2178
|
+
for (let i = 0; i < length; i++) {
|
|
2179
|
+
if (typeof array[i] !== 'number') {
|
|
2180
|
+
array[i] = 0;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2191
2183
|
|
|
2192
|
-
|
|
2184
|
+
return array;
|
|
2193
2185
|
}
|
|
2194
2186
|
|
|
2195
2187
|
var color = Color;
|
|
@@ -2295,7 +2287,7 @@ const DIMENSIONS = {
|
|
|
2295
2287
|
}
|
|
2296
2288
|
};
|
|
2297
2289
|
|
|
2298
|
-
const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;
|
|
2290
|
+
const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{margin-bottom:-16px}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.section{padding:0 12px 12px}.section:first-of-type{padding-top:12px}.color-hex-options,.section--split{-ms-flex-positive:1;flex-grow:1}.header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{padding-top:12px}.channels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.channel{width:31%}.saved-colors{padding-top:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;width:100%}.saved-colors-buttons{display:-ms-flexbox;display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{-webkit-transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
|
|
2299
2291
|
|
|
2300
2292
|
const throttleFor60FpsInMs = 16;
|
|
2301
2293
|
const defaultValue = normalizeHex(DEFAULT_COLOR$1.hex());
|
|
@@ -2332,6 +2324,7 @@ const ColorPicker = class {
|
|
|
2332
2324
|
* The format of the value property.
|
|
2333
2325
|
*
|
|
2334
2326
|
* When "auto", the format will be inferred from `value` when set.
|
|
2327
|
+
*
|
|
2335
2328
|
* @default "auto"
|
|
2336
2329
|
*/
|
|
2337
2330
|
this.format = defaultFormat;
|
|
@@ -2341,80 +2334,117 @@ const ColorPicker = class {
|
|
|
2341
2334
|
this.hideChannels = false;
|
|
2342
2335
|
/** When true, hides the saved colors section */
|
|
2343
2336
|
this.hideSaved = false;
|
|
2344
|
-
/**
|
|
2337
|
+
/**
|
|
2338
|
+
* Label used for the blue channel
|
|
2339
|
+
*
|
|
2345
2340
|
* @default "B"
|
|
2346
2341
|
*/
|
|
2347
2342
|
this.intlB = TEXT.b;
|
|
2348
|
-
/**
|
|
2343
|
+
/**
|
|
2344
|
+
* Label used for the blue channel description
|
|
2345
|
+
*
|
|
2349
2346
|
* @default "Blue"
|
|
2350
2347
|
*/
|
|
2351
2348
|
this.intlBlue = TEXT.blue;
|
|
2352
|
-
/**
|
|
2349
|
+
/**
|
|
2350
|
+
* Label used for the delete color button.
|
|
2351
|
+
*
|
|
2353
2352
|
* @default "Delete color"
|
|
2354
2353
|
*/
|
|
2355
2354
|
this.intlDeleteColor = TEXT.deleteColor;
|
|
2356
|
-
/**
|
|
2355
|
+
/**
|
|
2356
|
+
* Label used for the green channel
|
|
2357
|
+
*
|
|
2357
2358
|
* @default "G"
|
|
2358
2359
|
*/
|
|
2359
2360
|
this.intlG = TEXT.g;
|
|
2360
|
-
/**
|
|
2361
|
+
/**
|
|
2362
|
+
* Label used for the green channel description
|
|
2363
|
+
*
|
|
2361
2364
|
* @default "Green"
|
|
2362
2365
|
*/
|
|
2363
2366
|
this.intlGreen = TEXT.green;
|
|
2364
|
-
/**
|
|
2367
|
+
/**
|
|
2368
|
+
* Label used for the hue channel
|
|
2369
|
+
*
|
|
2365
2370
|
* @default "H"
|
|
2366
2371
|
*/
|
|
2367
2372
|
this.intlH = TEXT.h;
|
|
2368
|
-
/**
|
|
2373
|
+
/**
|
|
2374
|
+
* Label used for the HSV mode
|
|
2375
|
+
*
|
|
2369
2376
|
* @default "HSV"
|
|
2370
2377
|
*/
|
|
2371
2378
|
this.intlHsv = TEXT.hsv;
|
|
2372
|
-
/**
|
|
2379
|
+
/**
|
|
2380
|
+
* Label used for the hex input
|
|
2381
|
+
*
|
|
2373
2382
|
* @default "Hex"
|
|
2374
2383
|
*/
|
|
2375
2384
|
this.intlHex = TEXT.hex;
|
|
2376
|
-
/**
|
|
2385
|
+
/**
|
|
2386
|
+
* Label used for the hue channel description
|
|
2387
|
+
*
|
|
2377
2388
|
* @default "Hue"
|
|
2378
2389
|
*/
|
|
2379
2390
|
this.intlHue = TEXT.hue;
|
|
2380
2391
|
/**
|
|
2381
2392
|
* Label used for the hex input when there is no color selected.
|
|
2393
|
+
*
|
|
2382
2394
|
* @default "No color"
|
|
2383
2395
|
*/
|
|
2384
2396
|
this.intlNoColor = TEXT.noColor;
|
|
2385
|
-
/**
|
|
2397
|
+
/**
|
|
2398
|
+
* Label used for the red channel
|
|
2399
|
+
*
|
|
2386
2400
|
* @default "R"
|
|
2387
2401
|
*/
|
|
2388
2402
|
this.intlR = TEXT.r;
|
|
2389
|
-
/**
|
|
2403
|
+
/**
|
|
2404
|
+
* Label used for the red channel description
|
|
2405
|
+
*
|
|
2390
2406
|
* @default "Red"
|
|
2391
2407
|
*/
|
|
2392
2408
|
this.intlRed = TEXT.red;
|
|
2393
|
-
/**
|
|
2409
|
+
/**
|
|
2410
|
+
* Label used for the RGB mode
|
|
2411
|
+
*
|
|
2394
2412
|
* @default "RGB"
|
|
2395
2413
|
*/
|
|
2396
2414
|
this.intlRgb = TEXT.rgb;
|
|
2397
|
-
/**
|
|
2415
|
+
/**
|
|
2416
|
+
* Label used for the saturation channel
|
|
2417
|
+
*
|
|
2398
2418
|
* @default "S"
|
|
2399
2419
|
*/
|
|
2400
2420
|
this.intlS = TEXT.s;
|
|
2401
|
-
/**
|
|
2421
|
+
/**
|
|
2422
|
+
* Label used for the saturation channel description
|
|
2423
|
+
*
|
|
2402
2424
|
* @default "Saturation"
|
|
2403
2425
|
*/
|
|
2404
2426
|
this.intlSaturation = TEXT.saturation;
|
|
2405
|
-
/**
|
|
2427
|
+
/**
|
|
2428
|
+
* Label used for the save color button.
|
|
2429
|
+
*
|
|
2406
2430
|
* @default "Save color"
|
|
2407
2431
|
*/
|
|
2408
2432
|
this.intlSaveColor = TEXT.saveColor;
|
|
2409
|
-
/**
|
|
2433
|
+
/**
|
|
2434
|
+
* Label used for the saved colors section
|
|
2435
|
+
*
|
|
2410
2436
|
* @default "Saved"
|
|
2411
2437
|
*/
|
|
2412
2438
|
this.intlSaved = TEXT.saved;
|
|
2413
|
-
/**
|
|
2439
|
+
/**
|
|
2440
|
+
* Label used for the value channel
|
|
2441
|
+
*
|
|
2414
2442
|
* @default "V"
|
|
2415
2443
|
*/
|
|
2416
2444
|
this.intlV = TEXT.v;
|
|
2417
|
-
/**
|
|
2445
|
+
/**
|
|
2446
|
+
* Label used for the
|
|
2447
|
+
*
|
|
2418
2448
|
* @default "Value"
|
|
2419
2449
|
*/
|
|
2420
2450
|
this.intlValue = TEXT.value;
|
|
@@ -2429,6 +2459,7 @@ const ColorPicker = class {
|
|
|
2429
2459
|
* a RGB, HSL or HSV object.
|
|
2430
2460
|
*
|
|
2431
2461
|
* The type will be preserved as the color is updated.
|
|
2462
|
+
*
|
|
2432
2463
|
* @default "#007ac2"
|
|
2433
2464
|
* @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
|
|
2434
2465
|
*/
|
|
@@ -2692,9 +2723,12 @@ const ColorPicker = class {
|
|
|
2692
2723
|
const channelAriaLabels = isRgb
|
|
2693
2724
|
? [intlRed, intlGreen, intlBlue]
|
|
2694
2725
|
: [intlHue, intlSaturation, intlValue];
|
|
2695
|
-
|
|
2726
|
+
const direction = getElementDir(this.el);
|
|
2727
|
+
return (h("calcite-tab", { active: active, class: CSS$2.control, key: channelMode }, h("div", { class: CSS$2.channels, dir: "ltr" }, channels.map((channel, index) =>
|
|
2728
|
+
/* the channel container is ltr, so we apply the host's direction */
|
|
2729
|
+
this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
|
|
2696
2730
|
};
|
|
2697
|
-
this.renderChannel = (value, index, label, ariaLabel) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, label: ariaLabel, numberButtonType: "none", onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
|
|
2731
|
+
this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, dir: direction, label: ariaLabel, numberButtonType: "none", onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
|
|
2698
2732
|
this.deleteColor = () => {
|
|
2699
2733
|
const colorToDelete = this.color.hex();
|
|
2700
2734
|
const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
|
|
@@ -2749,14 +2783,10 @@ const ColorPicker = class {
|
|
|
2749
2783
|
this.drawColorFieldAndSlider();
|
|
2750
2784
|
this.updateChannelsFromColor(color);
|
|
2751
2785
|
this.previousColor = oldColor;
|
|
2752
|
-
if (this.internalColorUpdateContext) {
|
|
2753
|
-
return;
|
|
2754
|
-
}
|
|
2755
|
-
this.value = this.toValue(color);
|
|
2756
2786
|
}
|
|
2757
2787
|
handleFormatChange(format) {
|
|
2758
2788
|
this.setMode(format);
|
|
2759
|
-
this.
|
|
2789
|
+
this.internalColorSet(this.color, false, "internal");
|
|
2760
2790
|
}
|
|
2761
2791
|
handleScaleChange(scale = "m") {
|
|
2762
2792
|
this.updateDimensions(scale);
|
|
@@ -2776,10 +2806,10 @@ const ColorPicker = class {
|
|
|
2776
2806
|
this.setMode(nextMode);
|
|
2777
2807
|
}
|
|
2778
2808
|
const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
|
|
2779
|
-
if (this.internalColorUpdateContext) {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2809
|
+
if (this.internalColorUpdateContext === "initial") {
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
if (this.internalColorUpdateContext === "user-interaction") {
|
|
2783
2813
|
this.calciteColorPickerInput.emit();
|
|
2784
2814
|
if (!dragging) {
|
|
2785
2815
|
this.calciteColorPickerChange.emit();
|
|
@@ -2789,11 +2819,7 @@ const ColorPicker = class {
|
|
|
2789
2819
|
const color$1 = allowEmpty && !value ? null : color(value);
|
|
2790
2820
|
const colorChanged = !colorEqual(color$1, this.color);
|
|
2791
2821
|
if (modeChanged || colorChanged) {
|
|
2792
|
-
this.color
|
|
2793
|
-
this.calciteColorPickerInput.emit();
|
|
2794
|
-
if (!dragging) {
|
|
2795
|
-
this.calciteColorPickerChange.emit();
|
|
2796
|
-
}
|
|
2822
|
+
this.internalColorSet(color$1, true, "internal");
|
|
2797
2823
|
}
|
|
2798
2824
|
}
|
|
2799
2825
|
//--------------------------------------------------------------------------
|
|
@@ -2901,6 +2927,11 @@ const ColorPicker = class {
|
|
|
2901
2927
|
// Private Methods
|
|
2902
2928
|
//
|
|
2903
2929
|
//--------------------------------------------------------------------------
|
|
2930
|
+
handleKeyDown(event) {
|
|
2931
|
+
if (event.key === "Enter") {
|
|
2932
|
+
event.preventDefault();
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2904
2935
|
showIncompatibleColorWarning(value, format) {
|
|
2905
2936
|
console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
|
|
2906
2937
|
}
|
|
@@ -2922,7 +2953,7 @@ const ColorPicker = class {
|
|
|
2922
2953
|
}
|
|
2923
2954
|
return "none";
|
|
2924
2955
|
}
|
|
2925
|
-
internalColorSet(color, skipEqual = true, context = "
|
|
2956
|
+
internalColorSet(color, skipEqual = true, context = "user-interaction") {
|
|
2926
2957
|
if (skipEqual && colorEqual(color, this.color)) {
|
|
2927
2958
|
return;
|
|
2928
2959
|
}
|
|
@@ -3097,11 +3128,13 @@ const ColorPickerHexInput = class {
|
|
|
3097
3128
|
this.allowEmpty = false;
|
|
3098
3129
|
/**
|
|
3099
3130
|
* Label used for the hex input.
|
|
3131
|
+
*
|
|
3100
3132
|
* @default "Hex"
|
|
3101
3133
|
*/
|
|
3102
3134
|
this.intlHex = TEXT.hex;
|
|
3103
3135
|
/**
|
|
3104
3136
|
* Label used for the hex input when there is no color selected.
|
|
3137
|
+
*
|
|
3105
3138
|
* @default "No color"
|
|
3106
3139
|
*/
|
|
3107
3140
|
this.intlNoColor = TEXT.noColor;
|
|
@@ -3113,7 +3146,7 @@ const ColorPickerHexInput = class {
|
|
|
3113
3146
|
* The hex value.
|
|
3114
3147
|
*/
|
|
3115
3148
|
this.value = normalizeHex(DEFAULT_COLOR.hex());
|
|
3116
|
-
this.
|
|
3149
|
+
this.onCalciteInternalInputBlur = () => {
|
|
3117
3150
|
const node = this.inputNode;
|
|
3118
3151
|
const inputValue = node.value;
|
|
3119
3152
|
const hex = `#${inputValue}`;
|
|
@@ -3128,32 +3161,13 @@ const ColorPickerHexInput = class {
|
|
|
3128
3161
|
: this.formatForInternalInput(rgbToHex(this.internalColor.object()));
|
|
3129
3162
|
};
|
|
3130
3163
|
this.onInputChange = () => {
|
|
3131
|
-
|
|
3132
|
-
let value;
|
|
3133
|
-
if (inputValue) {
|
|
3134
|
-
const hex = inputValue;
|
|
3135
|
-
const color = hexToRGB(`#${hex}`);
|
|
3136
|
-
if (!color) {
|
|
3137
|
-
return;
|
|
3138
|
-
}
|
|
3139
|
-
value = normalizeHex(hex);
|
|
3140
|
-
}
|
|
3141
|
-
else if (this.allowEmpty) {
|
|
3142
|
-
value = null;
|
|
3143
|
-
}
|
|
3144
|
-
this.value = value;
|
|
3145
|
-
this.calciteColorPickerHexInputChange.emit();
|
|
3164
|
+
this.internalSetValue(this.inputNode.value, this.value);
|
|
3146
3165
|
};
|
|
3147
3166
|
/**
|
|
3148
3167
|
* The last valid/selected color. Used as a fallback if an invalid hex code is entered.
|
|
3149
3168
|
*/
|
|
3150
3169
|
this.internalColor = DEFAULT_COLOR;
|
|
3151
3170
|
this.previousNonNullValue = this.value;
|
|
3152
|
-
//--------------------------------------------------------------------------
|
|
3153
|
-
//
|
|
3154
|
-
// Private Methods
|
|
3155
|
-
//
|
|
3156
|
-
//--------------------------------------------------------------------------
|
|
3157
3171
|
this.storeInputRef = (node) => {
|
|
3158
3172
|
this.inputNode = node;
|
|
3159
3173
|
};
|
|
@@ -3168,38 +3182,16 @@ const ColorPickerHexInput = class {
|
|
|
3168
3182
|
if (value) {
|
|
3169
3183
|
const normalized = normalizeHex(value);
|
|
3170
3184
|
if (isValidHex(normalized)) {
|
|
3171
|
-
this.
|
|
3172
|
-
this.value = normalized;
|
|
3185
|
+
this.internalSetValue(normalized, normalized, false);
|
|
3173
3186
|
}
|
|
3174
3187
|
return;
|
|
3175
3188
|
}
|
|
3176
3189
|
if (allowEmpty) {
|
|
3177
|
-
this.
|
|
3178
|
-
this.value = null;
|
|
3190
|
+
this.internalSetValue(null, null, false);
|
|
3179
3191
|
}
|
|
3180
3192
|
}
|
|
3181
3193
|
handleValueChange(value, oldValue) {
|
|
3182
|
-
|
|
3183
|
-
const normalized = normalizeHex(value);
|
|
3184
|
-
if (isValidHex(normalized)) {
|
|
3185
|
-
const { internalColor } = this;
|
|
3186
|
-
const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
|
|
3187
|
-
this.internalColor = color(normalized);
|
|
3188
|
-
this.previousNonNullValue = normalized;
|
|
3189
|
-
this.value = normalized;
|
|
3190
|
-
if (changed) {
|
|
3191
|
-
this.calciteColorPickerHexInputChange.emit();
|
|
3192
|
-
}
|
|
3193
|
-
return;
|
|
3194
|
-
}
|
|
3195
|
-
}
|
|
3196
|
-
else if (this.allowEmpty) {
|
|
3197
|
-
this.internalColor = null;
|
|
3198
|
-
this.value = null;
|
|
3199
|
-
this.calciteColorPickerHexInputChange.emit();
|
|
3200
|
-
return;
|
|
3201
|
-
}
|
|
3202
|
-
this.value = oldValue;
|
|
3194
|
+
this.internalSetValue(value, oldValue, false);
|
|
3203
3195
|
}
|
|
3204
3196
|
// using @Listen as a workaround for VDOM listener not firing
|
|
3205
3197
|
onInputKeyDown(event) {
|
|
@@ -3211,15 +3203,16 @@ const ColorPickerHexInput = class {
|
|
|
3211
3203
|
return;
|
|
3212
3204
|
}
|
|
3213
3205
|
const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
|
|
3206
|
+
const oldValue = this.value;
|
|
3214
3207
|
if (isNudgeKey) {
|
|
3215
3208
|
if (!value) {
|
|
3216
|
-
this.
|
|
3209
|
+
this.internalSetValue(this.previousNonNullValue, oldValue);
|
|
3217
3210
|
event.preventDefault();
|
|
3218
3211
|
return;
|
|
3219
3212
|
}
|
|
3220
3213
|
const direction = key === "ArrowUp" ? 1 : -1;
|
|
3221
3214
|
const bump = shiftKey ? 10 : 1;
|
|
3222
|
-
this.
|
|
3215
|
+
this.internalSetValue(normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
|
|
3223
3216
|
event.preventDefault();
|
|
3224
3217
|
return;
|
|
3225
3218
|
}
|
|
@@ -3238,7 +3231,7 @@ const ColorPickerHexInput = class {
|
|
|
3238
3231
|
render() {
|
|
3239
3232
|
const { intlHex, value } = this;
|
|
3240
3233
|
const hexInputValue = this.formatForInternalInput(value);
|
|
3241
|
-
return (h("div", { class: CSS$1.container }, h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6,
|
|
3234
|
+
return (h("div", { class: CSS$1.container }, h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6, onCalciteInputChange: this.onInputChange, onCalciteInternalInputBlur: this.onCalciteInternalInputBlur, onKeyDown: this.handleKeyDown, prefixText: "#", ref: this.storeInputRef, scale: this.scale, value: hexInputValue }), hexInputValue ? (h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
|
|
3242
3235
|
}
|
|
3243
3236
|
//--------------------------------------------------------------------------
|
|
3244
3237
|
//
|
|
@@ -3249,12 +3242,47 @@ const ColorPickerHexInput = class {
|
|
|
3249
3242
|
async setFocus() {
|
|
3250
3243
|
focusElement(this.inputNode);
|
|
3251
3244
|
}
|
|
3245
|
+
//--------------------------------------------------------------------------
|
|
3246
|
+
//
|
|
3247
|
+
// Private Methods
|
|
3248
|
+
//
|
|
3249
|
+
//--------------------------------------------------------------------------
|
|
3250
|
+
internalSetValue(value, oldValue, emit = true) {
|
|
3251
|
+
if (value) {
|
|
3252
|
+
const normalized = normalizeHex(value);
|
|
3253
|
+
if (isValidHex(normalized)) {
|
|
3254
|
+
const { internalColor } = this;
|
|
3255
|
+
const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
|
|
3256
|
+
this.internalColor = color(normalized);
|
|
3257
|
+
this.previousNonNullValue = normalized;
|
|
3258
|
+
this.value = normalized;
|
|
3259
|
+
if (changed && emit) {
|
|
3260
|
+
this.calciteColorPickerHexInputChange.emit();
|
|
3261
|
+
}
|
|
3262
|
+
return;
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
else if (this.allowEmpty) {
|
|
3266
|
+
this.internalColor = null;
|
|
3267
|
+
this.value = null;
|
|
3268
|
+
if (emit) {
|
|
3269
|
+
this.calciteColorPickerHexInputChange.emit();
|
|
3270
|
+
}
|
|
3271
|
+
return;
|
|
3272
|
+
}
|
|
3273
|
+
this.value = oldValue;
|
|
3274
|
+
}
|
|
3252
3275
|
formatForInternalInput(hex) {
|
|
3253
3276
|
return hex ? hex.replace("#", "") : "";
|
|
3254
3277
|
}
|
|
3255
3278
|
nudgeRGBChannels(color$1, amount) {
|
|
3256
3279
|
return color.rgb(color$1.array().map((channel) => channel + amount));
|
|
3257
3280
|
}
|
|
3281
|
+
handleKeyDown(event) {
|
|
3282
|
+
if (event.key === "Enter") {
|
|
3283
|
+
event.preventDefault();
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3258
3286
|
get el() { return getElement(this); }
|
|
3259
3287
|
static get watchers() { return {
|
|
3260
3288
|
"value": ["handleValueChange"]
|