@esri/calcite-components 1.0.0-beta.67 → 1.0.0-beta.68
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/calcite-icon/penMark16.json +1 -0
- package/dist/calcite/assets/calcite-icon/penMark24.json +1 -0
- package/dist/calcite/assets/calcite-icon/penMark32.json +1 -0
- package/dist/calcite/assets/calcite-icon/penMarkPlus16.json +1 -0
- package/dist/calcite/assets/calcite-icon/penMarkPlus24.json +1 -0
- package/dist/calcite/assets/calcite-icon/penMarkPlus32.json +1 -0
- package/dist/calcite/assets/calcite-icon/subscript16.json +1 -0
- package/dist/calcite/assets/calcite-icon/subscript24.json +1 -0
- package/dist/calcite/assets/calcite-icon/subscript32.json +1 -0
- package/dist/calcite/assets/calcite-icon/superscript16.json +1 -0
- package/dist/calcite/assets/calcite-icon/superscript24.json +1 -0
- package/dist/calcite/assets/calcite-icon/superscript32.json +1 -0
- package/dist/calcite/calcite.esm.js +5 -1
- package/dist/calcite/calcite.js +1 -1
- package/dist/calcite/index.esm.js +4 -0
- package/dist/calcite/p-00d72f16.entry.js +5 -0
- package/dist/calcite/p-01c3783e.system.entry.js +5 -0
- package/dist/calcite/p-021d44b7.system.entry.js +5 -0
- package/dist/calcite/p-050dc7e6.system.entry.js +5 -0
- package/dist/calcite/p-05bf835f.js +5 -0
- package/dist/calcite/p-07ba39b6.js +5 -0
- package/dist/calcite/p-0e30afe6.entry.js +5 -0
- package/dist/calcite/p-0fb8cdc5.entry.js +5 -0
- package/dist/calcite/p-0fc8b24c.system.entry.js +5 -0
- package/dist/calcite/p-0fd333ff.entry.js +5 -0
- package/dist/calcite/p-10ccc21d.entry.js +5 -0
- package/dist/calcite/p-157d05ce.js +5 -0
- package/dist/calcite/p-175764f3.system.entry.js +5 -0
- package/dist/calcite/p-18078190.entry.js +5 -0
- package/dist/calcite/p-18574b32.entry.js +5 -0
- package/dist/calcite/p-1aaf7f83.entry.js +5 -0
- package/dist/calcite/p-1b2c1f55.entry.js +5 -0
- package/dist/calcite/p-1d6404b5.system.js +5 -0
- package/dist/calcite/p-1f99b038.entry.js +5 -0
- package/dist/calcite/p-1fb7138b.js +5 -0
- package/dist/calcite/p-20042561.entry.js +5 -0
- package/dist/calcite/p-22ad79b1.entry.js +5 -0
- package/dist/calcite/p-24b86e03.entry.js +5 -0
- package/dist/calcite/p-26045881.entry.js +5 -0
- package/dist/calcite/p-26508b91.js +5 -0
- package/dist/calcite/p-2920aa02.entry.js +5 -0
- package/dist/calcite/p-29b110b2.entry.js +5 -0
- package/dist/calcite/p-2ba00b89.js +5 -0
- package/dist/calcite/p-318e95d7.system.entry.js +5 -0
- package/dist/calcite/p-31c4a271.system.entry.js +5 -0
- package/dist/calcite/p-32faf98b.system.entry.js +5 -0
- package/dist/calcite/p-32fbf8cd.system.js +5 -0
- package/dist/calcite/p-349333f8.system.entry.js +5 -0
- package/dist/calcite/p-34a1c944.entry.js +5 -0
- package/dist/calcite/p-34a6550f.system.entry.js +5 -0
- package/dist/calcite/p-361ddbb6.entry.js +5 -0
- package/dist/calcite/p-378b83de.entry.js +5 -0
- package/dist/calcite/p-378ffa38.system.js +5 -0
- package/dist/calcite/p-37cee0ea.entry.js +5 -0
- package/dist/calcite/p-3929447c.system.entry.js +5 -0
- package/dist/calcite/p-3b17d8d0.system.js +5 -0
- package/dist/calcite/p-3ba8024a.system.entry.js +5 -0
- package/dist/calcite/p-4035444d.system.js +5 -0
- package/dist/calcite/p-41e9b889.entry.js +5 -0
- package/dist/calcite/p-43494684.entry.js +5 -0
- package/dist/calcite/p-45d123be.system.entry.js +5 -0
- package/dist/calcite/p-47313747.system.js +5 -0
- package/dist/calcite/p-473cfb74.system.entry.js +5 -0
- package/dist/calcite/p-477bac2c.system.js +5 -0
- package/dist/calcite/p-485062f4.system.entry.js +5 -0
- package/dist/calcite/p-4c7e3d8e.system.entry.js +5 -0
- package/dist/calcite/p-4de6f4fd.system.js +5 -0
- package/dist/calcite/p-4e06a168.entry.js +5 -0
- package/dist/calcite/p-51cb078a.entry.js +5 -0
- package/dist/calcite/p-52cc870b.js +5 -0
- package/dist/calcite/p-530584ff.system.entry.js +5 -0
- package/dist/calcite/p-568ed3d6.system.entry.js +5 -0
- package/dist/calcite/p-56b352bf.system.js +5 -0
- package/dist/calcite/p-57f5866d.system.entry.js +5 -0
- package/dist/calcite/p-5c221c33.system.entry.js +5 -0
- package/dist/calcite/p-5cb26137.system.entry.js +5 -0
- package/dist/calcite/p-61038b30.js +5 -0
- package/dist/calcite/p-64d90b14.system.js +5 -0
- package/dist/calcite/p-67fd79db.entry.js +5 -0
- package/dist/calcite/p-693a4d5f.entry.js +5 -0
- package/dist/calcite/p-69548a7d.system.entry.js +5 -0
- package/dist/calcite/p-6a541e77.system.js +5 -0
- package/dist/calcite/p-6cc23c39.system.js +5 -0
- package/dist/calcite/p-72563742.js +5 -0
- package/dist/calcite/p-727c8f36.system.entry.js +5 -0
- package/dist/calcite/p-728501db.system.js +5 -0
- package/dist/calcite/p-72ffc6d7.entry.js +5 -0
- package/dist/calcite/p-745e41ea.entry.js +5 -0
- package/dist/calcite/p-75793454.entry.js +5 -0
- package/dist/calcite/p-7839d1c9.entry.js +5 -0
- package/dist/calcite/p-7a544774.system.entry.js +5 -0
- package/dist/calcite/p-7b01fe89.js +5 -0
- package/dist/calcite/p-7b600760.entry.js +5 -0
- package/dist/calcite/p-7c0debe0.system.entry.js +5 -0
- package/dist/calcite/p-7cdfec27.system.js +5 -0
- package/dist/calcite/p-7ed4c551.system.js +5 -0
- package/dist/calcite/p-7f4a5f8e.system.entry.js +5 -0
- package/dist/calcite/p-81a82d01.system.entry.js +5 -0
- package/dist/calcite/p-85a2bf7c.system.entry.js +5 -0
- package/dist/calcite/p-8655c0a1.entry.js +5 -0
- package/dist/calcite/p-87b93729.entry.js +5 -0
- package/dist/calcite/p-87e83c0d.system.entry.js +5 -0
- package/dist/calcite/p-8a63221d.js +5 -0
- package/dist/calcite/p-8efb43fc.entry.js +5 -0
- package/dist/calcite/p-8fcfe861.js +5 -0
- package/dist/calcite/p-91645bf7.system.js +5 -0
- package/dist/calcite/p-9358deb1.system.entry.js +5 -0
- package/dist/calcite/p-93d8a7d5.entry.js +5 -0
- package/dist/calcite/p-95a3a0ce.entry.js +5 -0
- package/dist/calcite/p-9965ea81.system.js +5 -0
- package/dist/calcite/p-99da965d.system.entry.js +5 -0
- package/dist/calcite/p-9ac1fa0b.system.entry.js +5 -0
- package/dist/calcite/p-9caae570.entry.js +5 -0
- package/dist/calcite/p-9d3ee5cf.system.entry.js +5 -0
- package/dist/calcite/p-9d83f268.system.entry.js +5 -0
- package/dist/calcite/p-9dbb69f7.entry.js +5 -0
- package/dist/calcite/p-9e4f2697.system.entry.js +5 -0
- package/dist/calcite/p-a0c02648.system.js +5 -0
- package/dist/calcite/p-a20df95c.js +5 -0
- package/dist/calcite/p-a62de092.js +5 -0
- package/dist/calcite/p-a7521c0d.entry.js +5 -0
- package/dist/calcite/p-a8cd5cde.system.entry.js +5 -0
- package/dist/calcite/p-a93678c6.system.entry.js +5 -0
- package/dist/calcite/p-aad45edf.system.js +5 -0
- package/dist/calcite/p-ac3d8784.entry.js +5 -0
- package/dist/calcite/p-ac9607f2.system.js +11 -0
- package/dist/calcite/p-acaad99b.system.entry.js +5 -0
- package/dist/calcite/p-accdb0ce.js +5 -0
- package/dist/calcite/p-b06207bb.js +5 -0
- package/dist/calcite/p-b2ab0485.js +5 -0
- package/dist/calcite/p-b701101e.entry.js +5 -0
- package/dist/calcite/p-ba255377.entry.js +5 -0
- package/dist/calcite/p-ba9b4f62.system.entry.js +5 -0
- package/dist/calcite/p-bb916828.system.entry.js +5 -0
- package/dist/calcite/p-bc02d9ef.system.entry.js +5 -0
- package/dist/calcite/p-bcc323ec.system.entry.js +5 -0
- package/dist/calcite/p-bd555b2e.system.entry.js +5 -0
- package/dist/calcite/p-be3b0fee.entry.js +5 -0
- package/dist/calcite/p-bfc162ee.system.entry.js +5 -0
- package/dist/calcite/p-c0dd929a.entry.js +5 -0
- package/dist/calcite/p-c1995144.system.entry.js +5 -0
- package/dist/calcite/p-c20278e8.system.entry.js +5 -0
- package/dist/calcite/p-c31243c5.entry.js +5 -0
- package/dist/calcite/p-c3922ef7.system.entry.js +5 -0
- package/dist/calcite/p-c57f8690.entry.js +5 -0
- package/dist/calcite/p-c5ec8d74.js +11 -0
- package/dist/calcite/p-c74fc589.system.js +5 -0
- package/dist/calcite/p-caf7085a.system.js +5 -0
- package/dist/calcite/p-cb228ac0.entry.js +5 -0
- package/dist/calcite/p-cbdf0e6c.js +5 -0
- package/dist/calcite/p-cd8f7781.system.entry.js +5 -0
- package/dist/calcite/p-d35e423d.js +5 -0
- package/dist/calcite/p-d5d62977.entry.js +5 -0
- package/dist/calcite/p-d7a7a544.system.entry.js +5 -0
- package/dist/calcite/p-d7e5b807.system.entry.js +5 -0
- package/dist/calcite/p-da9603a3.entry.js +5 -0
- package/dist/calcite/p-db10485b.system.js +5 -0
- package/dist/calcite/p-de0f4633.entry.js +5 -0
- package/dist/calcite/p-e020662f.system.js +5 -0
- package/dist/calcite/p-e33a2dd2.system.entry.js +5 -0
- package/dist/calcite/p-e3a30266.system.entry.js +5 -0
- package/dist/calcite/p-e4acb5a8.js +5 -0
- package/dist/calcite/p-e693758c.entry.js +5 -0
- package/dist/calcite/p-e9044cc1.entry.js +5 -0
- package/dist/calcite/p-eb3ee207.entry.js +5 -0
- package/dist/calcite/p-f07d3627.js +5 -0
- package/dist/calcite/p-f141da0f.entry.js +5 -0
- package/dist/calcite/p-f243b615.js +5 -0
- package/dist/calcite/p-f37563ac.system.entry.js +5 -0
- package/dist/calcite/p-f4299b95.entry.js +5 -0
- package/dist/calcite/p-f5d25746.system.entry.js +5 -0
- package/dist/calcite/p-f8d975a1.system.entry.js +5 -0
- package/dist/calcite/p-fb1da0f5.system.js +5 -0
- package/dist/calcite/p-fc4846f0.system.entry.js +5 -0
- package/dist/calcite/p-fe52131d.entry.js +5 -0
- package/dist/calcite/p-ff04f827.system.entry.js +5 -0
- package/dist/calcite/p-fff0a881.entry.js +5 -0
- package/dist/cjs/CalciteExpandToggle-0d802f83.js +94 -0
- package/dist/cjs/CalciteHeading-381b977d.js +19 -0
- package/dist/cjs/array-a5dedf5a.js +11 -0
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +8 -4
- package/dist/cjs/calcite-action-bar.cjs.entry.js +12 -8
- package/dist/cjs/calcite-action-group.cjs.entry.js +9 -5
- package/dist/cjs/calcite-action-menu.cjs.entry.js +14 -8
- package/dist/cjs/calcite-action-pad.cjs.entry.js +10 -6
- package/dist/cjs/calcite-action.cjs.entry.js +11 -11
- package/dist/cjs/calcite-alert.cjs.entry.js +9 -5
- package/dist/cjs/calcite-avatar.cjs.entry.js +8 -4
- package/dist/cjs/calcite-block_2.cjs.entry.js +21 -14
- package/dist/cjs/calcite-button.cjs.entry.js +59 -38
- package/dist/cjs/calcite-card.cjs.entry.js +8 -4
- package/dist/cjs/calcite-checkbox.cjs.entry.js +14 -10
- package/dist/cjs/calcite-chip.cjs.entry.js +7 -3
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +11 -7
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +25 -21
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +15 -11
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +45 -36
- package/dist/cjs/calcite-fab.cjs.entry.js +7 -3
- package/dist/cjs/calcite-filter.cjs.entry.js +10 -6
- package/dist/cjs/calcite-flow.cjs.entry.js +6 -2
- package/dist/cjs/calcite-graph_2.cjs.entry.js +19 -15
- package/dist/cjs/calcite-handle.cjs.entry.js +5 -1
- package/dist/cjs/calcite-icon.cjs.entry.js +8 -4
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +12 -7
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +21 -17
- package/dist/cjs/calcite-input-message.cjs.entry.js +7 -3
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +19 -15
- package/dist/cjs/calcite-input.cjs.entry.js +25 -26
- package/dist/cjs/calcite-label.cjs.entry.js +7 -3
- package/dist/cjs/calcite-link.cjs.entry.js +13 -3
- package/dist/cjs/calcite-list_3.cjs.entry.js +30 -5
- package/dist/cjs/calcite-loader.cjs.entry.js +7 -3
- package/dist/cjs/calcite-modal.cjs.entry.js +9 -5
- package/dist/cjs/calcite-notice.cjs.entry.js +9 -5
- package/dist/cjs/calcite-option_3.cjs.entry.js +17 -13
- package/dist/cjs/calcite-pagination.cjs.entry.js +7 -3
- package/dist/cjs/calcite-panel.cjs.entry.js +9 -5
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +12 -8
- package/dist/cjs/calcite-popover_2.cjs.entry.js +9 -5
- package/dist/cjs/calcite-progress.cjs.entry.js +5 -1
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +5 -1
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +19 -15
- package/dist/cjs/calcite-radio_2.cjs.entry.js +24 -20
- package/dist/cjs/calcite-rating.cjs.entry.js +16 -12
- package/dist/cjs/calcite-scrim.cjs.entry.js +5 -1
- package/dist/cjs/calcite-shell_3.cjs.entry.js +7 -3
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +7 -3
- package/dist/cjs/calcite-split-button.cjs.entry.js +7 -3
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +8 -4
- package/dist/cjs/calcite-switch.cjs.entry.js +21 -17
- package/dist/cjs/calcite-tab_4.cjs.entry.js +9 -5
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +7 -3
- package/dist/cjs/calcite-tile.cjs.entry.js +7 -3
- package/dist/cjs/calcite-tip_3.cjs.entry.js +9 -5
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +12 -7
- package/dist/cjs/calcite-tree_2.cjs.entry.js +8 -4
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +12 -8
- package/dist/cjs/calcite.cjs.js +6 -2
- package/dist/cjs/debounce-95979061.js +495 -0
- package/dist/cjs/dom-19822169.js +170 -0
- package/dist/cjs/forIn-a5d553af.js +622 -0
- package/dist/cjs/form-00fb301c.js +22 -0
- package/dist/cjs/guid-b270f0db.js +20 -0
- package/dist/cjs/index-1987a382.js +2066 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/interfaces-54651c1c.js +13 -0
- package/dist/cjs/key-8bfb93ec.js +37 -0
- package/dist/cjs/label-549c3d9d.js +58 -0
- package/dist/cjs/loader.cjs.js +6 -2
- package/dist/cjs/locale-69dc9583.js +123 -0
- package/dist/cjs/math-9d44163f.js +9 -0
- package/dist/cjs/number-e6448e15.js +45 -0
- package/dist/cjs/observers-41837607.js +22 -0
- package/dist/cjs/popper-cd9c0742.js +1790 -0
- package/dist/cjs/resources-407a4290.js +20 -0
- package/dist/cjs/resources-7dcd68d1.js +232 -0
- package/dist/cjs/resources-d0619f6a.js +346 -0
- package/dist/cjs/resources-ffe563a2.js +21 -0
- package/dist/cjs/sortable.esm-d7a4560b.js +3019 -0
- package/dist/cjs/utils-55d67711.js +123 -0
- package/dist/collection/components/calcite-accordion/calcite-accordion.js +4 -0
- package/dist/collection/components/calcite-accordion/interfaces.js +4 -0
- package/dist/collection/components/calcite-accordion-item/calcite-accordion-item.js +4 -0
- package/dist/collection/components/calcite-action/calcite-action.css +17 -68
- package/dist/collection/components/calcite-action/calcite-action.js +34 -31
- package/dist/collection/components/calcite-action/resources.js +4 -0
- package/dist/collection/components/calcite-action-bar/calcite-action-bar.js +4 -0
- package/dist/collection/components/calcite-action-bar/resources.js +4 -0
- package/dist/collection/components/calcite-action-bar/utils.js +4 -0
- package/dist/collection/components/calcite-action-group/calcite-action-group.js +4 -0
- package/dist/collection/components/calcite-action-group/resources.js +4 -0
- package/dist/collection/components/calcite-action-menu/calcite-action-menu.js +8 -2
- package/dist/collection/components/calcite-action-menu/resources.js +4 -0
- package/dist/collection/components/calcite-action-pad/calcite-action-pad.js +4 -0
- package/dist/collection/components/calcite-action-pad/resources.js +4 -0
- package/dist/collection/components/calcite-alert/calcite-alert.css +0 -62
- package/dist/collection/components/calcite-alert/calcite-alert.js +4 -0
- package/dist/collection/components/calcite-alert/interfaces.js +4 -0
- package/dist/collection/components/calcite-alert/resources.js +4 -0
- package/dist/collection/components/calcite-avatar/calcite-avatar.js +4 -0
- package/dist/collection/components/calcite-avatar/utils.js +4 -0
- package/dist/collection/components/calcite-block/calcite-block.css +18 -0
- package/dist/collection/components/calcite-block/calcite-block.js +11 -6
- package/dist/collection/components/calcite-block/resources.js +8 -2
- package/dist/collection/components/calcite-block-section/calcite-block-section.css +1 -0
- package/dist/collection/components/calcite-block-section/calcite-block-section.js +4 -0
- package/dist/collection/components/calcite-block-section/interfaces.js +4 -0
- package/dist/collection/components/calcite-block-section/resources.js +4 -0
- package/dist/collection/components/calcite-button/calcite-button.js +35 -35
- package/dist/collection/components/calcite-button/interfaces.js +4 -0
- package/dist/collection/components/calcite-button/resources.js +4 -0
- package/dist/collection/components/calcite-card/calcite-card.js +4 -0
- package/dist/collection/components/calcite-card/resources.js +4 -0
- package/dist/collection/components/calcite-checkbox/calcite-checkbox.css +4 -1
- package/dist/collection/components/calcite-checkbox/calcite-checkbox.js +8 -4
- package/dist/collection/components/calcite-chip/calcite-chip.js +4 -0
- package/dist/collection/components/calcite-chip/interfaces.js +4 -0
- package/dist/collection/components/calcite-chip/resources.js +4 -0
- package/dist/collection/components/calcite-color-picker/calcite-color-picker.js +4 -0
- package/dist/collection/components/calcite-color-picker/interfaces.js +4 -0
- package/dist/collection/components/calcite-color-picker/resources.js +4 -0
- package/dist/collection/components/calcite-color-picker/utils.js +4 -0
- package/dist/collection/components/calcite-color-picker-hex-input/calcite-color-picker-hex-input.js +4 -0
- package/dist/collection/components/calcite-color-picker-hex-input/resources.js +4 -0
- package/dist/collection/components/calcite-color-picker-swatch/calcite-color-picker-swatch.js +4 -0
- package/dist/collection/components/calcite-color-picker-swatch/resources.js +4 -0
- package/dist/collection/components/calcite-combobox/calcite-combobox.css +17 -4
- package/dist/collection/components/calcite-combobox/calcite-combobox.js +19 -14
- package/dist/collection/components/calcite-combobox/interfaces.js +4 -0
- package/dist/collection/components/calcite-combobox/resources.js +4 -0
- package/dist/collection/components/calcite-combobox/utils.js +4 -0
- package/dist/collection/components/calcite-combobox-item/calcite-combobox-item.css +1 -1
- package/dist/collection/components/calcite-combobox-item/calcite-combobox-item.js +4 -0
- package/dist/collection/components/calcite-combobox-item/resources.js +4 -0
- package/dist/collection/components/calcite-combobox-item-group/calcite-combobox-item-group.js +4 -0
- package/dist/collection/components/calcite-combobox-item-group/resources.js +4 -0
- package/dist/collection/components/calcite-date-picker/calcite-date-picker.js +4 -0
- package/dist/collection/components/calcite-date-picker/interfaces.js +4 -0
- package/dist/collection/components/calcite-date-picker/resources.js +4 -0
- package/dist/collection/components/calcite-date-picker/utils.js +4 -0
- package/dist/collection/components/calcite-date-picker-day/calcite-date-picker-day.css +1 -1
- package/dist/collection/components/calcite-date-picker-day/calcite-date-picker-day.js +4 -0
- package/dist/collection/components/calcite-date-picker-month/calcite-date-picker-month.css +1 -1
- package/dist/collection/components/calcite-date-picker-month/calcite-date-picker-month.js +4 -0
- package/dist/collection/components/calcite-date-picker-month-header/calcite-date-picker-month-header.css +1 -1
- package/dist/collection/components/calcite-date-picker-month-header/calcite-date-picker-month-header.js +4 -0
- package/dist/collection/components/calcite-dropdown/calcite-dropdown.js +42 -31
- package/dist/collection/components/calcite-dropdown/interfaces.js +4 -0
- package/dist/collection/components/calcite-dropdown/resources.js +4 -0
- package/dist/collection/components/calcite-dropdown-group/calcite-dropdown-group.js +4 -0
- package/dist/collection/components/calcite-dropdown-group/interfaces.js +4 -0
- package/dist/collection/components/calcite-dropdown-group/resources.js +4 -0
- package/dist/collection/components/calcite-dropdown-item/calcite-dropdown-item.js +4 -0
- package/dist/collection/components/calcite-dropdown-item/resources.js +4 -0
- package/dist/collection/components/calcite-fab/calcite-fab.js +4 -0
- package/dist/collection/components/calcite-fab/resources.js +4 -0
- package/dist/collection/components/calcite-filter/calcite-filter.js +5 -1
- package/dist/collection/components/calcite-filter/resources.js +4 -0
- package/dist/collection/components/calcite-flow/calcite-flow.js +4 -0
- package/dist/collection/components/calcite-flow/interfaces.js +4 -0
- package/dist/collection/components/calcite-flow/resources.js +4 -0
- package/dist/collection/components/calcite-graph/calcite-graph.js +4 -0
- package/dist/collection/components/calcite-graph/interfaces.js +4 -0
- package/dist/collection/components/calcite-graph/util.js +4 -0
- package/dist/collection/components/calcite-handle/calcite-handle.js +4 -0
- package/dist/collection/components/calcite-handle/resources.js +4 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMark16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMark24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMark32.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMarkPlus16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMarkPlus24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/penMarkPlus32.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/subscript16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/subscript24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/subscript32.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/superscript16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/superscript24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/superscript32.json +1 -0
- package/dist/collection/components/calcite-icon/calcite-icon.js +4 -0
- package/dist/collection/components/calcite-icon/resources.js +4 -0
- package/dist/collection/components/calcite-icon/utils.js +4 -0
- package/dist/collection/components/calcite-inline-editable/calcite-inline-editable.js +9 -4
- package/dist/collection/components/calcite-inline-editable/resources.js +4 -0
- package/dist/collection/components/calcite-input/calcite-input.js +18 -19
- package/dist/collection/components/calcite-input/interfaces.js +4 -0
- package/dist/collection/components/calcite-input/resources.js +4 -0
- package/dist/collection/components/calcite-input-date-picker/calcite-input-date-picker.js +12 -8
- package/dist/collection/components/calcite-input-message/calcite-input-message.js +4 -0
- package/dist/collection/components/calcite-input-message/interfaces.js +4 -0
- package/dist/collection/components/calcite-input-time-picker/calcite-input-time-picker.js +14 -10
- package/dist/collection/components/calcite-label/calcite-label.js +4 -0
- package/dist/collection/components/calcite-label/resources.js +4 -0
- package/dist/collection/components/calcite-link/calcite-link.js +15 -1
- package/dist/collection/components/calcite-list/calcite-list.js +37 -1
- package/dist/collection/components/calcite-list/resources.js +4 -0
- package/dist/collection/components/calcite-list-item/calcite-list-item.js +34 -2
- package/dist/collection/components/calcite-list-item/resources.js +4 -0
- package/dist/collection/components/calcite-list-item-group/calcite-list-item-group.js +4 -0
- package/dist/collection/components/calcite-list-item-group/resources.js +4 -0
- package/dist/collection/components/calcite-loader/calcite-loader.css +3 -3
- package/dist/collection/components/calcite-loader/calcite-loader.js +4 -0
- package/dist/collection/components/calcite-modal/calcite-modal.js +4 -0
- package/dist/collection/components/calcite-modal/interfaces.js +4 -0
- package/dist/collection/components/calcite-modal/resources.js +4 -0
- package/dist/collection/components/calcite-notice/calcite-notice.css +18 -6
- package/dist/collection/components/calcite-notice/calcite-notice.js +4 -0
- package/dist/collection/components/calcite-notice/resources.js +4 -0
- package/dist/collection/components/calcite-option/calcite-option.js +4 -0
- package/dist/collection/components/calcite-option-group/calcite-option-group.js +4 -0
- package/dist/collection/components/calcite-pagination/calcite-pagination.js +4 -0
- package/dist/collection/components/calcite-pagination/resources.js +4 -0
- package/dist/collection/components/calcite-panel/calcite-panel.js +4 -0
- package/dist/collection/components/calcite-panel/resources.js +4 -0
- package/dist/collection/components/calcite-pick-list/calcite-pick-list.js +4 -0
- package/dist/collection/components/calcite-pick-list/resources.js +4 -0
- package/dist/collection/components/calcite-pick-list/shared-list-logic.js +4 -0
- package/dist/collection/components/calcite-pick-list/shared-list-render.js +4 -0
- package/dist/collection/components/calcite-pick-list-group/calcite-pick-list-group.js +4 -0
- package/dist/collection/components/calcite-pick-list-group/resources.js +4 -0
- package/dist/collection/components/calcite-pick-list-item/calcite-pick-list-item.js +4 -0
- package/dist/collection/components/calcite-pick-list-item/resources.js +4 -0
- package/dist/collection/components/calcite-popover/calcite-popover.js +4 -0
- package/dist/collection/components/calcite-popover/resources.js +4 -0
- package/dist/collection/components/calcite-popover-manager/calcite-popover-manager.js +4 -0
- package/dist/collection/components/calcite-progress/calcite-progress.js +4 -0
- package/dist/collection/components/calcite-radio/calcite-radio.js +4 -0
- package/dist/collection/components/calcite-radio-button/calcite-radio-button.js +19 -15
- package/dist/collection/components/calcite-radio-button/resources.js +4 -0
- package/dist/collection/components/calcite-radio-button-group/calcite-radio-button-group.js +4 -0
- package/dist/collection/components/calcite-radio-group/calcite-radio-group.js +12 -8
- package/dist/collection/components/calcite-radio-group/interfaces.js +4 -0
- package/dist/collection/components/calcite-radio-group-item/calcite-radio-group-item.css +1 -5
- package/dist/collection/components/calcite-radio-group-item/calcite-radio-group-item.js +4 -0
- package/dist/collection/components/calcite-radio-group-item/resources.js +4 -0
- package/dist/collection/components/calcite-rating/calcite-rating.js +12 -8
- package/dist/collection/components/calcite-rating/resources.js +4 -0
- package/dist/collection/components/calcite-scrim/calcite-scrim.js +4 -0
- package/dist/collection/components/calcite-scrim/resources.js +4 -0
- package/dist/collection/components/calcite-select/calcite-select.js +12 -8
- package/dist/collection/components/calcite-select/resources.js +4 -0
- package/dist/collection/components/calcite-shell/calcite-shell.js +4 -0
- package/dist/collection/components/calcite-shell/resources.js +4 -0
- package/dist/collection/components/calcite-shell-center-row/calcite-shell-center-row.js +4 -0
- package/dist/collection/components/calcite-shell-center-row/resources.js +4 -0
- package/dist/collection/components/calcite-shell-panel/calcite-shell-panel.js +4 -0
- package/dist/collection/components/calcite-shell-panel/resources.js +4 -0
- package/dist/collection/components/calcite-slider/calcite-slider.js +13 -9
- package/dist/collection/components/calcite-sortable-list/calcite-sortable-list.js +4 -0
- package/dist/collection/components/calcite-sortable-list/resources.js +4 -0
- package/dist/collection/components/calcite-split-button/calcite-split-button.js +4 -0
- package/dist/collection/components/calcite-split-button/resources.js +4 -0
- package/dist/collection/components/calcite-stepper/calcite-stepper.js +4 -0
- package/dist/collection/components/calcite-stepper-item/calcite-stepper-item.js +4 -0
- package/dist/collection/components/calcite-switch/calcite-switch.js +15 -11
- package/dist/collection/components/calcite-tab/calcite-tab.js +4 -0
- package/dist/collection/components/calcite-tab/interfaces.js +4 -0
- package/dist/collection/components/calcite-tab-nav/calcite-tab-nav.js +4 -0
- package/dist/collection/components/calcite-tab-title/calcite-tab-title.js +4 -0
- package/dist/collection/components/calcite-tabs/calcite-tabs.js +4 -0
- package/dist/collection/components/calcite-tabs/interfaces.js +4 -0
- package/dist/collection/components/calcite-tabs/resources.js +4 -0
- package/dist/collection/components/calcite-tile/calcite-tile.js +4 -0
- package/dist/collection/components/calcite-tile/resources.js +4 -0
- package/dist/collection/components/calcite-tile-select/calcite-tile-select.js +4 -0
- package/dist/collection/components/calcite-tile-select/interfaces.js +4 -0
- package/dist/collection/components/calcite-tile-select-group/calcite-tile-select-group.js +4 -0
- package/dist/collection/components/calcite-tile-select-group/interfaces.js +4 -0
- package/dist/collection/components/calcite-time-picker/calcite-time-picker.js +4 -0
- package/dist/collection/components/calcite-time-picker/resources.js +4 -0
- package/dist/collection/components/calcite-tip/calcite-tip.js +4 -0
- package/dist/collection/components/calcite-tip/resources.js +4 -0
- package/dist/collection/components/calcite-tip-group/calcite-tip-group.js +4 -0
- package/dist/collection/components/calcite-tip-manager/calcite-tip-manager.js +4 -0
- package/dist/collection/components/calcite-tip-manager/resources.js +4 -0
- package/dist/collection/components/calcite-tooltip/calcite-tooltip.js +4 -0
- package/dist/collection/components/calcite-tooltip/resources.js +4 -0
- package/dist/collection/components/calcite-tooltip-manager/calcite-tooltip-manager.js +7 -2
- package/dist/collection/components/calcite-tree/calcite-tree.js +4 -0
- package/dist/collection/components/calcite-tree/interfaces.js +4 -0
- package/dist/collection/components/calcite-tree-item/calcite-tree-item.js +4 -0
- package/dist/collection/components/calcite-tree-item/interfaces.js +4 -0
- package/dist/collection/components/calcite-tree-item/resources.js +4 -0
- package/dist/collection/components/calcite-value-list/calcite-value-list.js +4 -0
- package/dist/collection/components/calcite-value-list/resources.js +4 -0
- package/dist/collection/components/calcite-value-list-item/calcite-value-list-item.js +4 -0
- package/dist/collection/components/calcite-value-list-item/resources.js +4 -0
- package/dist/collection/components/functional/CalciteExpandToggle.js +4 -0
- package/dist/collection/components/functional/CalciteHeading.js +4 -0
- package/dist/collection/components/interfaces.js +4 -0
- package/dist/collection/utils/array.js +4 -0
- package/dist/collection/utils/date.js +4 -0
- package/dist/collection/utils/dom.js +4 -0
- package/dist/collection/utils/filter.js +4 -0
- package/dist/collection/utils/form.js +4 -0
- package/dist/collection/utils/guid.js +4 -0
- package/dist/collection/utils/key.js +4 -0
- package/dist/collection/utils/label.js +8 -4
- package/dist/collection/utils/locale.js +4 -0
- package/dist/collection/utils/math.js +4 -0
- package/dist/collection/utils/number.js +4 -3
- package/dist/collection/utils/observers.js +4 -0
- package/dist/collection/utils/popper.js +4 -0
- package/dist/collection/utils/resources.js +4 -0
- package/dist/collection/utils/time.js +4 -0
- package/dist/components/CalciteExpandToggle.js +87 -0
- package/dist/components/CalciteHeading.js +16 -0
- package/dist/components/array.js +9 -0
- package/dist/components/calcite-accordion-item.d.ts +11 -0
- package/dist/components/calcite-accordion-item.js +153 -0
- package/dist/components/calcite-accordion.d.ts +11 -0
- package/dist/components/calcite-accordion.js +167 -0
- package/dist/components/calcite-action-bar.d.ts +11 -0
- package/dist/components/calcite-action-bar.js +266 -0
- package/dist/components/calcite-action-group.d.ts +11 -0
- package/dist/components/calcite-action-group.js +10 -0
- package/dist/components/calcite-action-group2.js +135 -0
- package/dist/components/calcite-action-menu.d.ts +11 -0
- package/dist/components/calcite-action-menu.js +10 -0
- package/dist/components/calcite-action-menu2.js +354 -0
- package/dist/components/calcite-action-pad.d.ts +11 -0
- package/dist/components/calcite-action-pad.js +198 -0
- package/dist/components/calcite-action.d.ts +11 -0
- package/dist/components/calcite-action.js +10 -0
- package/dist/components/calcite-action2.js +183 -0
- package/dist/components/calcite-alert.d.ts +11 -0
- package/dist/components/calcite-alert.js +232 -0
- package/dist/components/calcite-avatar.d.ts +11 -0
- package/dist/components/calcite-avatar.js +171 -0
- package/dist/components/calcite-block-section.d.ts +11 -0
- package/dist/components/calcite-block-section.js +139 -0
- package/dist/components/calcite-block.d.ts +11 -0
- package/dist/components/calcite-block.js +216 -0
- package/dist/components/calcite-button.d.ts +11 -0
- package/dist/components/calcite-button.js +10 -0
- package/dist/components/calcite-button2.js +243 -0
- package/dist/components/calcite-card.d.ts +11 -0
- package/dist/components/calcite-card.js +156 -0
- package/dist/components/calcite-checkbox.d.ts +11 -0
- package/dist/components/calcite-checkbox.js +10 -0
- package/dist/components/calcite-checkbox2.js +203 -0
- package/dist/components/calcite-chip.d.ts +11 -0
- package/dist/components/calcite-chip.js +10 -0
- package/dist/components/calcite-chip2.js +121 -0
- package/dist/components/calcite-color-picker-hex-input.d.ts +11 -0
- package/dist/components/calcite-color-picker-hex-input.js +10 -0
- package/dist/components/calcite-color-picker-hex-input2.js +353 -0
- package/dist/components/calcite-color-picker-swatch.d.ts +11 -0
- package/dist/components/calcite-color-picker-swatch.js +10 -0
- package/dist/components/calcite-color-picker-swatch2.js +2176 -0
- package/dist/components/calcite-color-picker.d.ts +11 -0
- package/dist/components/calcite-color-picker.js +966 -0
- package/dist/components/calcite-combobox-item-group.d.ts +11 -0
- package/dist/components/calcite-combobox-item-group.js +68 -0
- package/dist/components/calcite-combobox-item.d.ts +11 -0
- package/dist/components/calcite-combobox-item.js +168 -0
- package/dist/components/calcite-combobox.d.ts +11 -0
- package/dist/components/calcite-combobox.js +871 -0
- package/dist/components/calcite-date-picker-day.d.ts +11 -0
- package/dist/components/calcite-date-picker-day.js +10 -0
- package/dist/components/calcite-date-picker-day2.js +99 -0
- package/dist/components/calcite-date-picker-month-header.d.ts +11 -0
- package/dist/components/calcite-date-picker-month-header.js +10 -0
- package/dist/components/calcite-date-picker-month-header2.js +170 -0
- package/dist/components/calcite-date-picker-month.d.ts +11 -0
- package/dist/components/calcite-date-picker-month.js +10 -0
- package/dist/components/calcite-date-picker-month2.js +313 -0
- package/dist/components/calcite-date-picker.d.ts +11 -0
- package/dist/components/calcite-date-picker.js +10 -0
- package/dist/components/calcite-date-picker2.js +486 -0
- package/dist/components/calcite-dropdown-group.d.ts +11 -0
- package/dist/components/calcite-dropdown-group.js +90 -0
- package/dist/components/calcite-dropdown-item.d.ts +11 -0
- package/dist/components/calcite-dropdown-item.js +202 -0
- package/dist/components/calcite-dropdown.d.ts +11 -0
- package/dist/components/calcite-dropdown.js +10 -0
- package/dist/components/calcite-dropdown2.js +390 -0
- package/dist/components/calcite-fab.d.ts +11 -0
- package/dist/components/calcite-fab.js +127 -0
- package/dist/components/calcite-filter.d.ts +11 -0
- package/dist/components/calcite-filter.js +10 -0
- package/dist/components/calcite-filter2.js +165 -0
- package/dist/components/calcite-flow.d.ts +11 -0
- package/dist/components/calcite-flow.js +138 -0
- package/dist/components/calcite-graph.d.ts +11 -0
- package/dist/components/calcite-graph.js +10 -0
- package/dist/components/calcite-graph2.js +203 -0
- package/dist/components/calcite-handle.d.ts +11 -0
- package/dist/components/calcite-handle.js +10 -0
- package/dist/components/calcite-handle2.js +107 -0
- package/dist/components/calcite-icon.d.ts +11 -0
- package/dist/components/calcite-icon.js +10 -0
- package/dist/components/calcite-icon2.js +185 -0
- package/dist/components/calcite-inline-editable.d.ts +11 -0
- package/dist/components/calcite-inline-editable.js +242 -0
- package/dist/components/calcite-input-date-picker.d.ts +11 -0
- package/dist/components/calcite-input-date-picker.js +471 -0
- package/dist/components/calcite-input-message.d.ts +11 -0
- package/dist/components/calcite-input-message.js +97 -0
- package/dist/components/calcite-input-time-picker.d.ts +11 -0
- package/dist/components/calcite-input-time-picker.js +278 -0
- package/dist/components/calcite-input.d.ts +11 -0
- package/dist/components/calcite-input.js +10 -0
- package/dist/components/calcite-input2.js +494 -0
- package/dist/components/calcite-label.d.ts +11 -0
- package/dist/components/calcite-label.js +84 -0
- package/dist/components/calcite-link.d.ts +11 -0
- package/dist/components/calcite-link.js +10 -0
- package/dist/components/calcite-link2.js +97 -0
- package/dist/components/calcite-list-item-group.d.ts +11 -0
- package/dist/components/calcite-list-item-group.js +57 -0
- package/dist/components/calcite-list-item.d.ts +11 -0
- package/dist/components/calcite-list-item.js +117 -0
- package/dist/components/calcite-list.d.ts +11 -0
- package/dist/components/calcite-list.js +59 -0
- package/dist/components/calcite-loader.d.ts +11 -0
- package/dist/components/calcite-loader.js +10 -0
- package/dist/components/calcite-loader2.js +107 -0
- package/dist/components/calcite-modal.d.ts +11 -0
- package/dist/components/calcite-modal.js +417 -0
- package/dist/components/calcite-notice.d.ts +11 -0
- package/dist/components/calcite-notice.js +140 -0
- package/dist/components/calcite-option-group.d.ts +11 -0
- package/dist/components/calcite-option-group.js +61 -0
- package/dist/components/calcite-option.d.ts +11 -0
- package/dist/components/calcite-option.js +107 -0
- package/dist/components/calcite-pagination.d.ts +11 -0
- package/dist/components/calcite-pagination.js +207 -0
- package/dist/components/calcite-panel.d.ts +11 -0
- package/dist/components/calcite-panel.js +309 -0
- package/dist/components/calcite-pick-list-group.d.ts +11 -0
- package/dist/components/calcite-pick-list-group.js +70 -0
- package/dist/components/calcite-pick-list-item.d.ts +11 -0
- package/dist/components/calcite-pick-list-item.js +10 -0
- package/dist/components/calcite-pick-list-item2.js +230 -0
- package/dist/components/calcite-pick-list.d.ts +11 -0
- package/dist/components/calcite-pick-list.js +196 -0
- package/dist/components/calcite-popover-manager.d.ts +11 -0
- package/dist/components/calcite-popover-manager.js +93 -0
- package/dist/components/calcite-popover.d.ts +11 -0
- package/dist/components/calcite-popover.js +10 -0
- package/dist/components/calcite-popover2.js +332 -0
- package/dist/components/calcite-progress.d.ts +11 -0
- package/dist/components/calcite-progress.js +10 -0
- package/dist/components/calcite-progress2.js +52 -0
- package/dist/components/calcite-radio-button-group.d.ts +11 -0
- package/dist/components/calcite-radio-button-group.js +116 -0
- package/dist/components/calcite-radio-button.d.ts +11 -0
- package/dist/components/calcite-radio-button.js +291 -0
- package/dist/components/calcite-radio-group-item.d.ts +11 -0
- package/dist/components/calcite-radio-group-item.js +139 -0
- package/dist/components/calcite-radio-group.d.ts +11 -0
- package/dist/components/calcite-radio-group.js +233 -0
- package/dist/components/calcite-radio.d.ts +11 -0
- package/dist/components/calcite-radio.js +10 -0
- package/dist/components/calcite-radio2.js +68 -0
- package/dist/components/calcite-rating.d.ts +11 -0
- package/dist/components/calcite-rating.js +160 -0
- package/dist/components/calcite-scrim.d.ts +11 -0
- package/dist/components/calcite-scrim.js +10 -0
- package/dist/components/calcite-scrim2.js +74 -0
- package/dist/components/calcite-select.d.ts +11 -0
- package/dist/components/calcite-select.js +221 -0
- package/dist/components/calcite-shell-center-row.d.ts +11 -0
- package/dist/components/calcite-shell-center-row.js +81 -0
- package/dist/components/calcite-shell-panel.d.ts +11 -0
- package/dist/components/calcite-shell-panel.js +100 -0
- package/dist/components/calcite-shell.d.ts +11 -0
- package/dist/components/calcite-shell.js +99 -0
- package/dist/components/calcite-slider.d.ts +11 -0
- package/dist/components/calcite-slider.js +746 -0
- package/dist/components/calcite-sortable-list.d.ts +11 -0
- package/dist/components/calcite-sortable-list.js +190 -0
- package/dist/components/calcite-split-button.d.ts +11 -0
- package/dist/components/calcite-split-button.js +127 -0
- package/dist/components/calcite-stepper-item.d.ts +11 -0
- package/dist/components/calcite-stepper-item.js +189 -0
- package/dist/components/calcite-stepper.d.ts +11 -0
- package/dist/components/calcite-stepper.js +247 -0
- package/dist/components/calcite-switch.d.ts +11 -0
- package/dist/components/calcite-switch.js +10 -0
- package/dist/components/calcite-switch2.js +162 -0
- package/dist/components/calcite-tab-nav.d.ts +11 -0
- package/dist/components/calcite-tab-nav.js +10 -0
- package/dist/components/calcite-tab-nav2.js +209 -0
- package/dist/components/calcite-tab-title.d.ts +11 -0
- package/dist/components/calcite-tab-title.js +10 -0
- package/dist/components/calcite-tab-title2.js +230 -0
- package/dist/components/calcite-tab.d.ts +11 -0
- package/dist/components/calcite-tab.js +10 -0
- package/dist/components/calcite-tab2.js +122 -0
- package/dist/components/calcite-tabs.d.ts +11 -0
- package/dist/components/calcite-tabs.js +10 -0
- package/dist/components/calcite-tabs2.js +183 -0
- package/dist/components/calcite-tile-select-group.d.ts +11 -0
- package/dist/components/calcite-tile-select-group.js +45 -0
- package/dist/components/calcite-tile-select.d.ts +11 -0
- package/dist/components/calcite-tile-select.js +218 -0
- package/dist/components/calcite-tile.d.ts +11 -0
- package/dist/components/calcite-tile.js +10 -0
- package/dist/components/calcite-tile2.js +98 -0
- package/dist/components/calcite-time-picker.d.ts +11 -0
- package/dist/components/calcite-time-picker.js +10 -0
- package/dist/components/calcite-time-picker2.js +707 -0
- package/dist/components/calcite-tip-group.d.ts +11 -0
- package/dist/components/calcite-tip-group.js +38 -0
- package/dist/components/calcite-tip-manager.d.ts +11 -0
- package/dist/components/calcite-tip-manager.js +218 -0
- package/dist/components/calcite-tip.d.ts +11 -0
- package/dist/components/calcite-tip.js +140 -0
- package/dist/components/calcite-tooltip-manager.d.ts +11 -0
- package/dist/components/calcite-tooltip-manager.js +10 -0
- package/dist/components/calcite-tooltip-manager2.js +168 -0
- package/dist/components/calcite-tooltip.d.ts +11 -0
- package/dist/components/calcite-tooltip.js +224 -0
- package/dist/components/calcite-tree-item.d.ts +11 -0
- package/dist/components/calcite-tree-item.js +303 -0
- package/dist/components/calcite-tree.d.ts +11 -0
- package/dist/components/calcite-tree.js +216 -0
- package/dist/components/calcite-value-list-item.d.ts +11 -0
- package/dist/components/calcite-value-list-item.js +180 -0
- package/dist/components/calcite-value-list.d.ts +11 -0
- package/dist/components/calcite-value-list.js +271 -0
- package/dist/components/date.js +159 -0
- package/dist/components/debounce.js +486 -0
- package/dist/components/dom.js +153 -0
- package/dist/components/forIn.js +619 -0
- package/dist/components/form.js +20 -0
- package/dist/components/guid.js +18 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +5 -0
- package/dist/components/interfaces.js +13 -0
- package/dist/components/interfaces2.js +14 -0
- package/dist/components/key.js +33 -0
- package/dist/components/label.js +54 -0
- package/dist/components/locale.js +118 -0
- package/dist/components/math.js +7 -0
- package/dist/components/number.js +40 -0
- package/dist/components/observers.js +22 -0
- package/dist/components/popper.js +1785 -0
- package/dist/components/resources.js +24 -0
- package/dist/components/resources2.js +13 -0
- package/dist/components/resources3.js +18 -0
- package/dist/components/resources4.js +32 -0
- package/dist/components/shared-list-render.js +286 -0
- package/dist/components/sortable.esm.js +3017 -0
- package/dist/components/utils.js +113 -0
- package/dist/components/utils2.js +38 -0
- package/dist/custom-elements/index.js +298 -249
- package/dist/esm/CalciteExpandToggle-151a563a.js +87 -0
- package/dist/esm/CalciteHeading-1735f17a.js +16 -0
- package/dist/esm/array-91a648e2.js +9 -0
- package/dist/esm/calcite-accordion_2.entry.js +8 -4
- package/dist/esm/calcite-action-bar.entry.js +12 -8
- package/dist/esm/calcite-action-group.entry.js +9 -5
- package/dist/esm/calcite-action-menu.entry.js +14 -8
- package/dist/esm/calcite-action-pad.entry.js +10 -6
- package/dist/esm/calcite-action.entry.js +11 -11
- package/dist/esm/calcite-alert.entry.js +9 -5
- package/dist/esm/calcite-avatar.entry.js +8 -4
- package/dist/esm/calcite-block_2.entry.js +21 -14
- package/dist/esm/calcite-button.entry.js +59 -38
- package/dist/esm/calcite-card.entry.js +8 -4
- package/dist/esm/calcite-checkbox.entry.js +14 -10
- package/dist/esm/calcite-chip.entry.js +7 -3
- package/dist/esm/calcite-color-picker_3.entry.js +11 -7
- package/dist/esm/calcite-combobox_3.entry.js +25 -21
- package/dist/esm/calcite-date-picker_4.entry.js +15 -11
- package/dist/esm/calcite-dropdown_3.entry.js +45 -36
- package/dist/esm/calcite-fab.entry.js +7 -3
- package/dist/esm/calcite-filter.entry.js +10 -6
- package/dist/esm/calcite-flow.entry.js +6 -2
- package/dist/esm/calcite-graph_2.entry.js +19 -15
- package/dist/esm/calcite-handle.entry.js +5 -1
- package/dist/esm/calcite-icon.entry.js +8 -4
- package/dist/esm/calcite-inline-editable.entry.js +12 -7
- package/dist/esm/calcite-input-date-picker.entry.js +21 -17
- package/dist/esm/calcite-input-message.entry.js +7 -3
- package/dist/esm/calcite-input-time-picker_2.entry.js +19 -15
- package/dist/esm/calcite-input.entry.js +25 -26
- package/dist/esm/calcite-label.entry.js +7 -3
- package/dist/esm/calcite-link.entry.js +13 -3
- package/dist/esm/calcite-list_3.entry.js +30 -5
- package/dist/esm/calcite-loader.entry.js +7 -3
- package/dist/esm/calcite-modal.entry.js +9 -5
- package/dist/esm/calcite-notice.entry.js +9 -5
- package/dist/esm/calcite-option_3.entry.js +17 -13
- package/dist/esm/calcite-pagination.entry.js +7 -3
- package/dist/esm/calcite-panel.entry.js +9 -5
- package/dist/esm/calcite-pick-list_3.entry.js +12 -8
- package/dist/esm/calcite-popover_2.entry.js +9 -5
- package/dist/esm/calcite-progress.entry.js +5 -1
- package/dist/esm/calcite-radio-button-group.entry.js +5 -1
- package/dist/esm/calcite-radio-group_2.entry.js +19 -15
- package/dist/esm/calcite-radio_2.entry.js +24 -20
- package/dist/esm/calcite-rating.entry.js +16 -12
- package/dist/esm/calcite-scrim.entry.js +5 -1
- package/dist/esm/calcite-shell_3.entry.js +7 -3
- package/dist/esm/calcite-sortable-list.entry.js +7 -3
- package/dist/esm/calcite-split-button.entry.js +7 -3
- package/dist/esm/calcite-stepper_2.entry.js +8 -4
- package/dist/esm/calcite-switch.entry.js +21 -17
- package/dist/esm/calcite-tab_4.entry.js +9 -5
- package/dist/esm/calcite-tile-select_2.entry.js +7 -3
- package/dist/esm/calcite-tile.entry.js +7 -3
- package/dist/esm/calcite-tip_3.entry.js +9 -5
- package/dist/esm/calcite-tooltip_2.entry.js +12 -7
- package/dist/esm/calcite-tree_2.entry.js +8 -4
- package/dist/esm/calcite-value-list_2.entry.js +12 -8
- package/dist/esm/calcite.js +6 -2
- package/dist/esm/debounce-79648d42.js +486 -0
- package/dist/esm/dom-f24e866c.js +153 -0
- package/dist/esm/forIn-48d8fb84.js +619 -0
- package/dist/esm/form-cee9f632.js +20 -0
- package/dist/esm/guid-196bd5ea.js +18 -0
- package/dist/esm/index-d653c37f.js +2033 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/interfaces-51dc4e1b.js +13 -0
- package/dist/esm/key-69001a68.js +33 -0
- package/dist/esm/label-bb61bdef.js +54 -0
- package/dist/esm/loader.js +6 -2
- package/dist/esm/locale-6c1b85c7.js +118 -0
- package/dist/esm/math-250d4476.js +7 -0
- package/dist/esm/number-e7393766.js +40 -0
- package/dist/esm/observers-8f0bc419.js +20 -0
- package/dist/esm/popper-7499ea4f.js +1785 -0
- package/dist/esm/resources-3b481489.js +216 -0
- package/dist/esm/resources-510eed1a.js +325 -0
- package/dist/esm/resources-584acd9b.js +17 -0
- package/dist/esm/resources-7c6029b6.js +16 -0
- package/dist/esm/sortable.esm-04824d33.js +3017 -0
- package/dist/esm/utils-6beb0662.js +113 -0
- package/dist/esm-es5/CalciteExpandToggle-151a563a.js +5 -0
- package/dist/esm-es5/CalciteHeading-1735f17a.js +5 -0
- package/dist/esm-es5/array-91a648e2.js +5 -0
- package/dist/esm-es5/calcite-accordion_2.entry.js +5 -1
- package/dist/esm-es5/calcite-action-bar.entry.js +5 -1
- package/dist/esm-es5/calcite-action-group.entry.js +5 -1
- package/dist/esm-es5/calcite-action-menu.entry.js +5 -1
- package/dist/esm-es5/calcite-action-pad.entry.js +5 -1
- package/dist/esm-es5/calcite-action.entry.js +5 -1
- package/dist/esm-es5/calcite-alert.entry.js +5 -1
- package/dist/esm-es5/calcite-avatar.entry.js +5 -1
- package/dist/esm-es5/calcite-block_2.entry.js +5 -1
- package/dist/esm-es5/calcite-button.entry.js +5 -1
- package/dist/esm-es5/calcite-card.entry.js +5 -1
- package/dist/esm-es5/calcite-checkbox.entry.js +5 -1
- package/dist/esm-es5/calcite-chip.entry.js +5 -1
- package/dist/esm-es5/calcite-color-picker_3.entry.js +5 -1
- package/dist/esm-es5/calcite-combobox_3.entry.js +5 -1
- package/dist/esm-es5/calcite-date-picker_4.entry.js +5 -1
- package/dist/esm-es5/calcite-dropdown_3.entry.js +5 -1
- package/dist/esm-es5/calcite-fab.entry.js +5 -1
- package/dist/esm-es5/calcite-filter.entry.js +5 -1
- package/dist/esm-es5/calcite-flow.entry.js +5 -1
- package/dist/esm-es5/calcite-graph_2.entry.js +5 -1
- package/dist/esm-es5/calcite-handle.entry.js +5 -1
- package/dist/esm-es5/calcite-icon.entry.js +5 -1
- package/dist/esm-es5/calcite-inline-editable.entry.js +5 -1
- package/dist/esm-es5/calcite-input-date-picker.entry.js +5 -1
- package/dist/esm-es5/calcite-input-message.entry.js +5 -1
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +5 -1
- package/dist/esm-es5/calcite-input.entry.js +5 -1
- package/dist/esm-es5/calcite-label.entry.js +5 -1
- package/dist/esm-es5/calcite-link.entry.js +5 -1
- package/dist/esm-es5/calcite-list_3.entry.js +5 -1
- package/dist/esm-es5/calcite-loader.entry.js +5 -1
- package/dist/esm-es5/calcite-modal.entry.js +5 -1
- package/dist/esm-es5/calcite-notice.entry.js +5 -1
- package/dist/esm-es5/calcite-option_3.entry.js +5 -1
- package/dist/esm-es5/calcite-pagination.entry.js +5 -1
- package/dist/esm-es5/calcite-panel.entry.js +5 -1
- package/dist/esm-es5/calcite-pick-list_3.entry.js +5 -1
- package/dist/esm-es5/calcite-popover_2.entry.js +5 -1
- package/dist/esm-es5/calcite-progress.entry.js +5 -1
- package/dist/esm-es5/calcite-radio-button-group.entry.js +5 -1
- package/dist/esm-es5/calcite-radio-group_2.entry.js +5 -1
- package/dist/esm-es5/calcite-radio_2.entry.js +5 -1
- package/dist/esm-es5/calcite-rating.entry.js +5 -1
- package/dist/esm-es5/calcite-scrim.entry.js +5 -1
- package/dist/esm-es5/calcite-shell_3.entry.js +5 -1
- package/dist/esm-es5/calcite-sortable-list.entry.js +5 -1
- package/dist/esm-es5/calcite-split-button.entry.js +5 -1
- package/dist/esm-es5/calcite-stepper_2.entry.js +5 -1
- package/dist/esm-es5/calcite-switch.entry.js +5 -1
- package/dist/esm-es5/calcite-tab_4.entry.js +5 -1
- package/dist/esm-es5/calcite-tile-select_2.entry.js +5 -1
- package/dist/esm-es5/calcite-tile.entry.js +5 -1
- package/dist/esm-es5/calcite-tip_3.entry.js +5 -1
- package/dist/esm-es5/calcite-tooltip_2.entry.js +5 -1
- package/dist/esm-es5/calcite-tree_2.entry.js +5 -1
- package/dist/esm-es5/calcite-value-list_2.entry.js +5 -1
- package/dist/esm-es5/calcite.js +5 -1
- package/dist/esm-es5/debounce-79648d42.js +5 -0
- package/dist/esm-es5/dom-f24e866c.js +5 -0
- package/dist/esm-es5/forIn-48d8fb84.js +5 -0
- package/dist/esm-es5/form-cee9f632.js +5 -0
- package/dist/esm-es5/guid-196bd5ea.js +5 -0
- package/dist/esm-es5/index-d653c37f.js +5 -0
- package/dist/esm-es5/index.js +4 -0
- package/dist/esm-es5/interfaces-51dc4e1b.js +5 -0
- package/dist/esm-es5/key-69001a68.js +5 -0
- package/dist/esm-es5/label-bb61bdef.js +5 -0
- package/dist/esm-es5/loader.js +5 -1
- package/dist/esm-es5/locale-6c1b85c7.js +5 -0
- package/dist/esm-es5/math-250d4476.js +5 -0
- package/dist/esm-es5/number-e7393766.js +5 -0
- package/dist/esm-es5/observers-8f0bc419.js +5 -0
- package/dist/esm-es5/popper-7499ea4f.js +5 -0
- package/dist/esm-es5/resources-3b481489.js +5 -0
- package/dist/esm-es5/resources-510eed1a.js +5 -0
- package/dist/esm-es5/resources-584acd9b.js +5 -0
- package/dist/esm-es5/resources-7c6029b6.js +5 -0
- package/dist/esm-es5/sortable.esm-04824d33.js +11 -0
- package/dist/esm-es5/utils-6beb0662.js +5 -0
- package/dist/extras/docs-json.json +36 -10
- package/dist/loader/cdn.js +4 -1
- package/dist/loader/index.cjs.js +4 -1
- package/dist/loader/index.es2017.js +4 -1
- package/dist/loader/index.js +4 -1
- package/dist/types/components/calcite-action/calcite-action.d.ts +2 -2
- package/dist/types/components/calcite-block/resources.d.ts +2 -0
- package/dist/types/components/calcite-button/calcite-button.d.ts +10 -3
- package/dist/types/components/calcite-checkbox/calcite-checkbox.d.ts +1 -1
- package/dist/types/components/calcite-combobox/calcite-combobox.d.ts +1 -1
- package/dist/types/components/calcite-dropdown/calcite-dropdown.d.ts +6 -4
- package/dist/types/components/calcite-inline-editable/calcite-inline-editable.d.ts +1 -1
- package/dist/types/components/calcite-input/calcite-input.d.ts +1 -1
- package/dist/types/components/calcite-input-date-picker/calcite-input-date-picker.d.ts +1 -1
- package/dist/types/components/calcite-input-time-picker/calcite-input-time-picker.d.ts +2 -2
- package/dist/types/components/calcite-link/calcite-link.d.ts +2 -1
- package/dist/types/components/calcite-list/calcite-list.d.ts +3 -0
- package/dist/types/components/calcite-list-item/calcite-list-item.d.ts +3 -0
- package/dist/types/components/calcite-radio-button/calcite-radio-button.d.ts +1 -1
- package/dist/types/components/calcite-radio-group/calcite-radio-group.d.ts +1 -1
- package/dist/types/components/calcite-rating/calcite-rating.d.ts +1 -1
- package/dist/types/components/calcite-select/calcite-select.d.ts +1 -1
- package/dist/types/components/calcite-slider/calcite-slider.d.ts +1 -1
- package/dist/types/components/calcite-switch/calcite-switch.d.ts +1 -1
- package/dist/types/components.d.ts +14 -4
- package/dist/types/utils/number.d.ts +0 -1
- package/hydrate/index.js +303 -250
- package/package.json +35 -37
- package/readme.md +5 -5
- package/dist/calcite/p-00f2f64d.system.entry.js +0 -1
- package/dist/calcite/p-010e5fb9.entry.js +0 -1
- package/dist/calcite/p-03b25bb5.entry.js +0 -1
- package/dist/calcite/p-058f3354.system.entry.js +0 -1
- package/dist/calcite/p-0671d67f.entry.js +0 -1
- package/dist/calcite/p-0a465f92.entry.js +0 -1
- package/dist/calcite/p-0aa3fc7e.entry.js +0 -1
- package/dist/calcite/p-0ae16e31.js +0 -1
- package/dist/calcite/p-0b539bae.system.entry.js +0 -1
- package/dist/calcite/p-0c356cca.entry.js +0 -1
- package/dist/calcite/p-1114dae7.entry.js +0 -1
- package/dist/calcite/p-14893331.system.entry.js +0 -1
- package/dist/calcite/p-170fb8e8.system.entry.js +0 -1
- package/dist/calcite/p-18a62b5e.js +0 -1
- package/dist/calcite/p-19a2021f.entry.js +0 -1
- package/dist/calcite/p-19ac376f.js +0 -1
- package/dist/calcite/p-19d3b749.system.entry.js +0 -1
- package/dist/calcite/p-1a53829b.system.entry.js +0 -1
- package/dist/calcite/p-1c3c9e42.entry.js +0 -1
- package/dist/calcite/p-1df0fd29.system.entry.js +0 -1
- package/dist/calcite/p-203e04e5.entry.js +0 -1
- package/dist/calcite/p-23b87c6a.system.entry.js +0 -1
- package/dist/calcite/p-23edddc9.entry.js +0 -1
- package/dist/calcite/p-2a9b4a25.system.js +0 -1
- package/dist/calcite/p-2c235db8.system.js +0 -1
- package/dist/calcite/p-2e9e2b7c.entry.js +0 -1
- package/dist/calcite/p-30f1442b.js +0 -1
- package/dist/calcite/p-32a0f498.entry.js +0 -1
- package/dist/calcite/p-340e1f88.entry.js +0 -1
- package/dist/calcite/p-3426e87b.system.js +0 -1
- package/dist/calcite/p-354fbadd.js +0 -1
- package/dist/calcite/p-38b3ff5f.system.entry.js +0 -1
- package/dist/calcite/p-39b743d9.system.entry.js +0 -1
- package/dist/calcite/p-3b55b390.entry.js +0 -1
- package/dist/calcite/p-3cdef0cd.entry.js +0 -1
- package/dist/calcite/p-43a9faca.js +0 -1
- package/dist/calcite/p-44810e63.entry.js +0 -1
- package/dist/calcite/p-482ec054.system.js +0 -1
- package/dist/calcite/p-4936ee1a.entry.js +0 -1
- package/dist/calcite/p-4a69f94f.entry.js +0 -1
- package/dist/calcite/p-4bb3e49c.entry.js +0 -1
- package/dist/calcite/p-4dc4c758.entry.js +0 -1
- package/dist/calcite/p-4e3dcb60.entry.js +0 -1
- package/dist/calcite/p-4f24139e.system.entry.js +0 -1
- package/dist/calcite/p-4fce2a7a.system.js +0 -1
- package/dist/calcite/p-4fda49e6.js +0 -1
- package/dist/calcite/p-50ea2036.system.js +0 -1
- package/dist/calcite/p-53caa311.system.js +0 -1
- package/dist/calcite/p-55379ee6.system.entry.js +0 -1
- package/dist/calcite/p-559ffa87.js +0 -1
- package/dist/calcite/p-55f7adaa.system.entry.js +0 -1
- package/dist/calcite/p-58421494.js +0 -1
- package/dist/calcite/p-59f7b582.system.entry.js +0 -1
- package/dist/calcite/p-5a1b0338.system.js +0 -1
- package/dist/calcite/p-5eab55c1.entry.js +0 -1
- package/dist/calcite/p-5f50d376.system.entry.js +0 -1
- package/dist/calcite/p-62977e6b.system.entry.js +0 -1
- package/dist/calcite/p-6350bcd3.system.js +0 -1
- package/dist/calcite/p-65f4f1e9.entry.js +0 -1
- package/dist/calcite/p-674bc090.system.js +0 -1
- package/dist/calcite/p-675364da.system.entry.js +0 -1
- package/dist/calcite/p-69837b80.entry.js +0 -1
- package/dist/calcite/p-69e382de.entry.js +0 -1
- package/dist/calcite/p-6a7d2f7c.entry.js +0 -1
- package/dist/calcite/p-6cb2f24f.entry.js +0 -1
- package/dist/calcite/p-6d98d9dc.system.entry.js +0 -1
- package/dist/calcite/p-6edac967.system.entry.js +0 -1
- package/dist/calcite/p-7521b7ab.system.entry.js +0 -1
- package/dist/calcite/p-771da7ed.system.entry.js +0 -1
- package/dist/calcite/p-79e0b61b.system.entry.js +0 -1
- package/dist/calcite/p-7a241325.system.entry.js +0 -1
- package/dist/calcite/p-7b71e1d4.js +0 -1
- package/dist/calcite/p-7b856f76.system.entry.js +0 -1
- package/dist/calcite/p-7c5c2b30.js +0 -1
- package/dist/calcite/p-7e4036a3.system.entry.js +0 -1
- package/dist/calcite/p-7e4be59e.system.entry.js +0 -1
- package/dist/calcite/p-81371076.entry.js +0 -1
- package/dist/calcite/p-8242ef10.entry.js +0 -1
- package/dist/calcite/p-82a11724.system.js +0 -7
- package/dist/calcite/p-835b14f7.system.entry.js +0 -1
- package/dist/calcite/p-875b172e.entry.js +0 -1
- package/dist/calcite/p-8958d1f6.system.js +0 -1
- package/dist/calcite/p-8975e7c8.entry.js +0 -1
- package/dist/calcite/p-8a16620b.system.js +0 -1
- package/dist/calcite/p-8a30b93d.system.js +0 -1
- package/dist/calcite/p-8cfab352.entry.js +0 -1
- package/dist/calcite/p-8d5f5ebf.js +0 -1
- package/dist/calcite/p-8d9bf455.entry.js +0 -1
- package/dist/calcite/p-8dc31333.js +0 -1
- package/dist/calcite/p-8e46c987.entry.js +0 -1
- package/dist/calcite/p-8ef1afae.system.entry.js +0 -1
- package/dist/calcite/p-8fb7b17f.system.entry.js +0 -1
- package/dist/calcite/p-90b88d97.system.entry.js +0 -1
- package/dist/calcite/p-90ee6b48.entry.js +0 -1
- package/dist/calcite/p-93a7d961.system.entry.js +0 -1
- package/dist/calcite/p-950bdd5b.system.entry.js +0 -1
- package/dist/calcite/p-95dfb659.system.js +0 -1
- package/dist/calcite/p-97b06cc3.entry.js +0 -1
- package/dist/calcite/p-987310d2.system.js +0 -1
- package/dist/calcite/p-9c371694.system.entry.js +0 -1
- package/dist/calcite/p-a096738b.system.entry.js +0 -1
- package/dist/calcite/p-a09cd797.entry.js +0 -1
- package/dist/calcite/p-a0d4c79d.entry.js +0 -1
- package/dist/calcite/p-a4e6e35b.js +0 -1
- package/dist/calcite/p-a54a11ee.system.entry.js +0 -1
- package/dist/calcite/p-a57a7f49.js +0 -7
- package/dist/calcite/p-a6b26bd1.system.js +0 -1
- package/dist/calcite/p-a75f07ae.entry.js +0 -1
- package/dist/calcite/p-a83557c6.entry.js +0 -1
- package/dist/calcite/p-a8650c17.system.js +0 -1
- package/dist/calcite/p-ac44517b.system.entry.js +0 -1
- package/dist/calcite/p-ad290529.system.entry.js +0 -1
- package/dist/calcite/p-b10d0018.system.entry.js +0 -1
- package/dist/calcite/p-b2425e21.js +0 -1
- package/dist/calcite/p-b286e0a5.system.entry.js +0 -1
- package/dist/calcite/p-b2a6687b.system.js +0 -1
- package/dist/calcite/p-b2a79aa2.system.entry.js +0 -1
- package/dist/calcite/p-b4cc79dc.system.js +0 -1
- package/dist/calcite/p-bd291e00.entry.js +0 -1
- package/dist/calcite/p-be531ce4.system.entry.js +0 -1
- package/dist/calcite/p-be6b31d0.entry.js +0 -1
- package/dist/calcite/p-bfca7d51.entry.js +0 -1
- package/dist/calcite/p-c0ee1569.system.entry.js +0 -1
- package/dist/calcite/p-c15a632e.system.entry.js +0 -1
- package/dist/calcite/p-c23bfaf9.system.entry.js +0 -1
- package/dist/calcite/p-c2cd9c1d.system.entry.js +0 -1
- package/dist/calcite/p-c4953aa6.system.entry.js +0 -1
- package/dist/calcite/p-c5257119.entry.js +0 -1
- package/dist/calcite/p-c59d3bb3.system.entry.js +0 -1
- package/dist/calcite/p-c95a18d4.entry.js +0 -1
- package/dist/calcite/p-caf80cd7.js +0 -1
- package/dist/calcite/p-cd8d0dda.entry.js +0 -1
- package/dist/calcite/p-cebd4de5.js +0 -1
- package/dist/calcite/p-cfdbd2e1.entry.js +0 -1
- package/dist/calcite/p-d2907af5.entry.js +0 -1
- package/dist/calcite/p-d2b9513d.entry.js +0 -1
- package/dist/calcite/p-d53c2d2e.system.js +0 -1
- package/dist/calcite/p-d5e63242.entry.js +0 -1
- package/dist/calcite/p-d74caa31.system.entry.js +0 -1
- package/dist/calcite/p-d78a24bb.entry.js +0 -1
- package/dist/calcite/p-d7e0ef91.system.entry.js +0 -1
- package/dist/calcite/p-d858b7ab.js +0 -1
- package/dist/calcite/p-d8a015cb.system.entry.js +0 -1
- package/dist/calcite/p-dc825c55.js +0 -1
- package/dist/calcite/p-dcfa0bba.js +0 -1
- package/dist/calcite/p-dd3f7c73.system.entry.js +0 -1
- package/dist/calcite/p-dda58d1e.system.js +0 -1
- package/dist/calcite/p-ddf50685.system.entry.js +0 -1
- package/dist/calcite/p-de00c01f.entry.js +0 -1
- package/dist/calcite/p-de9b7982.system.entry.js +0 -1
- package/dist/calcite/p-defdc464.system.js +0 -1
- package/dist/calcite/p-e87acd87.system.js +0 -1
- package/dist/calcite/p-ea51eaaa.js +0 -1
- package/dist/calcite/p-ebb0ef70.entry.js +0 -1
- package/dist/calcite/p-ec397dae.entry.js +0 -1
- package/dist/calcite/p-ef0ea98b.system.entry.js +0 -1
- package/dist/calcite/p-ef38dee8.js +0 -1
- package/dist/calcite/p-efe6556c.system.entry.js +0 -1
- package/dist/calcite/p-f02d04ab.system.js +0 -1
- package/dist/calcite/p-f1eddb0f.system.entry.js +0 -1
- package/dist/calcite/p-f95c5864.entry.js +0 -1
- package/dist/calcite/p-fc725435.entry.js +0 -1
- package/dist/cjs/CalciteExpandToggle-b5735fd2.js +0 -90
- package/dist/cjs/CalciteHeading-177f59f2.js +0 -15
- package/dist/cjs/array-4fc5abfa.js +0 -7
- package/dist/cjs/debounce-11980960.js +0 -491
- package/dist/cjs/dom-c9cafa59.js +0 -166
- package/dist/cjs/forIn-46535ded.js +0 -618
- package/dist/cjs/form-432ae178.js +0 -18
- package/dist/cjs/guid-4637ad8f.js +0 -16
- package/dist/cjs/index-105d9087.js +0 -2062
- package/dist/cjs/interfaces-bc0f5779.js +0 -9
- package/dist/cjs/key-f470de4c.js +0 -33
- package/dist/cjs/label-80f9023b.js +0 -54
- package/dist/cjs/locale-eb4486ae.js +0 -119
- package/dist/cjs/math-750406eb.js +0 -5
- package/dist/cjs/number-77308374.js +0 -45
- package/dist/cjs/observers-88b3a2d4.js +0 -18
- package/dist/cjs/popper-a103e375.js +0 -1786
- package/dist/cjs/resources-41daa7d4.js +0 -228
- package/dist/cjs/resources-76637167.js +0 -17
- package/dist/cjs/resources-ae299e51.js +0 -16
- package/dist/cjs/resources-bbca3cea.js +0 -342
- package/dist/cjs/sortable.esm-bcce1d94.js +0 -3015
- package/dist/cjs/utils-d549a0a9.js +0 -119
- package/dist/custom-elements/bundles/accordion.d.ts +0 -1
- package/dist/custom-elements/bundles/accordion.js +0 -5
- package/dist/custom-elements/bundles/action-bar.d.ts +0 -1
- package/dist/custom-elements/bundles/action-bar.js +0 -5
- package/dist/custom-elements/bundles/action-menu.d.ts +0 -1
- package/dist/custom-elements/bundles/action-menu.js +0 -5
- package/dist/custom-elements/bundles/action-pad.d.ts +0 -1
- package/dist/custom-elements/bundles/action-pad.js +0 -5
- package/dist/custom-elements/bundles/action.d.ts +0 -1
- package/dist/custom-elements/bundles/action.js +0 -5
- package/dist/custom-elements/bundles/alert.d.ts +0 -1
- package/dist/custom-elements/bundles/alert.js +0 -5
- package/dist/custom-elements/bundles/avatar.d.ts +0 -1
- package/dist/custom-elements/bundles/avatar.js +0 -5
- package/dist/custom-elements/bundles/block.d.ts +0 -1
- package/dist/custom-elements/bundles/block.js +0 -5
- package/dist/custom-elements/bundles/button.d.ts +0 -1
- package/dist/custom-elements/bundles/button.js +0 -5
- package/dist/custom-elements/bundles/card.d.ts +0 -1
- package/dist/custom-elements/bundles/card.js +0 -5
- package/dist/custom-elements/bundles/checkbox.d.ts +0 -1
- package/dist/custom-elements/bundles/checkbox.js +0 -5
- package/dist/custom-elements/bundles/chip.d.ts +0 -1
- package/dist/custom-elements/bundles/chip.js +0 -5
- package/dist/custom-elements/bundles/color-picker.d.ts +0 -1
- package/dist/custom-elements/bundles/color-picker.js +0 -5
- package/dist/custom-elements/bundles/combobox.d.ts +0 -1
- package/dist/custom-elements/bundles/combobox.js +0 -5
- package/dist/custom-elements/bundles/date-picker.d.ts +0 -1
- package/dist/custom-elements/bundles/date-picker.js +0 -5
- package/dist/custom-elements/bundles/dropdown.d.ts +0 -1
- package/dist/custom-elements/bundles/dropdown.js +0 -5
- package/dist/custom-elements/bundles/fab.d.ts +0 -1
- package/dist/custom-elements/bundles/fab.js +0 -5
- package/dist/custom-elements/bundles/flow.d.ts +0 -1
- package/dist/custom-elements/bundles/flow.js +0 -5
- package/dist/custom-elements/bundles/icon.d.ts +0 -1
- package/dist/custom-elements/bundles/icon.js +0 -5
- package/dist/custom-elements/bundles/inline-editable.d.ts +0 -1
- package/dist/custom-elements/bundles/inline-editable.js +0 -5
- package/dist/custom-elements/bundles/input-date-picker.d.ts +0 -1
- package/dist/custom-elements/bundles/input-date-picker.js +0 -5
- package/dist/custom-elements/bundles/input-message.d.ts +0 -1
- package/dist/custom-elements/bundles/input-message.js +0 -5
- package/dist/custom-elements/bundles/input-time-picker.d.ts +0 -1
- package/dist/custom-elements/bundles/input-time-picker.js +0 -5
- package/dist/custom-elements/bundles/input.d.ts +0 -1
- package/dist/custom-elements/bundles/input.js +0 -5
- package/dist/custom-elements/bundles/label.d.ts +0 -1
- package/dist/custom-elements/bundles/label.js +0 -5
- package/dist/custom-elements/bundles/link.d.ts +0 -1
- package/dist/custom-elements/bundles/link.js +0 -5
- package/dist/custom-elements/bundles/list.d.ts +0 -1
- package/dist/custom-elements/bundles/list.js +0 -5
- package/dist/custom-elements/bundles/loader.d.ts +0 -1
- package/dist/custom-elements/bundles/loader.js +0 -5
- package/dist/custom-elements/bundles/modal.d.ts +0 -1
- package/dist/custom-elements/bundles/modal.js +0 -5
- package/dist/custom-elements/bundles/notice.d.ts +0 -1
- package/dist/custom-elements/bundles/notice.js +0 -5
- package/dist/custom-elements/bundles/pagination.d.ts +0 -1
- package/dist/custom-elements/bundles/pagination.js +0 -5
- package/dist/custom-elements/bundles/panel.d.ts +0 -1
- package/dist/custom-elements/bundles/panel.js +0 -5
- package/dist/custom-elements/bundles/pick-list.d.ts +0 -1
- package/dist/custom-elements/bundles/pick-list.js +0 -5
- package/dist/custom-elements/bundles/popover.d.ts +0 -1
- package/dist/custom-elements/bundles/popover.js +0 -5
- package/dist/custom-elements/bundles/progress.d.ts +0 -1
- package/dist/custom-elements/bundles/progress.js +0 -5
- package/dist/custom-elements/bundles/radio-button-group.d.ts +0 -1
- package/dist/custom-elements/bundles/radio-button-group.js +0 -5
- package/dist/custom-elements/bundles/radio-button.d.ts +0 -1
- package/dist/custom-elements/bundles/radio-button.js +0 -5
- package/dist/custom-elements/bundles/radio-group.d.ts +0 -1
- package/dist/custom-elements/bundles/radio-group.js +0 -5
- package/dist/custom-elements/bundles/rating.d.ts +0 -1
- package/dist/custom-elements/bundles/rating.js +0 -5
- package/dist/custom-elements/bundles/scrim.d.ts +0 -1
- package/dist/custom-elements/bundles/scrim.js +0 -5
- package/dist/custom-elements/bundles/select.d.ts +0 -1
- package/dist/custom-elements/bundles/select.js +0 -5
- package/dist/custom-elements/bundles/shell.d.ts +0 -1
- package/dist/custom-elements/bundles/shell.js +0 -5
- package/dist/custom-elements/bundles/slider.d.ts +0 -1
- package/dist/custom-elements/bundles/slider.js +0 -5
- package/dist/custom-elements/bundles/sortable-list.d.ts +0 -1
- package/dist/custom-elements/bundles/sortable-list.js +0 -5
- package/dist/custom-elements/bundles/split-button.d.ts +0 -1
- package/dist/custom-elements/bundles/split-button.js +0 -5
- package/dist/custom-elements/bundles/stepper.d.ts +0 -1
- package/dist/custom-elements/bundles/stepper.js +0 -5
- package/dist/custom-elements/bundles/switch.d.ts +0 -1
- package/dist/custom-elements/bundles/switch.js +0 -5
- package/dist/custom-elements/bundles/tab.d.ts +0 -1
- package/dist/custom-elements/bundles/tab.js +0 -5
- package/dist/custom-elements/bundles/tile-select-group.d.ts +0 -1
- package/dist/custom-elements/bundles/tile-select-group.js +0 -5
- package/dist/custom-elements/bundles/tile.d.ts +0 -1
- package/dist/custom-elements/bundles/tile.js +0 -5
- package/dist/custom-elements/bundles/tip.d.ts +0 -1
- package/dist/custom-elements/bundles/tip.js +0 -5
- package/dist/custom-elements/bundles/tooltip.d.ts +0 -1
- package/dist/custom-elements/bundles/tooltip.js +0 -5
- package/dist/custom-elements/bundles/tree.d.ts +0 -1
- package/dist/custom-elements/bundles/tree.js +0 -5
- package/dist/custom-elements/bundles/value-list.d.ts +0 -1
- package/dist/custom-elements/bundles/value-list.js +0 -5
- package/dist/custom-elements/index.mjs +0 -24489
- package/dist/custom-elements/utils.d.ts +0 -2
- package/dist/custom-elements/utils.js +0 -11
- package/dist/esm/CalciteExpandToggle-a149fed4.js +0 -83
- package/dist/esm/CalciteHeading-29855e9f.js +0 -12
- package/dist/esm/array-af19adb2.js +0 -5
- package/dist/esm/debounce-047e09f4.js +0 -482
- package/dist/esm/dom-b369a031.js +0 -149
- package/dist/esm/forIn-d55260fc.js +0 -615
- package/dist/esm/form-8aa0d95b.js +0 -16
- package/dist/esm/guid-09142681.js +0 -14
- package/dist/esm/index-f8f0bea7.js +0 -2029
- package/dist/esm/interfaces-355fccb6.js +0 -9
- package/dist/esm/key-ec82f942.js +0 -29
- package/dist/esm/label-7b249c54.js +0 -50
- package/dist/esm/locale-8436bbe1.js +0 -114
- package/dist/esm/math-c8e7aa13.js +0 -3
- package/dist/esm/number-358ca1d4.js +0 -39
- package/dist/esm/observers-c93d4fe5.js +0 -16
- package/dist/esm/popper-2757192a.js +0 -1781
- package/dist/esm/resources-28d71943.js +0 -212
- package/dist/esm/resources-82817f70.js +0 -13
- package/dist/esm/resources-c651d73a.js +0 -321
- package/dist/esm/resources-c72ebfea.js +0 -12
- package/dist/esm/sortable.esm-2f5354d3.js +0 -3013
- package/dist/esm/utils-60acc1d6.js +0 -109
- package/dist/esm-es5/CalciteExpandToggle-a149fed4.js +0 -1
- package/dist/esm-es5/CalciteHeading-29855e9f.js +0 -1
- package/dist/esm-es5/array-af19adb2.js +0 -1
- package/dist/esm-es5/debounce-047e09f4.js +0 -1
- package/dist/esm-es5/dom-b369a031.js +0 -1
- package/dist/esm-es5/forIn-d55260fc.js +0 -1
- package/dist/esm-es5/form-8aa0d95b.js +0 -1
- package/dist/esm-es5/guid-09142681.js +0 -1
- package/dist/esm-es5/index-f8f0bea7.js +0 -1
- package/dist/esm-es5/interfaces-355fccb6.js +0 -1
- package/dist/esm-es5/key-ec82f942.js +0 -1
- package/dist/esm-es5/label-7b249c54.js +0 -1
- package/dist/esm-es5/locale-8436bbe1.js +0 -1
- package/dist/esm-es5/math-c8e7aa13.js +0 -1
- package/dist/esm-es5/number-358ca1d4.js +0 -1
- package/dist/esm-es5/observers-c93d4fe5.js +0 -1
- package/dist/esm-es5/popper-2757192a.js +0 -1
- package/dist/esm-es5/resources-28d71943.js +0 -1
- package/dist/esm-es5/resources-82817f70.js +0 -1
- package/dist/esm-es5/resources-c651d73a.js +0 -1
- package/dist/esm-es5/resources-c72ebfea.js +0 -1
- package/dist/esm-es5/sortable.esm-2f5354d3.js +0 -7
- package/dist/esm-es5/utils-60acc1d6.js +0 -1
|
@@ -0,0 +1,2176 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
+
*/
|
|
5
|
+
import { attachShadow, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
6
|
+
import { c as getThemeName } from './dom.js';
|
|
7
|
+
|
|
8
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
9
|
+
return module = {
|
|
10
|
+
path: basedir,
|
|
11
|
+
exports: {},
|
|
12
|
+
require: function (path, base) {
|
|
13
|
+
return commonjsRequire();
|
|
14
|
+
}
|
|
15
|
+
}, fn(module, module.exports), module.exports;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function commonjsRequire () {
|
|
19
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var colorName$1 = {
|
|
23
|
+
"aliceblue": [240, 248, 255],
|
|
24
|
+
"antiquewhite": [250, 235, 215],
|
|
25
|
+
"aqua": [0, 255, 255],
|
|
26
|
+
"aquamarine": [127, 255, 212],
|
|
27
|
+
"azure": [240, 255, 255],
|
|
28
|
+
"beige": [245, 245, 220],
|
|
29
|
+
"bisque": [255, 228, 196],
|
|
30
|
+
"black": [0, 0, 0],
|
|
31
|
+
"blanchedalmond": [255, 235, 205],
|
|
32
|
+
"blue": [0, 0, 255],
|
|
33
|
+
"blueviolet": [138, 43, 226],
|
|
34
|
+
"brown": [165, 42, 42],
|
|
35
|
+
"burlywood": [222, 184, 135],
|
|
36
|
+
"cadetblue": [95, 158, 160],
|
|
37
|
+
"chartreuse": [127, 255, 0],
|
|
38
|
+
"chocolate": [210, 105, 30],
|
|
39
|
+
"coral": [255, 127, 80],
|
|
40
|
+
"cornflowerblue": [100, 149, 237],
|
|
41
|
+
"cornsilk": [255, 248, 220],
|
|
42
|
+
"crimson": [220, 20, 60],
|
|
43
|
+
"cyan": [0, 255, 255],
|
|
44
|
+
"darkblue": [0, 0, 139],
|
|
45
|
+
"darkcyan": [0, 139, 139],
|
|
46
|
+
"darkgoldenrod": [184, 134, 11],
|
|
47
|
+
"darkgray": [169, 169, 169],
|
|
48
|
+
"darkgreen": [0, 100, 0],
|
|
49
|
+
"darkgrey": [169, 169, 169],
|
|
50
|
+
"darkkhaki": [189, 183, 107],
|
|
51
|
+
"darkmagenta": [139, 0, 139],
|
|
52
|
+
"darkolivegreen": [85, 107, 47],
|
|
53
|
+
"darkorange": [255, 140, 0],
|
|
54
|
+
"darkorchid": [153, 50, 204],
|
|
55
|
+
"darkred": [139, 0, 0],
|
|
56
|
+
"darksalmon": [233, 150, 122],
|
|
57
|
+
"darkseagreen": [143, 188, 143],
|
|
58
|
+
"darkslateblue": [72, 61, 139],
|
|
59
|
+
"darkslategray": [47, 79, 79],
|
|
60
|
+
"darkslategrey": [47, 79, 79],
|
|
61
|
+
"darkturquoise": [0, 206, 209],
|
|
62
|
+
"darkviolet": [148, 0, 211],
|
|
63
|
+
"deeppink": [255, 20, 147],
|
|
64
|
+
"deepskyblue": [0, 191, 255],
|
|
65
|
+
"dimgray": [105, 105, 105],
|
|
66
|
+
"dimgrey": [105, 105, 105],
|
|
67
|
+
"dodgerblue": [30, 144, 255],
|
|
68
|
+
"firebrick": [178, 34, 34],
|
|
69
|
+
"floralwhite": [255, 250, 240],
|
|
70
|
+
"forestgreen": [34, 139, 34],
|
|
71
|
+
"fuchsia": [255, 0, 255],
|
|
72
|
+
"gainsboro": [220, 220, 220],
|
|
73
|
+
"ghostwhite": [248, 248, 255],
|
|
74
|
+
"gold": [255, 215, 0],
|
|
75
|
+
"goldenrod": [218, 165, 32],
|
|
76
|
+
"gray": [128, 128, 128],
|
|
77
|
+
"green": [0, 128, 0],
|
|
78
|
+
"greenyellow": [173, 255, 47],
|
|
79
|
+
"grey": [128, 128, 128],
|
|
80
|
+
"honeydew": [240, 255, 240],
|
|
81
|
+
"hotpink": [255, 105, 180],
|
|
82
|
+
"indianred": [205, 92, 92],
|
|
83
|
+
"indigo": [75, 0, 130],
|
|
84
|
+
"ivory": [255, 255, 240],
|
|
85
|
+
"khaki": [240, 230, 140],
|
|
86
|
+
"lavender": [230, 230, 250],
|
|
87
|
+
"lavenderblush": [255, 240, 245],
|
|
88
|
+
"lawngreen": [124, 252, 0],
|
|
89
|
+
"lemonchiffon": [255, 250, 205],
|
|
90
|
+
"lightblue": [173, 216, 230],
|
|
91
|
+
"lightcoral": [240, 128, 128],
|
|
92
|
+
"lightcyan": [224, 255, 255],
|
|
93
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
94
|
+
"lightgray": [211, 211, 211],
|
|
95
|
+
"lightgreen": [144, 238, 144],
|
|
96
|
+
"lightgrey": [211, 211, 211],
|
|
97
|
+
"lightpink": [255, 182, 193],
|
|
98
|
+
"lightsalmon": [255, 160, 122],
|
|
99
|
+
"lightseagreen": [32, 178, 170],
|
|
100
|
+
"lightskyblue": [135, 206, 250],
|
|
101
|
+
"lightslategray": [119, 136, 153],
|
|
102
|
+
"lightslategrey": [119, 136, 153],
|
|
103
|
+
"lightsteelblue": [176, 196, 222],
|
|
104
|
+
"lightyellow": [255, 255, 224],
|
|
105
|
+
"lime": [0, 255, 0],
|
|
106
|
+
"limegreen": [50, 205, 50],
|
|
107
|
+
"linen": [250, 240, 230],
|
|
108
|
+
"magenta": [255, 0, 255],
|
|
109
|
+
"maroon": [128, 0, 0],
|
|
110
|
+
"mediumaquamarine": [102, 205, 170],
|
|
111
|
+
"mediumblue": [0, 0, 205],
|
|
112
|
+
"mediumorchid": [186, 85, 211],
|
|
113
|
+
"mediumpurple": [147, 112, 219],
|
|
114
|
+
"mediumseagreen": [60, 179, 113],
|
|
115
|
+
"mediumslateblue": [123, 104, 238],
|
|
116
|
+
"mediumspringgreen": [0, 250, 154],
|
|
117
|
+
"mediumturquoise": [72, 209, 204],
|
|
118
|
+
"mediumvioletred": [199, 21, 133],
|
|
119
|
+
"midnightblue": [25, 25, 112],
|
|
120
|
+
"mintcream": [245, 255, 250],
|
|
121
|
+
"mistyrose": [255, 228, 225],
|
|
122
|
+
"moccasin": [255, 228, 181],
|
|
123
|
+
"navajowhite": [255, 222, 173],
|
|
124
|
+
"navy": [0, 0, 128],
|
|
125
|
+
"oldlace": [253, 245, 230],
|
|
126
|
+
"olive": [128, 128, 0],
|
|
127
|
+
"olivedrab": [107, 142, 35],
|
|
128
|
+
"orange": [255, 165, 0],
|
|
129
|
+
"orangered": [255, 69, 0],
|
|
130
|
+
"orchid": [218, 112, 214],
|
|
131
|
+
"palegoldenrod": [238, 232, 170],
|
|
132
|
+
"palegreen": [152, 251, 152],
|
|
133
|
+
"paleturquoise": [175, 238, 238],
|
|
134
|
+
"palevioletred": [219, 112, 147],
|
|
135
|
+
"papayawhip": [255, 239, 213],
|
|
136
|
+
"peachpuff": [255, 218, 185],
|
|
137
|
+
"peru": [205, 133, 63],
|
|
138
|
+
"pink": [255, 192, 203],
|
|
139
|
+
"plum": [221, 160, 221],
|
|
140
|
+
"powderblue": [176, 224, 230],
|
|
141
|
+
"purple": [128, 0, 128],
|
|
142
|
+
"rebeccapurple": [102, 51, 153],
|
|
143
|
+
"red": [255, 0, 0],
|
|
144
|
+
"rosybrown": [188, 143, 143],
|
|
145
|
+
"royalblue": [65, 105, 225],
|
|
146
|
+
"saddlebrown": [139, 69, 19],
|
|
147
|
+
"salmon": [250, 128, 114],
|
|
148
|
+
"sandybrown": [244, 164, 96],
|
|
149
|
+
"seagreen": [46, 139, 87],
|
|
150
|
+
"seashell": [255, 245, 238],
|
|
151
|
+
"sienna": [160, 82, 45],
|
|
152
|
+
"silver": [192, 192, 192],
|
|
153
|
+
"skyblue": [135, 206, 235],
|
|
154
|
+
"slateblue": [106, 90, 205],
|
|
155
|
+
"slategray": [112, 128, 144],
|
|
156
|
+
"slategrey": [112, 128, 144],
|
|
157
|
+
"snow": [255, 250, 250],
|
|
158
|
+
"springgreen": [0, 255, 127],
|
|
159
|
+
"steelblue": [70, 130, 180],
|
|
160
|
+
"tan": [210, 180, 140],
|
|
161
|
+
"teal": [0, 128, 128],
|
|
162
|
+
"thistle": [216, 191, 216],
|
|
163
|
+
"tomato": [255, 99, 71],
|
|
164
|
+
"turquoise": [64, 224, 208],
|
|
165
|
+
"violet": [238, 130, 238],
|
|
166
|
+
"wheat": [245, 222, 179],
|
|
167
|
+
"white": [255, 255, 255],
|
|
168
|
+
"whitesmoke": [245, 245, 245],
|
|
169
|
+
"yellow": [255, 255, 0],
|
|
170
|
+
"yellowgreen": [154, 205, 50]
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
var isArrayish = function isArrayish(obj) {
|
|
174
|
+
if (!obj || typeof obj === 'string') {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return obj instanceof Array || Array.isArray(obj) ||
|
|
179
|
+
(obj.length >= 0 && (obj.splice instanceof Function ||
|
|
180
|
+
(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
var simpleSwizzle = createCommonjsModule(function (module) {
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
var concat = Array.prototype.concat;
|
|
188
|
+
var slice = Array.prototype.slice;
|
|
189
|
+
|
|
190
|
+
var swizzle = module.exports = function swizzle(args) {
|
|
191
|
+
var results = [];
|
|
192
|
+
|
|
193
|
+
for (var i = 0, len = args.length; i < len; i++) {
|
|
194
|
+
var arg = args[i];
|
|
195
|
+
|
|
196
|
+
if (isArrayish(arg)) {
|
|
197
|
+
// http://jsperf.com/javascript-array-concat-vs-push/98
|
|
198
|
+
results = concat.call(results, slice.call(arg));
|
|
199
|
+
} else {
|
|
200
|
+
results.push(arg);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return results;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
swizzle.wrap = function (fn) {
|
|
208
|
+
return function () {
|
|
209
|
+
return fn(swizzle(arguments));
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
var colorString = createCommonjsModule(function (module) {
|
|
215
|
+
/* MIT license */
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
var reverseNames = {};
|
|
220
|
+
|
|
221
|
+
// create a list of reverse color names
|
|
222
|
+
for (var name in colorName$1) {
|
|
223
|
+
if (colorName$1.hasOwnProperty(name)) {
|
|
224
|
+
reverseNames[colorName$1[name]] = name;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var cs = module.exports = {
|
|
229
|
+
to: {},
|
|
230
|
+
get: {}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
cs.get = function (string) {
|
|
234
|
+
var prefix = string.substring(0, 3).toLowerCase();
|
|
235
|
+
var val;
|
|
236
|
+
var model;
|
|
237
|
+
switch (prefix) {
|
|
238
|
+
case 'hsl':
|
|
239
|
+
val = cs.get.hsl(string);
|
|
240
|
+
model = 'hsl';
|
|
241
|
+
break;
|
|
242
|
+
case 'hwb':
|
|
243
|
+
val = cs.get.hwb(string);
|
|
244
|
+
model = 'hwb';
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
val = cs.get.rgb(string);
|
|
248
|
+
model = 'rgb';
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!val) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return {model: model, value: val};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
cs.get.rgb = function (string) {
|
|
260
|
+
if (!string) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
265
|
+
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
266
|
+
var rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
|
267
|
+
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
|
268
|
+
var keyword = /(\D+)/;
|
|
269
|
+
|
|
270
|
+
var rgb = [0, 0, 0, 1];
|
|
271
|
+
var match;
|
|
272
|
+
var i;
|
|
273
|
+
var hexAlpha;
|
|
274
|
+
|
|
275
|
+
if (match = string.match(hex)) {
|
|
276
|
+
hexAlpha = match[2];
|
|
277
|
+
match = match[1];
|
|
278
|
+
|
|
279
|
+
for (i = 0; i < 3; i++) {
|
|
280
|
+
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
281
|
+
var i2 = i * 2;
|
|
282
|
+
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (hexAlpha) {
|
|
286
|
+
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
287
|
+
}
|
|
288
|
+
} else if (match = string.match(abbr)) {
|
|
289
|
+
match = match[1];
|
|
290
|
+
hexAlpha = match[3];
|
|
291
|
+
|
|
292
|
+
for (i = 0; i < 3; i++) {
|
|
293
|
+
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (hexAlpha) {
|
|
297
|
+
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
298
|
+
}
|
|
299
|
+
} else if (match = string.match(rgba)) {
|
|
300
|
+
for (i = 0; i < 3; i++) {
|
|
301
|
+
rgb[i] = parseInt(match[i + 1], 0);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (match[4]) {
|
|
305
|
+
rgb[3] = parseFloat(match[4]);
|
|
306
|
+
}
|
|
307
|
+
} else if (match = string.match(per)) {
|
|
308
|
+
for (i = 0; i < 3; i++) {
|
|
309
|
+
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if (match[4]) {
|
|
313
|
+
rgb[3] = parseFloat(match[4]);
|
|
314
|
+
}
|
|
315
|
+
} else if (match = string.match(keyword)) {
|
|
316
|
+
if (match[1] === 'transparent') {
|
|
317
|
+
return [0, 0, 0, 0];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
rgb = colorName$1[match[1]];
|
|
321
|
+
|
|
322
|
+
if (!rgb) {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
rgb[3] = 1;
|
|
327
|
+
|
|
328
|
+
return rgb;
|
|
329
|
+
} else {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
for (i = 0; i < 3; i++) {
|
|
334
|
+
rgb[i] = clamp(rgb[i], 0, 255);
|
|
335
|
+
}
|
|
336
|
+
rgb[3] = clamp(rgb[3], 0, 1);
|
|
337
|
+
|
|
338
|
+
return rgb;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
cs.get.hsl = function (string) {
|
|
342
|
+
if (!string) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?[\d\.]+)\s*)?\)$/;
|
|
347
|
+
var match = string.match(hsl);
|
|
348
|
+
|
|
349
|
+
if (match) {
|
|
350
|
+
var alpha = parseFloat(match[4]);
|
|
351
|
+
var h = (parseFloat(match[1]) + 360) % 360;
|
|
352
|
+
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
353
|
+
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
354
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
355
|
+
|
|
356
|
+
return [h, s, l, a];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return null;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
cs.get.hwb = function (string) {
|
|
363
|
+
if (!string) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
|
368
|
+
var match = string.match(hwb);
|
|
369
|
+
|
|
370
|
+
if (match) {
|
|
371
|
+
var alpha = parseFloat(match[4]);
|
|
372
|
+
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
373
|
+
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
374
|
+
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
375
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
376
|
+
return [h, w, b, a];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return null;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
cs.to.hex = function () {
|
|
383
|
+
var rgba = simpleSwizzle(arguments);
|
|
384
|
+
|
|
385
|
+
return (
|
|
386
|
+
'#' +
|
|
387
|
+
hexDouble(rgba[0]) +
|
|
388
|
+
hexDouble(rgba[1]) +
|
|
389
|
+
hexDouble(rgba[2]) +
|
|
390
|
+
(rgba[3] < 1
|
|
391
|
+
? (hexDouble(Math.round(rgba[3] * 255)))
|
|
392
|
+
: '')
|
|
393
|
+
);
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
cs.to.rgb = function () {
|
|
397
|
+
var rgba = simpleSwizzle(arguments);
|
|
398
|
+
|
|
399
|
+
return rgba.length < 4 || rgba[3] === 1
|
|
400
|
+
? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
|
|
401
|
+
: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
cs.to.rgb.percent = function () {
|
|
405
|
+
var rgba = simpleSwizzle(arguments);
|
|
406
|
+
|
|
407
|
+
var r = Math.round(rgba[0] / 255 * 100);
|
|
408
|
+
var g = Math.round(rgba[1] / 255 * 100);
|
|
409
|
+
var b = Math.round(rgba[2] / 255 * 100);
|
|
410
|
+
|
|
411
|
+
return rgba.length < 4 || rgba[3] === 1
|
|
412
|
+
? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
|
|
413
|
+
: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
cs.to.hsl = function () {
|
|
417
|
+
var hsla = simpleSwizzle(arguments);
|
|
418
|
+
return hsla.length < 4 || hsla[3] === 1
|
|
419
|
+
? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
|
|
420
|
+
: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
424
|
+
// (hwb have alpha optional & 1 is default value)
|
|
425
|
+
cs.to.hwb = function () {
|
|
426
|
+
var hwba = simpleSwizzle(arguments);
|
|
427
|
+
|
|
428
|
+
var a = '';
|
|
429
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
430
|
+
a = ', ' + hwba[3];
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
cs.to.keyword = function (rgb) {
|
|
437
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
// helpers
|
|
441
|
+
function clamp(num, min, max) {
|
|
442
|
+
return Math.min(Math.max(min, num), max);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function hexDouble(num) {
|
|
446
|
+
var str = num.toString(16).toUpperCase();
|
|
447
|
+
return (str.length < 2) ? '0' + str : str;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
var colorName = {
|
|
452
|
+
"aliceblue": [240, 248, 255],
|
|
453
|
+
"antiquewhite": [250, 235, 215],
|
|
454
|
+
"aqua": [0, 255, 255],
|
|
455
|
+
"aquamarine": [127, 255, 212],
|
|
456
|
+
"azure": [240, 255, 255],
|
|
457
|
+
"beige": [245, 245, 220],
|
|
458
|
+
"bisque": [255, 228, 196],
|
|
459
|
+
"black": [0, 0, 0],
|
|
460
|
+
"blanchedalmond": [255, 235, 205],
|
|
461
|
+
"blue": [0, 0, 255],
|
|
462
|
+
"blueviolet": [138, 43, 226],
|
|
463
|
+
"brown": [165, 42, 42],
|
|
464
|
+
"burlywood": [222, 184, 135],
|
|
465
|
+
"cadetblue": [95, 158, 160],
|
|
466
|
+
"chartreuse": [127, 255, 0],
|
|
467
|
+
"chocolate": [210, 105, 30],
|
|
468
|
+
"coral": [255, 127, 80],
|
|
469
|
+
"cornflowerblue": [100, 149, 237],
|
|
470
|
+
"cornsilk": [255, 248, 220],
|
|
471
|
+
"crimson": [220, 20, 60],
|
|
472
|
+
"cyan": [0, 255, 255],
|
|
473
|
+
"darkblue": [0, 0, 139],
|
|
474
|
+
"darkcyan": [0, 139, 139],
|
|
475
|
+
"darkgoldenrod": [184, 134, 11],
|
|
476
|
+
"darkgray": [169, 169, 169],
|
|
477
|
+
"darkgreen": [0, 100, 0],
|
|
478
|
+
"darkgrey": [169, 169, 169],
|
|
479
|
+
"darkkhaki": [189, 183, 107],
|
|
480
|
+
"darkmagenta": [139, 0, 139],
|
|
481
|
+
"darkolivegreen": [85, 107, 47],
|
|
482
|
+
"darkorange": [255, 140, 0],
|
|
483
|
+
"darkorchid": [153, 50, 204],
|
|
484
|
+
"darkred": [139, 0, 0],
|
|
485
|
+
"darksalmon": [233, 150, 122],
|
|
486
|
+
"darkseagreen": [143, 188, 143],
|
|
487
|
+
"darkslateblue": [72, 61, 139],
|
|
488
|
+
"darkslategray": [47, 79, 79],
|
|
489
|
+
"darkslategrey": [47, 79, 79],
|
|
490
|
+
"darkturquoise": [0, 206, 209],
|
|
491
|
+
"darkviolet": [148, 0, 211],
|
|
492
|
+
"deeppink": [255, 20, 147],
|
|
493
|
+
"deepskyblue": [0, 191, 255],
|
|
494
|
+
"dimgray": [105, 105, 105],
|
|
495
|
+
"dimgrey": [105, 105, 105],
|
|
496
|
+
"dodgerblue": [30, 144, 255],
|
|
497
|
+
"firebrick": [178, 34, 34],
|
|
498
|
+
"floralwhite": [255, 250, 240],
|
|
499
|
+
"forestgreen": [34, 139, 34],
|
|
500
|
+
"fuchsia": [255, 0, 255],
|
|
501
|
+
"gainsboro": [220, 220, 220],
|
|
502
|
+
"ghostwhite": [248, 248, 255],
|
|
503
|
+
"gold": [255, 215, 0],
|
|
504
|
+
"goldenrod": [218, 165, 32],
|
|
505
|
+
"gray": [128, 128, 128],
|
|
506
|
+
"green": [0, 128, 0],
|
|
507
|
+
"greenyellow": [173, 255, 47],
|
|
508
|
+
"grey": [128, 128, 128],
|
|
509
|
+
"honeydew": [240, 255, 240],
|
|
510
|
+
"hotpink": [255, 105, 180],
|
|
511
|
+
"indianred": [205, 92, 92],
|
|
512
|
+
"indigo": [75, 0, 130],
|
|
513
|
+
"ivory": [255, 255, 240],
|
|
514
|
+
"khaki": [240, 230, 140],
|
|
515
|
+
"lavender": [230, 230, 250],
|
|
516
|
+
"lavenderblush": [255, 240, 245],
|
|
517
|
+
"lawngreen": [124, 252, 0],
|
|
518
|
+
"lemonchiffon": [255, 250, 205],
|
|
519
|
+
"lightblue": [173, 216, 230],
|
|
520
|
+
"lightcoral": [240, 128, 128],
|
|
521
|
+
"lightcyan": [224, 255, 255],
|
|
522
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
523
|
+
"lightgray": [211, 211, 211],
|
|
524
|
+
"lightgreen": [144, 238, 144],
|
|
525
|
+
"lightgrey": [211, 211, 211],
|
|
526
|
+
"lightpink": [255, 182, 193],
|
|
527
|
+
"lightsalmon": [255, 160, 122],
|
|
528
|
+
"lightseagreen": [32, 178, 170],
|
|
529
|
+
"lightskyblue": [135, 206, 250],
|
|
530
|
+
"lightslategray": [119, 136, 153],
|
|
531
|
+
"lightslategrey": [119, 136, 153],
|
|
532
|
+
"lightsteelblue": [176, 196, 222],
|
|
533
|
+
"lightyellow": [255, 255, 224],
|
|
534
|
+
"lime": [0, 255, 0],
|
|
535
|
+
"limegreen": [50, 205, 50],
|
|
536
|
+
"linen": [250, 240, 230],
|
|
537
|
+
"magenta": [255, 0, 255],
|
|
538
|
+
"maroon": [128, 0, 0],
|
|
539
|
+
"mediumaquamarine": [102, 205, 170],
|
|
540
|
+
"mediumblue": [0, 0, 205],
|
|
541
|
+
"mediumorchid": [186, 85, 211],
|
|
542
|
+
"mediumpurple": [147, 112, 219],
|
|
543
|
+
"mediumseagreen": [60, 179, 113],
|
|
544
|
+
"mediumslateblue": [123, 104, 238],
|
|
545
|
+
"mediumspringgreen": [0, 250, 154],
|
|
546
|
+
"mediumturquoise": [72, 209, 204],
|
|
547
|
+
"mediumvioletred": [199, 21, 133],
|
|
548
|
+
"midnightblue": [25, 25, 112],
|
|
549
|
+
"mintcream": [245, 255, 250],
|
|
550
|
+
"mistyrose": [255, 228, 225],
|
|
551
|
+
"moccasin": [255, 228, 181],
|
|
552
|
+
"navajowhite": [255, 222, 173],
|
|
553
|
+
"navy": [0, 0, 128],
|
|
554
|
+
"oldlace": [253, 245, 230],
|
|
555
|
+
"olive": [128, 128, 0],
|
|
556
|
+
"olivedrab": [107, 142, 35],
|
|
557
|
+
"orange": [255, 165, 0],
|
|
558
|
+
"orangered": [255, 69, 0],
|
|
559
|
+
"orchid": [218, 112, 214],
|
|
560
|
+
"palegoldenrod": [238, 232, 170],
|
|
561
|
+
"palegreen": [152, 251, 152],
|
|
562
|
+
"paleturquoise": [175, 238, 238],
|
|
563
|
+
"palevioletred": [219, 112, 147],
|
|
564
|
+
"papayawhip": [255, 239, 213],
|
|
565
|
+
"peachpuff": [255, 218, 185],
|
|
566
|
+
"peru": [205, 133, 63],
|
|
567
|
+
"pink": [255, 192, 203],
|
|
568
|
+
"plum": [221, 160, 221],
|
|
569
|
+
"powderblue": [176, 224, 230],
|
|
570
|
+
"purple": [128, 0, 128],
|
|
571
|
+
"rebeccapurple": [102, 51, 153],
|
|
572
|
+
"red": [255, 0, 0],
|
|
573
|
+
"rosybrown": [188, 143, 143],
|
|
574
|
+
"royalblue": [65, 105, 225],
|
|
575
|
+
"saddlebrown": [139, 69, 19],
|
|
576
|
+
"salmon": [250, 128, 114],
|
|
577
|
+
"sandybrown": [244, 164, 96],
|
|
578
|
+
"seagreen": [46, 139, 87],
|
|
579
|
+
"seashell": [255, 245, 238],
|
|
580
|
+
"sienna": [160, 82, 45],
|
|
581
|
+
"silver": [192, 192, 192],
|
|
582
|
+
"skyblue": [135, 206, 235],
|
|
583
|
+
"slateblue": [106, 90, 205],
|
|
584
|
+
"slategray": [112, 128, 144],
|
|
585
|
+
"slategrey": [112, 128, 144],
|
|
586
|
+
"snow": [255, 250, 250],
|
|
587
|
+
"springgreen": [0, 255, 127],
|
|
588
|
+
"steelblue": [70, 130, 180],
|
|
589
|
+
"tan": [210, 180, 140],
|
|
590
|
+
"teal": [0, 128, 128],
|
|
591
|
+
"thistle": [216, 191, 216],
|
|
592
|
+
"tomato": [255, 99, 71],
|
|
593
|
+
"turquoise": [64, 224, 208],
|
|
594
|
+
"violet": [238, 130, 238],
|
|
595
|
+
"wheat": [245, 222, 179],
|
|
596
|
+
"white": [255, 255, 255],
|
|
597
|
+
"whitesmoke": [245, 245, 245],
|
|
598
|
+
"yellow": [255, 255, 0],
|
|
599
|
+
"yellowgreen": [154, 205, 50]
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/* MIT license */
|
|
603
|
+
|
|
604
|
+
/* eslint-disable no-mixed-operators */
|
|
605
|
+
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
606
|
+
// values that give correct `typeof` results).
|
|
607
|
+
// do not use box values types (i.e. Number(), String(), etc.)
|
|
608
|
+
|
|
609
|
+
const reverseKeywords = {};
|
|
610
|
+
|
|
611
|
+
for (const key of Object.keys(colorName)) {
|
|
612
|
+
reverseKeywords[colorName[key]] = key;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const convert$1 = {
|
|
616
|
+
rgb: {
|
|
617
|
+
channels: 3,
|
|
618
|
+
labels: 'rgb'
|
|
619
|
+
},
|
|
620
|
+
hsl: {
|
|
621
|
+
channels: 3,
|
|
622
|
+
labels: 'hsl'
|
|
623
|
+
},
|
|
624
|
+
hsv: {
|
|
625
|
+
channels: 3,
|
|
626
|
+
labels: 'hsv'
|
|
627
|
+
},
|
|
628
|
+
hwb: {
|
|
629
|
+
channels: 3,
|
|
630
|
+
labels: 'hwb'
|
|
631
|
+
},
|
|
632
|
+
cmyk: {
|
|
633
|
+
channels: 4,
|
|
634
|
+
labels: 'cmyk'
|
|
635
|
+
},
|
|
636
|
+
xyz: {
|
|
637
|
+
channels: 3,
|
|
638
|
+
labels: 'xyz'
|
|
639
|
+
},
|
|
640
|
+
lab: {
|
|
641
|
+
channels: 3,
|
|
642
|
+
labels: 'lab'
|
|
643
|
+
},
|
|
644
|
+
lch: {
|
|
645
|
+
channels: 3,
|
|
646
|
+
labels: 'lch'
|
|
647
|
+
},
|
|
648
|
+
hex: {
|
|
649
|
+
channels: 1,
|
|
650
|
+
labels: ['hex']
|
|
651
|
+
},
|
|
652
|
+
keyword: {
|
|
653
|
+
channels: 1,
|
|
654
|
+
labels: ['keyword']
|
|
655
|
+
},
|
|
656
|
+
ansi16: {
|
|
657
|
+
channels: 1,
|
|
658
|
+
labels: ['ansi16']
|
|
659
|
+
},
|
|
660
|
+
ansi256: {
|
|
661
|
+
channels: 1,
|
|
662
|
+
labels: ['ansi256']
|
|
663
|
+
},
|
|
664
|
+
hcg: {
|
|
665
|
+
channels: 3,
|
|
666
|
+
labels: ['h', 'c', 'g']
|
|
667
|
+
},
|
|
668
|
+
apple: {
|
|
669
|
+
channels: 3,
|
|
670
|
+
labels: ['r16', 'g16', 'b16']
|
|
671
|
+
},
|
|
672
|
+
gray: {
|
|
673
|
+
channels: 1,
|
|
674
|
+
labels: ['gray']
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
var conversions = convert$1; // Hide .channels and .labels properties
|
|
678
|
+
|
|
679
|
+
for (const model of Object.keys(convert$1)) {
|
|
680
|
+
if (!('channels' in convert$1[model])) {
|
|
681
|
+
throw new Error('missing channels property: ' + model);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
if (!('labels' in convert$1[model])) {
|
|
685
|
+
throw new Error('missing channel labels property: ' + model);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (convert$1[model].labels.length !== convert$1[model].channels) {
|
|
689
|
+
throw new Error('channel and label counts mismatch: ' + model);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const {
|
|
693
|
+
channels,
|
|
694
|
+
labels
|
|
695
|
+
} = convert$1[model];
|
|
696
|
+
delete convert$1[model].channels;
|
|
697
|
+
delete convert$1[model].labels;
|
|
698
|
+
Object.defineProperty(convert$1[model], 'channels', {
|
|
699
|
+
value: channels
|
|
700
|
+
});
|
|
701
|
+
Object.defineProperty(convert$1[model], 'labels', {
|
|
702
|
+
value: labels
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
convert$1.rgb.hsl = function (rgb) {
|
|
707
|
+
const r = rgb[0] / 255;
|
|
708
|
+
const g = rgb[1] / 255;
|
|
709
|
+
const b = rgb[2] / 255;
|
|
710
|
+
const min = Math.min(r, g, b);
|
|
711
|
+
const max = Math.max(r, g, b);
|
|
712
|
+
const delta = max - min;
|
|
713
|
+
let h;
|
|
714
|
+
let s;
|
|
715
|
+
|
|
716
|
+
if (max === min) {
|
|
717
|
+
h = 0;
|
|
718
|
+
} else if (r === max) {
|
|
719
|
+
h = (g - b) / delta;
|
|
720
|
+
} else if (g === max) {
|
|
721
|
+
h = 2 + (b - r) / delta;
|
|
722
|
+
} else if (b === max) {
|
|
723
|
+
h = 4 + (r - g) / delta;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
h = Math.min(h * 60, 360);
|
|
727
|
+
|
|
728
|
+
if (h < 0) {
|
|
729
|
+
h += 360;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
const l = (min + max) / 2;
|
|
733
|
+
|
|
734
|
+
if (max === min) {
|
|
735
|
+
s = 0;
|
|
736
|
+
} else if (l <= 0.5) {
|
|
737
|
+
s = delta / (max + min);
|
|
738
|
+
} else {
|
|
739
|
+
s = delta / (2 - max - min);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return [h, s * 100, l * 100];
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
convert$1.rgb.hsv = function (rgb) {
|
|
746
|
+
let rdif;
|
|
747
|
+
let gdif;
|
|
748
|
+
let bdif;
|
|
749
|
+
let h;
|
|
750
|
+
let s;
|
|
751
|
+
const r = rgb[0] / 255;
|
|
752
|
+
const g = rgb[1] / 255;
|
|
753
|
+
const b = rgb[2] / 255;
|
|
754
|
+
const v = Math.max(r, g, b);
|
|
755
|
+
const diff = v - Math.min(r, g, b);
|
|
756
|
+
|
|
757
|
+
const diffc = function (c) {
|
|
758
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
if (diff === 0) {
|
|
762
|
+
h = 0;
|
|
763
|
+
s = 0;
|
|
764
|
+
} else {
|
|
765
|
+
s = diff / v;
|
|
766
|
+
rdif = diffc(r);
|
|
767
|
+
gdif = diffc(g);
|
|
768
|
+
bdif = diffc(b);
|
|
769
|
+
|
|
770
|
+
if (r === v) {
|
|
771
|
+
h = bdif - gdif;
|
|
772
|
+
} else if (g === v) {
|
|
773
|
+
h = 1 / 3 + rdif - bdif;
|
|
774
|
+
} else if (b === v) {
|
|
775
|
+
h = 2 / 3 + gdif - rdif;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (h < 0) {
|
|
779
|
+
h += 1;
|
|
780
|
+
} else if (h > 1) {
|
|
781
|
+
h -= 1;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
return [h * 360, s * 100, v * 100];
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
convert$1.rgb.hwb = function (rgb) {
|
|
789
|
+
const r = rgb[0];
|
|
790
|
+
const g = rgb[1];
|
|
791
|
+
let b = rgb[2];
|
|
792
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
793
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
794
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
795
|
+
return [h, w * 100, b * 100];
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
convert$1.rgb.cmyk = function (rgb) {
|
|
799
|
+
const r = rgb[0] / 255;
|
|
800
|
+
const g = rgb[1] / 255;
|
|
801
|
+
const b = rgb[2] / 255;
|
|
802
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
803
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
804
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
805
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
806
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
function comparativeDistance(x, y) {
|
|
810
|
+
/*
|
|
811
|
+
See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
|
812
|
+
*/
|
|
813
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
convert$1.rgb.keyword = function (rgb) {
|
|
817
|
+
const reversed = reverseKeywords[rgb];
|
|
818
|
+
|
|
819
|
+
if (reversed) {
|
|
820
|
+
return reversed;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
let currentClosestDistance = Infinity;
|
|
824
|
+
let currentClosestKeyword;
|
|
825
|
+
|
|
826
|
+
for (const keyword of Object.keys(colorName)) {
|
|
827
|
+
const value = colorName[keyword]; // Compute comparative distance
|
|
828
|
+
|
|
829
|
+
const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
|
|
830
|
+
|
|
831
|
+
if (distance < currentClosestDistance) {
|
|
832
|
+
currentClosestDistance = distance;
|
|
833
|
+
currentClosestKeyword = keyword;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
return currentClosestKeyword;
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
convert$1.keyword.rgb = function (keyword) {
|
|
841
|
+
return colorName[keyword];
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
convert$1.rgb.xyz = function (rgb) {
|
|
845
|
+
let r = rgb[0] / 255;
|
|
846
|
+
let g = rgb[1] / 255;
|
|
847
|
+
let b = rgb[2] / 255; // Assume sRGB
|
|
848
|
+
|
|
849
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
850
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
851
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
852
|
+
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
853
|
+
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
854
|
+
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
855
|
+
return [x * 100, y * 100, z * 100];
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
convert$1.rgb.lab = function (rgb) {
|
|
859
|
+
const xyz = convert$1.rgb.xyz(rgb);
|
|
860
|
+
let x = xyz[0];
|
|
861
|
+
let y = xyz[1];
|
|
862
|
+
let z = xyz[2];
|
|
863
|
+
x /= 95.047;
|
|
864
|
+
y /= 100;
|
|
865
|
+
z /= 108.883;
|
|
866
|
+
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
867
|
+
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
868
|
+
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
869
|
+
const l = 116 * y - 16;
|
|
870
|
+
const a = 500 * (x - y);
|
|
871
|
+
const b = 200 * (y - z);
|
|
872
|
+
return [l, a, b];
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
convert$1.hsl.rgb = function (hsl) {
|
|
876
|
+
const h = hsl[0] / 360;
|
|
877
|
+
const s = hsl[1] / 100;
|
|
878
|
+
const l = hsl[2] / 100;
|
|
879
|
+
let t2;
|
|
880
|
+
let t3;
|
|
881
|
+
let val;
|
|
882
|
+
|
|
883
|
+
if (s === 0) {
|
|
884
|
+
val = l * 255;
|
|
885
|
+
return [val, val, val];
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (l < 0.5) {
|
|
889
|
+
t2 = l * (1 + s);
|
|
890
|
+
} else {
|
|
891
|
+
t2 = l + s - l * s;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
const t1 = 2 * l - t2;
|
|
895
|
+
const rgb = [0, 0, 0];
|
|
896
|
+
|
|
897
|
+
for (let i = 0; i < 3; i++) {
|
|
898
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
899
|
+
|
|
900
|
+
if (t3 < 0) {
|
|
901
|
+
t3++;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
if (t3 > 1) {
|
|
905
|
+
t3--;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (6 * t3 < 1) {
|
|
909
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
910
|
+
} else if (2 * t3 < 1) {
|
|
911
|
+
val = t2;
|
|
912
|
+
} else if (3 * t3 < 2) {
|
|
913
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
914
|
+
} else {
|
|
915
|
+
val = t1;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
rgb[i] = val * 255;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
return rgb;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
convert$1.hsl.hsv = function (hsl) {
|
|
925
|
+
const h = hsl[0];
|
|
926
|
+
let s = hsl[1] / 100;
|
|
927
|
+
let l = hsl[2] / 100;
|
|
928
|
+
let smin = s;
|
|
929
|
+
const lmin = Math.max(l, 0.01);
|
|
930
|
+
l *= 2;
|
|
931
|
+
s *= l <= 1 ? l : 2 - l;
|
|
932
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
933
|
+
const v = (l + s) / 2;
|
|
934
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
935
|
+
return [h, sv * 100, v * 100];
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
convert$1.hsv.rgb = function (hsv) {
|
|
939
|
+
const h = hsv[0] / 60;
|
|
940
|
+
const s = hsv[1] / 100;
|
|
941
|
+
let v = hsv[2] / 100;
|
|
942
|
+
const hi = Math.floor(h) % 6;
|
|
943
|
+
const f = h - Math.floor(h);
|
|
944
|
+
const p = 255 * v * (1 - s);
|
|
945
|
+
const q = 255 * v * (1 - s * f);
|
|
946
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
947
|
+
v *= 255;
|
|
948
|
+
|
|
949
|
+
switch (hi) {
|
|
950
|
+
case 0:
|
|
951
|
+
return [v, t, p];
|
|
952
|
+
|
|
953
|
+
case 1:
|
|
954
|
+
return [q, v, p];
|
|
955
|
+
|
|
956
|
+
case 2:
|
|
957
|
+
return [p, v, t];
|
|
958
|
+
|
|
959
|
+
case 3:
|
|
960
|
+
return [p, q, v];
|
|
961
|
+
|
|
962
|
+
case 4:
|
|
963
|
+
return [t, p, v];
|
|
964
|
+
|
|
965
|
+
case 5:
|
|
966
|
+
return [v, p, q];
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
convert$1.hsv.hsl = function (hsv) {
|
|
971
|
+
const h = hsv[0];
|
|
972
|
+
const s = hsv[1] / 100;
|
|
973
|
+
const v = hsv[2] / 100;
|
|
974
|
+
const vmin = Math.max(v, 0.01);
|
|
975
|
+
let sl;
|
|
976
|
+
let l;
|
|
977
|
+
l = (2 - s) * v;
|
|
978
|
+
const lmin = (2 - s) * vmin;
|
|
979
|
+
sl = s * vmin;
|
|
980
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
981
|
+
sl = sl || 0;
|
|
982
|
+
l /= 2;
|
|
983
|
+
return [h, sl * 100, l * 100];
|
|
984
|
+
}; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
convert$1.hwb.rgb = function (hwb) {
|
|
988
|
+
const h = hwb[0] / 360;
|
|
989
|
+
let wh = hwb[1] / 100;
|
|
990
|
+
let bl = hwb[2] / 100;
|
|
991
|
+
const ratio = wh + bl;
|
|
992
|
+
let f; // Wh + bl cant be > 1
|
|
993
|
+
|
|
994
|
+
if (ratio > 1) {
|
|
995
|
+
wh /= ratio;
|
|
996
|
+
bl /= ratio;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
const i = Math.floor(6 * h);
|
|
1000
|
+
const v = 1 - bl;
|
|
1001
|
+
f = 6 * h - i;
|
|
1002
|
+
|
|
1003
|
+
if ((i & 0x01) !== 0) {
|
|
1004
|
+
f = 1 - f;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
const n = wh + f * (v - wh); // Linear interpolation
|
|
1008
|
+
|
|
1009
|
+
let r;
|
|
1010
|
+
let g;
|
|
1011
|
+
let b;
|
|
1012
|
+
/* eslint-disable max-statements-per-line,no-multi-spaces */
|
|
1013
|
+
|
|
1014
|
+
switch (i) {
|
|
1015
|
+
default:
|
|
1016
|
+
case 6:
|
|
1017
|
+
case 0:
|
|
1018
|
+
r = v;
|
|
1019
|
+
g = n;
|
|
1020
|
+
b = wh;
|
|
1021
|
+
break;
|
|
1022
|
+
|
|
1023
|
+
case 1:
|
|
1024
|
+
r = n;
|
|
1025
|
+
g = v;
|
|
1026
|
+
b = wh;
|
|
1027
|
+
break;
|
|
1028
|
+
|
|
1029
|
+
case 2:
|
|
1030
|
+
r = wh;
|
|
1031
|
+
g = v;
|
|
1032
|
+
b = n;
|
|
1033
|
+
break;
|
|
1034
|
+
|
|
1035
|
+
case 3:
|
|
1036
|
+
r = wh;
|
|
1037
|
+
g = n;
|
|
1038
|
+
b = v;
|
|
1039
|
+
break;
|
|
1040
|
+
|
|
1041
|
+
case 4:
|
|
1042
|
+
r = n;
|
|
1043
|
+
g = wh;
|
|
1044
|
+
b = v;
|
|
1045
|
+
break;
|
|
1046
|
+
|
|
1047
|
+
case 5:
|
|
1048
|
+
r = v;
|
|
1049
|
+
g = wh;
|
|
1050
|
+
b = n;
|
|
1051
|
+
break;
|
|
1052
|
+
}
|
|
1053
|
+
/* eslint-enable max-statements-per-line,no-multi-spaces */
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
return [r * 255, g * 255, b * 255];
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
convert$1.cmyk.rgb = function (cmyk) {
|
|
1060
|
+
const c = cmyk[0] / 100;
|
|
1061
|
+
const m = cmyk[1] / 100;
|
|
1062
|
+
const y = cmyk[2] / 100;
|
|
1063
|
+
const k = cmyk[3] / 100;
|
|
1064
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1065
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1066
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1067
|
+
return [r * 255, g * 255, b * 255];
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
convert$1.xyz.rgb = function (xyz) {
|
|
1071
|
+
const x = xyz[0] / 100;
|
|
1072
|
+
const y = xyz[1] / 100;
|
|
1073
|
+
const z = xyz[2] / 100;
|
|
1074
|
+
let r;
|
|
1075
|
+
let g;
|
|
1076
|
+
let b;
|
|
1077
|
+
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
1078
|
+
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
1079
|
+
b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
|
|
1080
|
+
|
|
1081
|
+
r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
|
|
1082
|
+
g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
|
|
1083
|
+
b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
|
|
1084
|
+
r = Math.min(Math.max(0, r), 1);
|
|
1085
|
+
g = Math.min(Math.max(0, g), 1);
|
|
1086
|
+
b = Math.min(Math.max(0, b), 1);
|
|
1087
|
+
return [r * 255, g * 255, b * 255];
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
convert$1.xyz.lab = function (xyz) {
|
|
1091
|
+
let x = xyz[0];
|
|
1092
|
+
let y = xyz[1];
|
|
1093
|
+
let z = xyz[2];
|
|
1094
|
+
x /= 95.047;
|
|
1095
|
+
y /= 100;
|
|
1096
|
+
z /= 108.883;
|
|
1097
|
+
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1098
|
+
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1099
|
+
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1100
|
+
const l = 116 * y - 16;
|
|
1101
|
+
const a = 500 * (x - y);
|
|
1102
|
+
const b = 200 * (y - z);
|
|
1103
|
+
return [l, a, b];
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
convert$1.lab.xyz = function (lab) {
|
|
1107
|
+
const l = lab[0];
|
|
1108
|
+
const a = lab[1];
|
|
1109
|
+
const b = lab[2];
|
|
1110
|
+
let x;
|
|
1111
|
+
let y;
|
|
1112
|
+
let z;
|
|
1113
|
+
y = (l + 16) / 116;
|
|
1114
|
+
x = a / 500 + y;
|
|
1115
|
+
z = y - b / 200;
|
|
1116
|
+
const y2 = y ** 3;
|
|
1117
|
+
const x2 = x ** 3;
|
|
1118
|
+
const z2 = z ** 3;
|
|
1119
|
+
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1120
|
+
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1121
|
+
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1122
|
+
x *= 95.047;
|
|
1123
|
+
y *= 100;
|
|
1124
|
+
z *= 108.883;
|
|
1125
|
+
return [x, y, z];
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
convert$1.lab.lch = function (lab) {
|
|
1129
|
+
const l = lab[0];
|
|
1130
|
+
const a = lab[1];
|
|
1131
|
+
const b = lab[2];
|
|
1132
|
+
let h;
|
|
1133
|
+
const hr = Math.atan2(b, a);
|
|
1134
|
+
h = hr * 360 / 2 / Math.PI;
|
|
1135
|
+
|
|
1136
|
+
if (h < 0) {
|
|
1137
|
+
h += 360;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
const c = Math.sqrt(a * a + b * b);
|
|
1141
|
+
return [l, c, h];
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
convert$1.lch.lab = function (lch) {
|
|
1145
|
+
const l = lch[0];
|
|
1146
|
+
const c = lch[1];
|
|
1147
|
+
const h = lch[2];
|
|
1148
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
1149
|
+
const a = c * Math.cos(hr);
|
|
1150
|
+
const b = c * Math.sin(hr);
|
|
1151
|
+
return [l, a, b];
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
convert$1.rgb.ansi16 = function (args, saturation = null) {
|
|
1155
|
+
const [r, g, b] = args;
|
|
1156
|
+
let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
|
|
1157
|
+
|
|
1158
|
+
value = Math.round(value / 50);
|
|
1159
|
+
|
|
1160
|
+
if (value === 0) {
|
|
1161
|
+
return 30;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1165
|
+
|
|
1166
|
+
if (value === 2) {
|
|
1167
|
+
ansi += 60;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
return ansi;
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1173
|
+
convert$1.hsv.ansi16 = function (args) {
|
|
1174
|
+
// Optimization here; we already know the value and don't need to get
|
|
1175
|
+
// it converted for us.
|
|
1176
|
+
return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
convert$1.rgb.ansi256 = function (args) {
|
|
1180
|
+
const r = args[0];
|
|
1181
|
+
const g = args[1];
|
|
1182
|
+
const b = args[2]; // We use the extended greyscale palette here, with the exception of
|
|
1183
|
+
// black and white. normal palette only has 4 greyscale shades.
|
|
1184
|
+
|
|
1185
|
+
if (r === g && g === b) {
|
|
1186
|
+
if (r < 8) {
|
|
1187
|
+
return 16;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
if (r > 248) {
|
|
1191
|
+
return 231;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1198
|
+
return ansi;
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
convert$1.ansi16.rgb = function (args) {
|
|
1202
|
+
let color = args % 10; // Handle greyscale
|
|
1203
|
+
|
|
1204
|
+
if (color === 0 || color === 7) {
|
|
1205
|
+
if (args > 50) {
|
|
1206
|
+
color += 3.5;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
color = color / 10.5 * 255;
|
|
1210
|
+
return [color, color, color];
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
1214
|
+
const r = (color & 1) * mult * 255;
|
|
1215
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
1216
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
1217
|
+
return [r, g, b];
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
convert$1.ansi256.rgb = function (args) {
|
|
1221
|
+
// Handle greyscale
|
|
1222
|
+
if (args >= 232) {
|
|
1223
|
+
const c = (args - 232) * 10 + 8;
|
|
1224
|
+
return [c, c, c];
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
args -= 16;
|
|
1228
|
+
let rem;
|
|
1229
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
1230
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1231
|
+
const b = rem % 6 / 5 * 255;
|
|
1232
|
+
return [r, g, b];
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
convert$1.rgb.hex = function (args) {
|
|
1236
|
+
const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
|
|
1237
|
+
const string = integer.toString(16).toUpperCase();
|
|
1238
|
+
return '000000'.substring(string.length) + string;
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
convert$1.hex.rgb = function (args) {
|
|
1242
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1243
|
+
|
|
1244
|
+
if (!match) {
|
|
1245
|
+
return [0, 0, 0];
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
let colorString = match[0];
|
|
1249
|
+
|
|
1250
|
+
if (match[0].length === 3) {
|
|
1251
|
+
colorString = colorString.split('').map(char => {
|
|
1252
|
+
return char + char;
|
|
1253
|
+
}).join('');
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
const integer = parseInt(colorString, 16);
|
|
1257
|
+
const r = integer >> 16 & 0xFF;
|
|
1258
|
+
const g = integer >> 8 & 0xFF;
|
|
1259
|
+
const b = integer & 0xFF;
|
|
1260
|
+
return [r, g, b];
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
convert$1.rgb.hcg = function (rgb) {
|
|
1264
|
+
const r = rgb[0] / 255;
|
|
1265
|
+
const g = rgb[1] / 255;
|
|
1266
|
+
const b = rgb[2] / 255;
|
|
1267
|
+
const max = Math.max(Math.max(r, g), b);
|
|
1268
|
+
const min = Math.min(Math.min(r, g), b);
|
|
1269
|
+
const chroma = max - min;
|
|
1270
|
+
let grayscale;
|
|
1271
|
+
let hue;
|
|
1272
|
+
|
|
1273
|
+
if (chroma < 1) {
|
|
1274
|
+
grayscale = min / (1 - chroma);
|
|
1275
|
+
} else {
|
|
1276
|
+
grayscale = 0;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
if (chroma <= 0) {
|
|
1280
|
+
hue = 0;
|
|
1281
|
+
} else if (max === r) {
|
|
1282
|
+
hue = (g - b) / chroma % 6;
|
|
1283
|
+
} else if (max === g) {
|
|
1284
|
+
hue = 2 + (b - r) / chroma;
|
|
1285
|
+
} else {
|
|
1286
|
+
hue = 4 + (r - g) / chroma;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
hue /= 6;
|
|
1290
|
+
hue %= 1;
|
|
1291
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
convert$1.hsl.hcg = function (hsl) {
|
|
1295
|
+
const s = hsl[1] / 100;
|
|
1296
|
+
const l = hsl[2] / 100;
|
|
1297
|
+
const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
|
|
1298
|
+
let f = 0;
|
|
1299
|
+
|
|
1300
|
+
if (c < 1.0) {
|
|
1301
|
+
f = (l - 0.5 * c) / (1.0 - c);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
return [hsl[0], c * 100, f * 100];
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
convert$1.hsv.hcg = function (hsv) {
|
|
1308
|
+
const s = hsv[1] / 100;
|
|
1309
|
+
const v = hsv[2] / 100;
|
|
1310
|
+
const c = s * v;
|
|
1311
|
+
let f = 0;
|
|
1312
|
+
|
|
1313
|
+
if (c < 1.0) {
|
|
1314
|
+
f = (v - c) / (1 - c);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
return [hsv[0], c * 100, f * 100];
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
convert$1.hcg.rgb = function (hcg) {
|
|
1321
|
+
const h = hcg[0] / 360;
|
|
1322
|
+
const c = hcg[1] / 100;
|
|
1323
|
+
const g = hcg[2] / 100;
|
|
1324
|
+
|
|
1325
|
+
if (c === 0.0) {
|
|
1326
|
+
return [g * 255, g * 255, g * 255];
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
const pure = [0, 0, 0];
|
|
1330
|
+
const hi = h % 1 * 6;
|
|
1331
|
+
const v = hi % 1;
|
|
1332
|
+
const w = 1 - v;
|
|
1333
|
+
let mg = 0;
|
|
1334
|
+
/* eslint-disable max-statements-per-line */
|
|
1335
|
+
|
|
1336
|
+
switch (Math.floor(hi)) {
|
|
1337
|
+
case 0:
|
|
1338
|
+
pure[0] = 1;
|
|
1339
|
+
pure[1] = v;
|
|
1340
|
+
pure[2] = 0;
|
|
1341
|
+
break;
|
|
1342
|
+
|
|
1343
|
+
case 1:
|
|
1344
|
+
pure[0] = w;
|
|
1345
|
+
pure[1] = 1;
|
|
1346
|
+
pure[2] = 0;
|
|
1347
|
+
break;
|
|
1348
|
+
|
|
1349
|
+
case 2:
|
|
1350
|
+
pure[0] = 0;
|
|
1351
|
+
pure[1] = 1;
|
|
1352
|
+
pure[2] = v;
|
|
1353
|
+
break;
|
|
1354
|
+
|
|
1355
|
+
case 3:
|
|
1356
|
+
pure[0] = 0;
|
|
1357
|
+
pure[1] = w;
|
|
1358
|
+
pure[2] = 1;
|
|
1359
|
+
break;
|
|
1360
|
+
|
|
1361
|
+
case 4:
|
|
1362
|
+
pure[0] = v;
|
|
1363
|
+
pure[1] = 0;
|
|
1364
|
+
pure[2] = 1;
|
|
1365
|
+
break;
|
|
1366
|
+
|
|
1367
|
+
default:
|
|
1368
|
+
pure[0] = 1;
|
|
1369
|
+
pure[1] = 0;
|
|
1370
|
+
pure[2] = w;
|
|
1371
|
+
}
|
|
1372
|
+
/* eslint-enable max-statements-per-line */
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
mg = (1.0 - c) * g;
|
|
1376
|
+
return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
convert$1.hcg.hsv = function (hcg) {
|
|
1380
|
+
const c = hcg[1] / 100;
|
|
1381
|
+
const g = hcg[2] / 100;
|
|
1382
|
+
const v = c + g * (1.0 - c);
|
|
1383
|
+
let f = 0;
|
|
1384
|
+
|
|
1385
|
+
if (v > 0.0) {
|
|
1386
|
+
f = c / v;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
return [hcg[0], f * 100, v * 100];
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
convert$1.hcg.hsl = function (hcg) {
|
|
1393
|
+
const c = hcg[1] / 100;
|
|
1394
|
+
const g = hcg[2] / 100;
|
|
1395
|
+
const l = g * (1.0 - c) + 0.5 * c;
|
|
1396
|
+
let s = 0;
|
|
1397
|
+
|
|
1398
|
+
if (l > 0.0 && l < 0.5) {
|
|
1399
|
+
s = c / (2 * l);
|
|
1400
|
+
} else if (l >= 0.5 && l < 1.0) {
|
|
1401
|
+
s = c / (2 * (1 - l));
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
return [hcg[0], s * 100, l * 100];
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1407
|
+
convert$1.hcg.hwb = function (hcg) {
|
|
1408
|
+
const c = hcg[1] / 100;
|
|
1409
|
+
const g = hcg[2] / 100;
|
|
1410
|
+
const v = c + g * (1.0 - c);
|
|
1411
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
convert$1.hwb.hcg = function (hwb) {
|
|
1415
|
+
const w = hwb[1] / 100;
|
|
1416
|
+
const b = hwb[2] / 100;
|
|
1417
|
+
const v = 1 - b;
|
|
1418
|
+
const c = v - w;
|
|
1419
|
+
let g = 0;
|
|
1420
|
+
|
|
1421
|
+
if (c < 1) {
|
|
1422
|
+
g = (v - c) / (1 - c);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
return [hwb[0], c * 100, g * 100];
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
convert$1.apple.rgb = function (apple) {
|
|
1429
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
convert$1.rgb.apple = function (rgb) {
|
|
1433
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
convert$1.gray.rgb = function (args) {
|
|
1437
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
convert$1.gray.hsl = function (args) {
|
|
1441
|
+
return [0, 0, args[0]];
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
convert$1.gray.hsv = convert$1.gray.hsl;
|
|
1445
|
+
|
|
1446
|
+
convert$1.gray.hwb = function (gray) {
|
|
1447
|
+
return [0, 100, gray[0]];
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
convert$1.gray.cmyk = function (gray) {
|
|
1451
|
+
return [0, 0, 0, gray[0]];
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
convert$1.gray.lab = function (gray) {
|
|
1455
|
+
return [gray[0], 0, 0];
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
convert$1.gray.hex = function (gray) {
|
|
1459
|
+
const val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
|
1460
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
1461
|
+
const string = integer.toString(16).toUpperCase();
|
|
1462
|
+
return '000000'.substring(string.length) + string;
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1465
|
+
convert$1.rgb.gray = function (rgb) {
|
|
1466
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
1467
|
+
return [val / 255 * 100];
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
/*
|
|
1471
|
+
This function routes a model to all other models.
|
|
1472
|
+
|
|
1473
|
+
all functions that are routed have a property `.conversion` attached
|
|
1474
|
+
to the returned synthetic function. This property is an array
|
|
1475
|
+
of strings, each with the steps in between the 'from' and 'to'
|
|
1476
|
+
color models (inclusive).
|
|
1477
|
+
|
|
1478
|
+
conversions that are not possible simply are not included.
|
|
1479
|
+
*/
|
|
1480
|
+
|
|
1481
|
+
function buildGraph() {
|
|
1482
|
+
const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
1483
|
+
|
|
1484
|
+
const models = Object.keys(conversions);
|
|
1485
|
+
|
|
1486
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1487
|
+
graph[models[i]] = {
|
|
1488
|
+
// http://jsperf.com/1-vs-infinity
|
|
1489
|
+
// micro-opt, but this is simple.
|
|
1490
|
+
distance: -1,
|
|
1491
|
+
parent: null
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
return graph;
|
|
1496
|
+
} // https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
function deriveBFS(fromModel) {
|
|
1500
|
+
const graph = buildGraph();
|
|
1501
|
+
const queue = [fromModel]; // Unshift -> queue -> pop
|
|
1502
|
+
|
|
1503
|
+
graph[fromModel].distance = 0;
|
|
1504
|
+
|
|
1505
|
+
while (queue.length) {
|
|
1506
|
+
const current = queue.pop();
|
|
1507
|
+
const adjacents = Object.keys(conversions[current]);
|
|
1508
|
+
|
|
1509
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1510
|
+
const adjacent = adjacents[i];
|
|
1511
|
+
const node = graph[adjacent];
|
|
1512
|
+
|
|
1513
|
+
if (node.distance === -1) {
|
|
1514
|
+
node.distance = graph[current].distance + 1;
|
|
1515
|
+
node.parent = current;
|
|
1516
|
+
queue.unshift(adjacent);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
return graph;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
function link(from, to) {
|
|
1525
|
+
return function (args) {
|
|
1526
|
+
return to(from(args));
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
function wrapConversion(toModel, graph) {
|
|
1531
|
+
const path = [graph[toModel].parent, toModel];
|
|
1532
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
1533
|
+
let cur = graph[toModel].parent;
|
|
1534
|
+
|
|
1535
|
+
while (graph[cur].parent) {
|
|
1536
|
+
path.unshift(graph[cur].parent);
|
|
1537
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1538
|
+
cur = graph[cur].parent;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
fn.conversion = path;
|
|
1542
|
+
return fn;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
var route = function (fromModel) {
|
|
1546
|
+
const graph = deriveBFS(fromModel);
|
|
1547
|
+
const conversion = {};
|
|
1548
|
+
const models = Object.keys(graph);
|
|
1549
|
+
|
|
1550
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1551
|
+
const toModel = models[i];
|
|
1552
|
+
const node = graph[toModel];
|
|
1553
|
+
|
|
1554
|
+
if (node.parent === null) {
|
|
1555
|
+
// No possible conversion, or this node is the source model.
|
|
1556
|
+
continue;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
return conversion;
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
const convert = {};
|
|
1566
|
+
const models = Object.keys(conversions);
|
|
1567
|
+
|
|
1568
|
+
function wrapRaw(fn) {
|
|
1569
|
+
const wrappedFn = function (...args) {
|
|
1570
|
+
const arg0 = args[0];
|
|
1571
|
+
|
|
1572
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1573
|
+
return arg0;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
if (arg0.length > 1) {
|
|
1577
|
+
args = arg0;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
return fn(args);
|
|
1581
|
+
}; // Preserve .conversion property if there is one
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
if ('conversion' in fn) {
|
|
1585
|
+
wrappedFn.conversion = fn.conversion;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
return wrappedFn;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
function wrapRounded(fn) {
|
|
1592
|
+
const wrappedFn = function (...args) {
|
|
1593
|
+
const arg0 = args[0];
|
|
1594
|
+
|
|
1595
|
+
if (arg0 === undefined || arg0 === null) {
|
|
1596
|
+
return arg0;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
if (arg0.length > 1) {
|
|
1600
|
+
args = arg0;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
const result = fn(args); // We're assuming the result is an array here.
|
|
1604
|
+
// see notice in conversions.js; don't use box types
|
|
1605
|
+
// in conversion functions.
|
|
1606
|
+
|
|
1607
|
+
if (typeof result === 'object') {
|
|
1608
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
1609
|
+
result[i] = Math.round(result[i]);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
return result;
|
|
1614
|
+
}; // Preserve .conversion property if there is one
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
if ('conversion' in fn) {
|
|
1618
|
+
wrappedFn.conversion = fn.conversion;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
return wrappedFn;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
models.forEach(fromModel => {
|
|
1625
|
+
convert[fromModel] = {};
|
|
1626
|
+
Object.defineProperty(convert[fromModel], 'channels', {
|
|
1627
|
+
value: conversions[fromModel].channels
|
|
1628
|
+
});
|
|
1629
|
+
Object.defineProperty(convert[fromModel], 'labels', {
|
|
1630
|
+
value: conversions[fromModel].labels
|
|
1631
|
+
});
|
|
1632
|
+
const routes = route(fromModel);
|
|
1633
|
+
const routeModels = Object.keys(routes);
|
|
1634
|
+
routeModels.forEach(toModel => {
|
|
1635
|
+
const fn = routes[toModel];
|
|
1636
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1637
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1638
|
+
});
|
|
1639
|
+
});
|
|
1640
|
+
var colorConvert = convert;
|
|
1641
|
+
|
|
1642
|
+
const _slice = [].slice;
|
|
1643
|
+
const skippedModels = [// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
1644
|
+
'keyword', // Gray conflicts with some method names, and has its own method defined.
|
|
1645
|
+
'gray', // Shouldn't really be in color-convert either...
|
|
1646
|
+
'hex'];
|
|
1647
|
+
const hashedModelKeys = {};
|
|
1648
|
+
|
|
1649
|
+
for (const model of Object.keys(colorConvert)) {
|
|
1650
|
+
hashedModelKeys[_slice.call(colorConvert[model].labels).sort().join('')] = model;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
const limiters = {};
|
|
1654
|
+
|
|
1655
|
+
function Color(object, model) {
|
|
1656
|
+
if (!(this instanceof Color)) {
|
|
1657
|
+
return new Color(object, model);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
if (model && model in skippedModels) {
|
|
1661
|
+
model = null;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
if (model && !(model in colorConvert)) {
|
|
1665
|
+
throw new Error('Unknown model: ' + model);
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
let i;
|
|
1669
|
+
let channels;
|
|
1670
|
+
|
|
1671
|
+
if (object == null) {
|
|
1672
|
+
// eslint-disable-line no-eq-null,eqeqeq
|
|
1673
|
+
this.model = 'rgb';
|
|
1674
|
+
this.color = [0, 0, 0];
|
|
1675
|
+
this.valpha = 1;
|
|
1676
|
+
} else if (object instanceof Color) {
|
|
1677
|
+
this.model = object.model;
|
|
1678
|
+
this.color = object.color.slice();
|
|
1679
|
+
this.valpha = object.valpha;
|
|
1680
|
+
} else if (typeof object === 'string') {
|
|
1681
|
+
const result = colorString.get(object);
|
|
1682
|
+
|
|
1683
|
+
if (result === null) {
|
|
1684
|
+
throw new Error('Unable to parse color from string: ' + object);
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
this.model = result.model;
|
|
1688
|
+
channels = colorConvert[this.model].channels;
|
|
1689
|
+
this.color = result.value.slice(0, channels);
|
|
1690
|
+
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
|
|
1691
|
+
} else if (object.length > 0) {
|
|
1692
|
+
this.model = model || 'rgb';
|
|
1693
|
+
channels = colorConvert[this.model].channels;
|
|
1694
|
+
|
|
1695
|
+
const newArray = _slice.call(object, 0, channels);
|
|
1696
|
+
|
|
1697
|
+
this.color = zeroArray(newArray, channels);
|
|
1698
|
+
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
|
|
1699
|
+
} else if (typeof object === 'number') {
|
|
1700
|
+
// This is always RGB - can be converted later on.
|
|
1701
|
+
this.model = 'rgb';
|
|
1702
|
+
this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
|
|
1703
|
+
this.valpha = 1;
|
|
1704
|
+
} else {
|
|
1705
|
+
this.valpha = 1;
|
|
1706
|
+
const keys = Object.keys(object);
|
|
1707
|
+
|
|
1708
|
+
if ('alpha' in object) {
|
|
1709
|
+
keys.splice(keys.indexOf('alpha'), 1);
|
|
1710
|
+
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
const hashedKeys = keys.sort().join('');
|
|
1714
|
+
|
|
1715
|
+
if (!(hashedKeys in hashedModelKeys)) {
|
|
1716
|
+
throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
this.model = hashedModelKeys[hashedKeys];
|
|
1720
|
+
const labels = colorConvert[this.model].labels;
|
|
1721
|
+
const color = [];
|
|
1722
|
+
|
|
1723
|
+
for (i = 0; i < labels.length; i++) {
|
|
1724
|
+
color.push(object[labels[i]]);
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
this.color = zeroArray(color);
|
|
1728
|
+
} // Perform limitations (clamping, etc.)
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
if (limiters[this.model]) {
|
|
1732
|
+
channels = colorConvert[this.model].channels;
|
|
1733
|
+
|
|
1734
|
+
for (i = 0; i < channels; i++) {
|
|
1735
|
+
const limit = limiters[this.model][i];
|
|
1736
|
+
|
|
1737
|
+
if (limit) {
|
|
1738
|
+
this.color[i] = limit(this.color[i]);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
1744
|
+
|
|
1745
|
+
if (Object.freeze) {
|
|
1746
|
+
Object.freeze(this);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
Color.prototype = {
|
|
1751
|
+
toString() {
|
|
1752
|
+
return this.string();
|
|
1753
|
+
},
|
|
1754
|
+
|
|
1755
|
+
toJSON() {
|
|
1756
|
+
return this[this.model]();
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
string(places) {
|
|
1760
|
+
let self = this.model in colorString.to ? this : this.rgb();
|
|
1761
|
+
self = self.round(typeof places === 'number' ? places : 1);
|
|
1762
|
+
const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
|
|
1763
|
+
return colorString.to[self.model](args);
|
|
1764
|
+
},
|
|
1765
|
+
|
|
1766
|
+
percentString(places) {
|
|
1767
|
+
const self = this.rgb().round(typeof places === 'number' ? places : 1);
|
|
1768
|
+
const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
|
|
1769
|
+
return colorString.to.rgb.percent(args);
|
|
1770
|
+
},
|
|
1771
|
+
|
|
1772
|
+
array() {
|
|
1773
|
+
return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
|
|
1774
|
+
},
|
|
1775
|
+
|
|
1776
|
+
object() {
|
|
1777
|
+
const result = {};
|
|
1778
|
+
const channels = colorConvert[this.model].channels;
|
|
1779
|
+
const labels = colorConvert[this.model].labels;
|
|
1780
|
+
|
|
1781
|
+
for (let i = 0; i < channels; i++) {
|
|
1782
|
+
result[labels[i]] = this.color[i];
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
if (this.valpha !== 1) {
|
|
1786
|
+
result.alpha = this.valpha;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
return result;
|
|
1790
|
+
},
|
|
1791
|
+
|
|
1792
|
+
unitArray() {
|
|
1793
|
+
const rgb = this.rgb().color;
|
|
1794
|
+
rgb[0] /= 255;
|
|
1795
|
+
rgb[1] /= 255;
|
|
1796
|
+
rgb[2] /= 255;
|
|
1797
|
+
|
|
1798
|
+
if (this.valpha !== 1) {
|
|
1799
|
+
rgb.push(this.valpha);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
return rgb;
|
|
1803
|
+
},
|
|
1804
|
+
|
|
1805
|
+
unitObject() {
|
|
1806
|
+
const rgb = this.rgb().object();
|
|
1807
|
+
rgb.r /= 255;
|
|
1808
|
+
rgb.g /= 255;
|
|
1809
|
+
rgb.b /= 255;
|
|
1810
|
+
|
|
1811
|
+
if (this.valpha !== 1) {
|
|
1812
|
+
rgb.alpha = this.valpha;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
return rgb;
|
|
1816
|
+
},
|
|
1817
|
+
|
|
1818
|
+
round(places) {
|
|
1819
|
+
places = Math.max(places || 0, 0);
|
|
1820
|
+
return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
|
|
1821
|
+
},
|
|
1822
|
+
|
|
1823
|
+
alpha(value) {
|
|
1824
|
+
if (arguments.length > 0) {
|
|
1825
|
+
return new Color(this.color.concat(Math.max(0, Math.min(1, value))), this.model);
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
return this.valpha;
|
|
1829
|
+
},
|
|
1830
|
+
|
|
1831
|
+
// Rgb
|
|
1832
|
+
red: getset('rgb', 0, maxfn(255)),
|
|
1833
|
+
green: getset('rgb', 1, maxfn(255)),
|
|
1834
|
+
blue: getset('rgb', 2, maxfn(255)),
|
|
1835
|
+
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
|
|
1836
|
+
saturationl: getset('hsl', 1, maxfn(100)),
|
|
1837
|
+
lightness: getset('hsl', 2, maxfn(100)),
|
|
1838
|
+
saturationv: getset('hsv', 1, maxfn(100)),
|
|
1839
|
+
value: getset('hsv', 2, maxfn(100)),
|
|
1840
|
+
chroma: getset('hcg', 1, maxfn(100)),
|
|
1841
|
+
gray: getset('hcg', 2, maxfn(100)),
|
|
1842
|
+
white: getset('hwb', 1, maxfn(100)),
|
|
1843
|
+
wblack: getset('hwb', 2, maxfn(100)),
|
|
1844
|
+
cyan: getset('cmyk', 0, maxfn(100)),
|
|
1845
|
+
magenta: getset('cmyk', 1, maxfn(100)),
|
|
1846
|
+
yellow: getset('cmyk', 2, maxfn(100)),
|
|
1847
|
+
black: getset('cmyk', 3, maxfn(100)),
|
|
1848
|
+
x: getset('xyz', 0, maxfn(100)),
|
|
1849
|
+
y: getset('xyz', 1, maxfn(100)),
|
|
1850
|
+
z: getset('xyz', 2, maxfn(100)),
|
|
1851
|
+
l: getset('lab', 0, maxfn(100)),
|
|
1852
|
+
a: getset('lab', 1),
|
|
1853
|
+
b: getset('lab', 2),
|
|
1854
|
+
|
|
1855
|
+
keyword(value) {
|
|
1856
|
+
if (arguments.length > 0) {
|
|
1857
|
+
return new Color(value);
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
return colorConvert[this.model].keyword(this.color);
|
|
1861
|
+
},
|
|
1862
|
+
|
|
1863
|
+
hex(value) {
|
|
1864
|
+
if (arguments.length > 0) {
|
|
1865
|
+
return new Color(value);
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
return colorString.to.hex(this.rgb().round().color);
|
|
1869
|
+
},
|
|
1870
|
+
|
|
1871
|
+
rgbNumber() {
|
|
1872
|
+
const rgb = this.rgb().color;
|
|
1873
|
+
return (rgb[0] & 0xFF) << 16 | (rgb[1] & 0xFF) << 8 | rgb[2] & 0xFF;
|
|
1874
|
+
},
|
|
1875
|
+
|
|
1876
|
+
luminosity() {
|
|
1877
|
+
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
1878
|
+
const rgb = this.rgb().color;
|
|
1879
|
+
const lum = [];
|
|
1880
|
+
|
|
1881
|
+
for (const [i, element] of rgb.entries()) {
|
|
1882
|
+
const chan = element / 255;
|
|
1883
|
+
lum[i] = chan <= 0.03928 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
1887
|
+
},
|
|
1888
|
+
|
|
1889
|
+
contrast(color2) {
|
|
1890
|
+
// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
1891
|
+
const lum1 = this.luminosity();
|
|
1892
|
+
const lum2 = color2.luminosity();
|
|
1893
|
+
|
|
1894
|
+
if (lum1 > lum2) {
|
|
1895
|
+
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
1899
|
+
},
|
|
1900
|
+
|
|
1901
|
+
level(color2) {
|
|
1902
|
+
const contrastRatio = this.contrast(color2);
|
|
1903
|
+
|
|
1904
|
+
if (contrastRatio >= 7.1) {
|
|
1905
|
+
return 'AAA';
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
return contrastRatio >= 4.5 ? 'AA' : '';
|
|
1909
|
+
},
|
|
1910
|
+
|
|
1911
|
+
isDark() {
|
|
1912
|
+
// YIQ equation from http://24ways.org/2010/calculating-color-contrast
|
|
1913
|
+
const rgb = this.rgb().color;
|
|
1914
|
+
const yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
|
|
1915
|
+
return yiq < 128;
|
|
1916
|
+
},
|
|
1917
|
+
|
|
1918
|
+
isLight() {
|
|
1919
|
+
return !this.isDark();
|
|
1920
|
+
},
|
|
1921
|
+
|
|
1922
|
+
negate() {
|
|
1923
|
+
const rgb = this.rgb();
|
|
1924
|
+
|
|
1925
|
+
for (let i = 0; i < 3; i++) {
|
|
1926
|
+
rgb.color[i] = 255 - rgb.color[i];
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
return rgb;
|
|
1930
|
+
},
|
|
1931
|
+
|
|
1932
|
+
lighten(ratio) {
|
|
1933
|
+
const hsl = this.hsl();
|
|
1934
|
+
hsl.color[2] += hsl.color[2] * ratio;
|
|
1935
|
+
return hsl;
|
|
1936
|
+
},
|
|
1937
|
+
|
|
1938
|
+
darken(ratio) {
|
|
1939
|
+
const hsl = this.hsl();
|
|
1940
|
+
hsl.color[2] -= hsl.color[2] * ratio;
|
|
1941
|
+
return hsl;
|
|
1942
|
+
},
|
|
1943
|
+
|
|
1944
|
+
saturate(ratio) {
|
|
1945
|
+
const hsl = this.hsl();
|
|
1946
|
+
hsl.color[1] += hsl.color[1] * ratio;
|
|
1947
|
+
return hsl;
|
|
1948
|
+
},
|
|
1949
|
+
|
|
1950
|
+
desaturate(ratio) {
|
|
1951
|
+
const hsl = this.hsl();
|
|
1952
|
+
hsl.color[1] -= hsl.color[1] * ratio;
|
|
1953
|
+
return hsl;
|
|
1954
|
+
},
|
|
1955
|
+
|
|
1956
|
+
whiten(ratio) {
|
|
1957
|
+
const hwb = this.hwb();
|
|
1958
|
+
hwb.color[1] += hwb.color[1] * ratio;
|
|
1959
|
+
return hwb;
|
|
1960
|
+
},
|
|
1961
|
+
|
|
1962
|
+
blacken(ratio) {
|
|
1963
|
+
const hwb = this.hwb();
|
|
1964
|
+
hwb.color[2] += hwb.color[2] * ratio;
|
|
1965
|
+
return hwb;
|
|
1966
|
+
},
|
|
1967
|
+
|
|
1968
|
+
grayscale() {
|
|
1969
|
+
// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
|
|
1970
|
+
const rgb = this.rgb().color;
|
|
1971
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
1972
|
+
return Color.rgb(value, value, value);
|
|
1973
|
+
},
|
|
1974
|
+
|
|
1975
|
+
fade(ratio) {
|
|
1976
|
+
return this.alpha(this.valpha - this.valpha * ratio);
|
|
1977
|
+
},
|
|
1978
|
+
|
|
1979
|
+
opaquer(ratio) {
|
|
1980
|
+
return this.alpha(this.valpha + this.valpha * ratio);
|
|
1981
|
+
},
|
|
1982
|
+
|
|
1983
|
+
rotate(degrees) {
|
|
1984
|
+
const hsl = this.hsl();
|
|
1985
|
+
let hue = hsl.color[0];
|
|
1986
|
+
hue = (hue + degrees) % 360;
|
|
1987
|
+
hue = hue < 0 ? 360 + hue : hue;
|
|
1988
|
+
hsl.color[0] = hue;
|
|
1989
|
+
return hsl;
|
|
1990
|
+
},
|
|
1991
|
+
|
|
1992
|
+
mix(mixinColor, weight) {
|
|
1993
|
+
// Ported from sass implementation in C
|
|
1994
|
+
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
|
|
1995
|
+
if (!mixinColor || !mixinColor.rgb) {
|
|
1996
|
+
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
const color1 = mixinColor.rgb();
|
|
2000
|
+
const color2 = this.rgb();
|
|
2001
|
+
const p = weight === undefined ? 0.5 : weight;
|
|
2002
|
+
const w = 2 * p - 1;
|
|
2003
|
+
const a = color1.alpha() - color2.alpha();
|
|
2004
|
+
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
2005
|
+
const w2 = 1 - w1;
|
|
2006
|
+
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));
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
}; // Model conversion methods and static constructors
|
|
2010
|
+
|
|
2011
|
+
for (const model of Object.keys(colorConvert)) {
|
|
2012
|
+
if (skippedModels.includes(model)) {
|
|
2013
|
+
continue;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
const channels = colorConvert[model].channels; // Conversion methods
|
|
2017
|
+
|
|
2018
|
+
Color.prototype[model] = function () {
|
|
2019
|
+
if (this.model === model) {
|
|
2020
|
+
return new Color(this);
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
if (arguments.length > 0) {
|
|
2024
|
+
return new Color(arguments, model);
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
const newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;
|
|
2028
|
+
return new Color(assertArray(colorConvert[this.model][model].raw(this.color)).concat(newAlpha), model);
|
|
2029
|
+
}; // 'static' construction methods
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
Color[model] = function (color) {
|
|
2033
|
+
if (typeof color === 'number') {
|
|
2034
|
+
color = zeroArray(_slice.call(arguments), channels);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
return new Color(color, model);
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
function roundTo(number, places) {
|
|
2042
|
+
return Number(number.toFixed(places));
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
function roundToPlace(places) {
|
|
2046
|
+
return function (number) {
|
|
2047
|
+
return roundTo(number, places);
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
function getset(model, channel, modifier) {
|
|
2052
|
+
model = Array.isArray(model) ? model : [model];
|
|
2053
|
+
|
|
2054
|
+
for (const m of model) {
|
|
2055
|
+
(limiters[m] || (limiters[m] = []))[channel] = modifier;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
model = model[0];
|
|
2059
|
+
return function (value) {
|
|
2060
|
+
let result;
|
|
2061
|
+
|
|
2062
|
+
if (arguments.length > 0) {
|
|
2063
|
+
if (modifier) {
|
|
2064
|
+
value = modifier(value);
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
result = this[model]();
|
|
2068
|
+
result.color[channel] = value;
|
|
2069
|
+
return result;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
result = this[model]().color[channel];
|
|
2073
|
+
|
|
2074
|
+
if (modifier) {
|
|
2075
|
+
result = modifier(result);
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
return result;
|
|
2079
|
+
};
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
function maxfn(max) {
|
|
2083
|
+
return function (v) {
|
|
2084
|
+
return Math.max(0, Math.min(max, v));
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
function assertArray(value) {
|
|
2089
|
+
return Array.isArray(value) ? value : [value];
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
function zeroArray(array, length) {
|
|
2093
|
+
for (let i = 0; i < length; i++) {
|
|
2094
|
+
if (typeof array[i] !== 'number') {
|
|
2095
|
+
array[i] = 0;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
return array;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
var color = Color;
|
|
2103
|
+
|
|
2104
|
+
const CSS = {
|
|
2105
|
+
swatch: "swatch",
|
|
2106
|
+
noColorIcon: "no-color-icon"
|
|
2107
|
+
};
|
|
2108
|
+
const COLORS = {
|
|
2109
|
+
borderLight: "rgba(0, 0, 0, 0.15)",
|
|
2110
|
+
borderDark: "rgba(255, 255, 255, 0.15)"
|
|
2111
|
+
};
|
|
2112
|
+
|
|
2113
|
+
const calciteColorPickerSwatchCss = "@-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:300ms}.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:150ms ease-in-out}:host([hidden]){display:none}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host([scale=s]){height:1.25rem;width:1.25rem}:host([scale=m]){height:1.5rem;width:1.5rem}:host([scale=l]){height:2rem;width:2rem}.swatch{overflow:visible;height:inherit;width:inherit}.swatch rect{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.no-color-icon{height:100%;width:100%;top:0;right:0;bottom:0;left:0;position:absolute}";
|
|
2114
|
+
|
|
2115
|
+
let CalciteColorPickerSwatch = class extends HTMLElement {
|
|
2116
|
+
constructor() {
|
|
2117
|
+
super();
|
|
2118
|
+
this.__registerHost();
|
|
2119
|
+
attachShadow(this);
|
|
2120
|
+
//--------------------------------------------------------------------------
|
|
2121
|
+
//
|
|
2122
|
+
// Properties
|
|
2123
|
+
//
|
|
2124
|
+
//--------------------------------------------------------------------------
|
|
2125
|
+
/**
|
|
2126
|
+
* Used to display whether the swatch is active or not.
|
|
2127
|
+
*/
|
|
2128
|
+
this.active = false;
|
|
2129
|
+
/**
|
|
2130
|
+
* The component scale.
|
|
2131
|
+
*/
|
|
2132
|
+
this.scale = "m";
|
|
2133
|
+
}
|
|
2134
|
+
handleColorChange(color$1) {
|
|
2135
|
+
this.internalColor = color(color$1);
|
|
2136
|
+
}
|
|
2137
|
+
//--------------------------------------------------------------------------
|
|
2138
|
+
//
|
|
2139
|
+
// Lifecycle
|
|
2140
|
+
//
|
|
2141
|
+
//--------------------------------------------------------------------------
|
|
2142
|
+
componentWillLoad() {
|
|
2143
|
+
this.handleColorChange(this.color);
|
|
2144
|
+
}
|
|
2145
|
+
render() {
|
|
2146
|
+
const { active, el, internalColor } = this;
|
|
2147
|
+
const borderRadius = active ? "100%" : "0";
|
|
2148
|
+
const hex = internalColor.hex();
|
|
2149
|
+
const theme = getThemeName(el);
|
|
2150
|
+
const borderColor = theme === "light" ? COLORS.borderLight : COLORS.borderDark;
|
|
2151
|
+
return (h("svg", { class: CSS.swatch, xmlns: "http://www.w3.org/2000/svg" }, h("title", null, hex), h("rect", { fill: hex, height: "100%", id: "swatch", rx: borderRadius, stroke: borderColor, "stroke-width": "2", style: { "clip-path": `inset(0 round ${borderRadius})` }, width: "100%" })));
|
|
2152
|
+
}
|
|
2153
|
+
get el() { return this; }
|
|
2154
|
+
static get watchers() { return {
|
|
2155
|
+
"color": ["handleColorChange"]
|
|
2156
|
+
}; }
|
|
2157
|
+
static get style() { return calciteColorPickerSwatchCss; }
|
|
2158
|
+
};
|
|
2159
|
+
CalciteColorPickerSwatch = /*@__PURE__*/ proxyCustomElement(CalciteColorPickerSwatch, [1, "calcite-color-picker-swatch", {
|
|
2160
|
+
"active": [516],
|
|
2161
|
+
"color": [1],
|
|
2162
|
+
"scale": [513]
|
|
2163
|
+
}]);
|
|
2164
|
+
function defineCustomElement() {
|
|
2165
|
+
const components = ["calcite-color-picker-swatch"];
|
|
2166
|
+
components.forEach(tagName => { switch (tagName) {
|
|
2167
|
+
case "calcite-color-picker-swatch":
|
|
2168
|
+
if (!customElements.get(tagName)) {
|
|
2169
|
+
customElements.define(tagName, CalciteColorPickerSwatch);
|
|
2170
|
+
}
|
|
2171
|
+
break;
|
|
2172
|
+
} });
|
|
2173
|
+
}
|
|
2174
|
+
defineCustomElement();
|
|
2175
|
+
|
|
2176
|
+
export { CalciteColorPickerSwatch as C, color as c, defineCustomElement as d };
|