@esri/calcite-components 1.4.0-next.4 → 1.4.0-next.6
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/calcite.esm.js +2 -2
- package/dist/calcite/index.esm.js +2 -2
- package/dist/calcite/{p-1b48dcda.entry.js → p-00e1b3a8.entry.js} +2 -2
- package/dist/calcite/{p-4a86d1ab.js → p-02706e35.js} +1 -1
- package/dist/calcite/p-058ac7cb.entry.js +6 -0
- package/dist/calcite/{p-be5734f7.js → p-08fb12d7.js} +2 -2
- package/dist/calcite/{p-5081856a.entry.js → p-09339f89.entry.js} +2 -2
- package/dist/calcite/{p-549d3d07.entry.js → p-0f9e9bef.entry.js} +2 -2
- package/dist/calcite/{p-198ab071.entry.js → p-15d26e08.entry.js} +2 -2
- package/dist/calcite/{p-c6c82380.entry.js → p-1678bfd5.entry.js} +2 -2
- package/dist/calcite/{p-14f78c1b.entry.js → p-18e2b588.entry.js} +2 -2
- package/dist/calcite/{p-14eccdb3.entry.js → p-198abcbb.entry.js} +2 -2
- package/dist/calcite/p-1bcc4ef2.js +6 -0
- package/dist/calcite/{p-4be0d67c.entry.js → p-20c6068d.entry.js} +2 -2
- package/dist/calcite/{p-2468ff71.js → p-238464b3.js} +1 -1
- package/dist/calcite/{p-10335369.js → p-24833d0f.js} +2 -2
- package/dist/calcite/{p-a8ae64d6.js → p-28ee6675.js} +1 -1
- package/dist/calcite/{p-f8af9a6c.js → p-2d155925.js} +1 -1
- package/dist/calcite/{p-f8ff6c94.entry.js → p-2f987df1.entry.js} +2 -2
- package/dist/calcite/{p-a0d99484.entry.js → p-309c88b2.entry.js} +2 -2
- package/dist/calcite/{p-460df0b5.js → p-36a4f2c8.js} +1 -1
- package/dist/calcite/{p-607951d2.entry.js → p-3c58757e.entry.js} +2 -2
- package/dist/calcite/{p-3465fcef.js → p-3d782f5e.js} +1 -1
- package/dist/calcite/{p-9170dc8c.entry.js → p-3e4ed9a3.entry.js} +2 -2
- package/dist/calcite/{p-29675f69.entry.js → p-3f09b972.entry.js} +2 -2
- package/dist/calcite/{p-b88213e9.entry.js → p-3fb7e1e9.entry.js} +2 -2
- package/dist/calcite/{p-4094c395.js → p-49e5e96a.js} +1 -1
- package/dist/calcite/{p-e4676089.entry.js → p-4ad0e5e7.entry.js} +2 -2
- package/dist/calcite/{p-167a7bdc.js → p-50e95bdb.js} +1 -1
- package/dist/calcite/{p-e7e84acd.entry.js → p-51f4cb23.entry.js} +2 -2
- package/dist/calcite/{p-09b5e911.entry.js → p-520cf1b0.entry.js} +2 -2
- package/dist/calcite/{p-690e8224.entry.js → p-56d69bd6.entry.js} +2 -2
- package/dist/calcite/{p-4612e3c4.entry.js → p-5b82075d.entry.js} +2 -2
- package/dist/calcite/{p-5099d131.entry.js → p-6582a43e.entry.js} +2 -2
- package/dist/calcite/{p-99546fc2.entry.js → p-6989f500.entry.js} +2 -2
- package/dist/calcite/{p-ac512a57.entry.js → p-6aadaed2.entry.js} +2 -2
- package/dist/calcite/{p-eabc3a81.entry.js → p-6c011dac.entry.js} +2 -2
- package/dist/calcite/{p-110f836d.js → p-6e1f7f1f.js} +1 -1
- package/dist/calcite/{p-762e069e.entry.js → p-70edce50.entry.js} +2 -2
- package/dist/calcite/{p-00346107.entry.js → p-71294102.entry.js} +2 -2
- package/dist/calcite/{p-c592404b.entry.js → p-721669b1.entry.js} +2 -2
- package/dist/calcite/{p-cc5d73b1.entry.js → p-7773ec0c.entry.js} +2 -2
- package/dist/calcite/{p-7aac398a.js → p-78ecccfd.js} +2 -2
- package/dist/calcite/{p-7c069e47.entry.js → p-794cd7e0.entry.js} +2 -2
- package/dist/calcite/{p-1e353e72.js → p-7e85033a.js} +1 -1
- package/dist/calcite/{p-37601822.entry.js → p-829a8016.entry.js} +2 -2
- package/dist/calcite/{p-bfa1073e.entry.js → p-8576f7a9.entry.js} +2 -2
- package/dist/calcite/{p-4dd1d026.entry.js → p-85ce36b4.entry.js} +2 -2
- package/dist/calcite/{p-fbb43fd3.entry.js → p-89b037e5.entry.js} +2 -2
- package/dist/calcite/{p-7c93f55c.entry.js → p-8bc8392a.entry.js} +2 -2
- package/dist/calcite/{p-d83e122d.js → p-8d592b3c.js} +1 -1
- package/dist/calcite/{p-bf3b07a8.entry.js → p-8d911c0f.entry.js} +2 -2
- package/dist/calcite/{p-518e42e2.js → p-8e4e219a.js} +1 -1
- package/dist/calcite/{p-798257c9.js → p-8eb6d3d6.js} +2 -2
- package/dist/calcite/{p-9d6d46fb.js → p-8eed6488.js} +1 -1
- package/dist/calcite/{p-1f65fd97.entry.js → p-902ccf8c.entry.js} +2 -2
- package/dist/calcite/{p-41b1924f.entry.js → p-90faa188.entry.js} +2 -2
- package/dist/calcite/{p-5b0e38f4.entry.js → p-94ae14ed.entry.js} +2 -2
- package/dist/calcite/{p-2477ffab.js → p-977a7373.js} +2 -2
- package/dist/calcite/{p-fc5a05c8.js → p-9c5561f6.js} +2 -2
- package/dist/calcite/{p-71ee6c09.js → p-9ecad02c.js} +2 -2
- package/dist/calcite/p-a2dcc545.js +6 -0
- package/dist/calcite/{p-6c28a6a6.entry.js → p-ac50f328.entry.js} +2 -2
- package/dist/calcite/{p-af19d2eb.entry.js → p-acbe9c99.entry.js} +2 -2
- package/dist/calcite/p-ad29a95f.js +6 -0
- package/dist/calcite/{p-3476e72e.js → p-ae330013.js} +2 -2
- package/dist/calcite/{p-88e0c279.js → p-b0388e91.js} +2 -2
- package/dist/calcite/{p-07e56bf4.js → p-b086f92d.js} +1 -1
- package/dist/calcite/p-b3099221.js +6 -0
- package/dist/calcite/{p-c33810ce.js → p-b3f59734.js} +1 -1
- package/dist/calcite/{p-12b426c9.entry.js → p-b7f76e88.entry.js} +2 -2
- package/dist/calcite/p-bb1f280b.entry.js +6 -0
- package/dist/calcite/{p-cafbf219.entry.js → p-bde56e46.entry.js} +2 -2
- package/dist/calcite/{p-48071f1a.entry.js → p-bde9a8bf.entry.js} +2 -2
- package/dist/calcite/{p-e88938fe.entry.js → p-becceac4.entry.js} +2 -2
- package/dist/calcite/p-c3bd1ae0.entry.js +6 -0
- package/dist/calcite/{p-8ac1324f.entry.js → p-c477bf75.entry.js} +2 -2
- package/dist/calcite/{p-db1f6411.js → p-c4e985ef.js} +2 -2
- package/dist/calcite/{p-605ff48d.entry.js → p-c9159a0a.entry.js} +2 -2
- package/dist/calcite/{p-4569f702.entry.js → p-ca95c6ed.entry.js} +2 -2
- package/dist/calcite/{p-dc554515.entry.js → p-cabf475d.entry.js} +2 -2
- package/dist/calcite/p-cc008746.js +6 -0
- package/dist/calcite/{p-b6d1694c.entry.js → p-cd8ecd59.entry.js} +2 -2
- package/dist/calcite/{p-b1c81dcc.js → p-cf5e973f.js} +2 -2
- package/dist/calcite/{p-90b23414.entry.js → p-d4f5d56a.entry.js} +2 -2
- package/dist/calcite/{p-0e0a4c8e.entry.js → p-dda5a868.entry.js} +2 -2
- package/dist/calcite/p-de460c7f.js +6 -0
- package/dist/calcite/p-e907c9d7.entry.js +6 -0
- package/dist/calcite/{p-23c694da.entry.js → p-e9dedbc2.entry.js} +2 -2
- package/dist/calcite/{p-74a4ac3e.js → p-ece4c169.js} +1 -1
- package/dist/calcite/{p-df5d4340.entry.js → p-ef9439cd.entry.js} +2 -2
- package/dist/calcite/p-f0eab93a.entry.js +6 -0
- package/dist/calcite/{p-01e73d3c.entry.js → p-f1dc743d.entry.js} +2 -2
- package/dist/calcite/{p-feb44263.entry.js → p-f2bf5444.entry.js} +2 -2
- package/dist/calcite/{p-ab5ba8d8.entry.js → p-f44b8d1c.entry.js} +2 -2
- package/dist/calcite/{p-083022ce.entry.js → p-fd37640e.entry.js} +2 -2
- package/dist/calcite/{p-18fe3593.entry.js → p-fd38d722.entry.js} +2 -2
- package/dist/calcite/p-ff1e2786.js +6 -0
- package/dist/cjs/{ExpandToggle-9c9692c9.js → ExpandToggle-34efb36e.js} +5 -5
- package/dist/cjs/{FloatingArrow-8cad3e02.js → FloatingArrow-ca4a438c.js} +2 -2
- package/dist/cjs/{Heading-a54c437a.js → Heading-16403a18.js} +2 -2
- package/dist/cjs/{app-globals-6921d6ca.js → app-globals-08fa4928.js} +2 -2
- package/dist/cjs/{array-11eaef78.js → array-a48e72f4.js} +1 -1
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +7 -7
- package/dist/cjs/calcite-action-bar.cjs.entry.js +15 -15
- package/dist/cjs/calcite-action-group.cjs.entry.js +13 -13
- package/dist/cjs/calcite-action-menu.cjs.entry.js +9 -9
- package/dist/cjs/calcite-action-pad.cjs.entry.js +14 -14
- package/dist/cjs/calcite-action.cjs.entry.js +11 -11
- package/dist/cjs/calcite-alert.cjs.entry.js +12 -12
- package/dist/cjs/calcite-avatar.cjs.entry.js +6 -6
- package/dist/cjs/calcite-block_2.cjs.entry.js +12 -12
- package/dist/cjs/calcite-button.cjs.entry.js +13 -13
- package/dist/cjs/calcite-card.cjs.entry.js +10 -10
- package/dist/cjs/calcite-checkbox.cjs.entry.js +10 -10
- package/dist/cjs/calcite-chip-group.cjs.entry.js +8 -8
- package/dist/cjs/calcite-chip.cjs.entry.js +12 -12
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +585 -339
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +18 -18
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +13 -13
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +12 -12
- package/dist/cjs/calcite-fab.cjs.entry.js +7 -7
- package/dist/cjs/calcite-filter.cjs.entry.js +13 -13
- package/dist/cjs/calcite-flow-item.cjs.entry.js +12 -12
- package/dist/cjs/calcite-flow.cjs.entry.js +3 -3
- package/dist/cjs/calcite-graph_2.cjs.entry.js +13 -13
- package/dist/cjs/calcite-handle.cjs.entry.js +10 -10
- package/dist/cjs/calcite-icon.cjs.entry.js +6 -6
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +12 -12
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +18 -18
- package/dist/cjs/calcite-input-message.cjs.entry.js +5 -5
- package/dist/cjs/calcite-input-number.cjs.entry.js +13 -13
- package/dist/cjs/calcite-input-text.cjs.entry.js +13 -13
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +14 -14
- package/dist/cjs/calcite-input.cjs.entry.js +13 -13
- package/dist/cjs/calcite-label.cjs.entry.js +6 -6
- package/dist/cjs/calcite-link.cjs.entry.js +7 -7
- package/dist/cjs/calcite-list_3.cjs.entry.js +50 -40
- package/dist/cjs/calcite-loader.cjs.entry.js +3 -3
- package/dist/cjs/calcite-modal.cjs.entry.js +13 -13
- package/dist/cjs/calcite-notice.cjs.entry.js +12 -12
- package/dist/cjs/calcite-option_3.cjs.entry.js +10 -10
- package/dist/cjs/calcite-pagination.cjs.entry.js +10 -10
- package/dist/cjs/calcite-panel.cjs.entry.js +14 -14
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +16 -16
- package/dist/cjs/calcite-popover.cjs.entry.js +16 -16
- package/dist/cjs/calcite-progress.cjs.entry.js +2 -2
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -3
- package/dist/cjs/calcite-radio-button.cjs.entry.js +10 -10
- package/dist/cjs/calcite-rating.cjs.entry.js +13 -13
- package/dist/cjs/calcite-scrim.cjs.entry.js +9 -9
- package/dist/cjs/calcite-segmented-control_2.cjs.entry.js +9 -9
- package/dist/cjs/calcite-shell_3.cjs.entry.js +11 -11
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -5
- package/dist/cjs/calcite-split-button.cjs.entry.js +4 -4
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +10 -10
- package/dist/cjs/calcite-switch.cjs.entry.js +10 -10
- package/dist/cjs/calcite-tab_4.cjs.entry.js +7 -7
- package/dist/cjs/calcite-text-area.cjs.entry.js +15 -15
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +5 -5
- package/dist/cjs/calcite-tile.cjs.entry.js +8 -8
- package/dist/cjs/calcite-tip_3.cjs.entry.js +11 -11
- package/dist/cjs/calcite-tooltip.cjs.entry.js +9 -9
- package/dist/cjs/calcite-tree_2.cjs.entry.js +9 -9
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +16 -16
- package/dist/cjs/calcite.cjs.js +5 -5
- package/dist/cjs/{composed-offset-position.esm-5a2f9ff8.js → composed-offset-position.esm-00262258.js} +1 -1
- package/dist/cjs/{conditionalSlot-39f2741e.js → conditionalSlot-44ce332c.js} +3 -3
- package/dist/cjs/{debounce-f09b6263.js → debounce-a2674dc4.js} +1 -1
- package/dist/cjs/{dom-1b2f41d1.js → dom-c4a69490.js} +3 -3
- package/dist/cjs/{filter-c268fa9a.js → filter-a7677076.js} +2 -2
- package/dist/cjs/{floating-ui-86f1cd7e.js → floating-ui-b9ad845e.js} +71 -65
- package/dist/cjs/{focusTrapComponent-84a6204d.js → focusTrapComponent-ad111b58.js} +2 -2
- package/dist/cjs/{form-c4ef3b01.js → form-4441b5de.js} +3 -3
- package/dist/cjs/{guid-053b3b9f.js → guid-3ea77659.js} +1 -1
- package/dist/cjs/{index-3f1e65e1.js → index-5631fa22.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{interactive-002e7de1.js → interactive-0d0f7af7.js} +1 -1
- package/dist/cjs/{key-26c7350c.js → key-5a12f647.js} +1 -1
- package/dist/cjs/{label-c5a73703.js → label-81db116a.js} +2 -2
- package/dist/cjs/{loadable-21f49ddd.js → loadable-9733bc78.js} +1 -1
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{locale-bec864db.js → locale-cd52f850.js} +4 -4
- package/dist/cjs/{math-b23a2620.js → math-d7fcd025.js} +1 -1
- package/dist/cjs/{observers-7b381996.js → observers-6aa64455.js} +1 -1
- package/dist/cjs/{openCloseComponent-d285707d.js → openCloseComponent-f2d47f5b.js} +2 -2
- package/dist/cjs/{resources-4b35c7c3.js → resources-4a16f695.js} +1 -1
- package/dist/cjs/{resources-ccc69560.js → resources-7805e29e.js} +5 -5
- package/dist/cjs/{resources-d72b2060.js → resources-9c69ee5f.js} +1 -1
- package/dist/cjs/{resources-6603995b.js → resources-a3154079.js} +1 -1
- package/dist/cjs/{resources-42c16d2f.js → resources-cb69cc10.js} +1 -1
- package/dist/cjs/{resources-adbdd1d0.js → resources-fb8b0a5e.js} +1 -1
- package/dist/cjs/{sortable.esm-e90f34c4.js → sortable.esm-b954a413.js} +1 -1
- package/dist/cjs/{t9n-d1d3fae9.js → t9n-e49fe20d.js} +3 -3
- package/dist/cjs/{throttle-d2814ea6.js → throttle-3df9debd.js} +2 -2
- package/dist/cjs/utils-136fb325.js +213 -0
- package/dist/cjs/{utils-da168911.js → utils-411455bc.js} +3 -3
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/accordion-item/accordion-item.js +1 -1
- package/dist/collection/components/accordion-item/resources.js +1 -1
- package/dist/collection/components/action/action.js +1 -1
- package/dist/collection/components/action/resources.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +1 -1
- package/dist/collection/components/action-bar/resources.js +1 -1
- package/dist/collection/components/action-bar/utils.js +1 -1
- package/dist/collection/components/action-group/action-group.js +1 -1
- package/dist/collection/components/action-group/resources.js +1 -1
- package/dist/collection/components/action-menu/action-menu.js +1 -1
- package/dist/collection/components/action-menu/resources.js +1 -1
- package/dist/collection/components/action-pad/action-pad.js +1 -1
- package/dist/collection/components/action-pad/resources.js +1 -1
- package/dist/collection/components/alert/alert.js +1 -1
- package/dist/collection/components/alert/resources.js +1 -1
- package/dist/collection/components/avatar/avatar.js +1 -1
- package/dist/collection/components/avatar/utils.js +1 -1
- package/dist/collection/components/block/block.js +1 -1
- package/dist/collection/components/block/resources.js +1 -1
- package/dist/collection/components/block-section/block-section.js +1 -1
- package/dist/collection/components/block-section/resources.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/button/resources.js +1 -1
- package/dist/collection/components/card/card.js +1 -1
- package/dist/collection/components/card/resources.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip/resources.js +1 -1
- package/dist/collection/components/chip-group/chip-group.js +1 -1
- package/dist/collection/components/color-picker/color-picker.css +59 -52
- package/dist/collection/components/color-picker/color-picker.js +448 -233
- package/dist/collection/components/color-picker/resources.js +37 -27
- package/dist/collection/components/color-picker/utils.js +116 -30
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.css +19 -16
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +225 -118
- package/dist/collection/components/color-picker-hex-input/resources.js +3 -3
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.css +10 -6
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +34 -7
- package/dist/collection/components/color-picker-swatch/resources.js +8 -2
- package/dist/collection/components/combobox/combobox.js +1 -1
- package/dist/collection/components/combobox/resources.js +1 -1
- package/dist/collection/components/combobox/utils.js +1 -1
- package/dist/collection/components/combobox-item/combobox-item.js +1 -1
- package/dist/collection/components/combobox-item/resources.js +1 -1
- package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
- package/dist/collection/components/combobox-item-group/resources.js +1 -1
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/date-picker/resources.js +1 -1
- package/dist/collection/components/date-picker/utils.js +1 -1
- package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
- package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
- package/dist/collection/components/date-picker-month-header/resources.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/dropdown/resources.js +1 -1
- package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
- package/dist/collection/components/dropdown-group/resources.js +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
- package/dist/collection/components/dropdown-item/resources.js +1 -1
- package/dist/collection/components/fab/fab.js +1 -1
- package/dist/collection/components/fab/resources.js +1 -1
- package/dist/collection/components/filter/filter.js +1 -1
- package/dist/collection/components/filter/resources.js +1 -1
- package/dist/collection/components/flow/flow.js +1 -1
- package/dist/collection/components/flow/resources.js +1 -1
- package/dist/collection/components/flow-item/flow-item.js +1 -1
- package/dist/collection/components/flow-item/resources.js +1 -1
- package/dist/collection/components/functional/ExpandToggle.js +1 -1
- package/dist/collection/components/functional/FloatingArrow.js +1 -1
- package/dist/collection/components/functional/Heading.js +1 -1
- package/dist/collection/components/graph/graph.js +1 -1
- package/dist/collection/components/graph/util.js +1 -1
- package/dist/collection/components/handle/handle.js +1 -1
- package/dist/collection/components/handle/resources.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/resources.js +1 -1
- package/dist/collection/components/icon/utils.js +1 -1
- package/dist/collection/components/inline-editable/inline-editable.js +1 -1
- package/dist/collection/components/inline-editable/resources.js +1 -1
- package/dist/collection/components/input/input.js +1 -1
- package/dist/collection/components/input/resources.js +1 -1
- package/dist/collection/components/input-date-picker/input-date-picker.js +1 -1
- package/dist/collection/components/input-date-picker/resources.js +1 -1
- package/dist/collection/components/input-message/input-message.js +1 -1
- package/dist/collection/components/input-message/interfaces.js +1 -1
- package/dist/collection/components/input-number/input-number.js +1 -1
- package/dist/collection/components/input-number/resources.js +1 -1
- package/dist/collection/components/input-text/input-text.js +1 -1
- package/dist/collection/components/input-text/resources.js +1 -1
- package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
- package/dist/collection/components/input-time-picker/resources.js +1 -1
- package/dist/collection/components/label/label.js +1 -1
- package/dist/collection/components/label/resources.js +1 -1
- package/dist/collection/components/link/link.js +1 -1
- package/dist/collection/components/list/list.js +60 -30
- package/dist/collection/components/list/resources.js +2 -2
- package/dist/collection/components/list-item/list-item.js +1 -1
- package/dist/collection/components/list-item/resources.js +1 -1
- package/dist/collection/components/list-item/utils.js +1 -1
- package/dist/collection/components/list-item-group/list-item-group.js +1 -1
- package/dist/collection/components/list-item-group/resources.js +1 -1
- package/dist/collection/components/loader/loader.js +1 -1
- package/dist/collection/components/modal/modal.js +1 -1
- package/dist/collection/components/modal/resources.js +1 -1
- package/dist/collection/components/notice/notice.js +1 -1
- package/dist/collection/components/notice/resources.js +1 -1
- package/dist/collection/components/option/option.js +1 -1
- package/dist/collection/components/option-group/option-group.js +1 -1
- package/dist/collection/components/pagination/pagination.js +1 -1
- package/dist/collection/components/pagination/resources.js +1 -1
- package/dist/collection/components/panel/panel.js +1 -1
- package/dist/collection/components/panel/resources.js +1 -1
- package/dist/collection/components/pick-list/pick-list.js +1 -1
- package/dist/collection/components/pick-list/resources.js +1 -1
- package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
- package/dist/collection/components/pick-list/shared-list-render.js +1 -1
- package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
- package/dist/collection/components/pick-list-group/resources.js +1 -1
- package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
- package/dist/collection/components/pick-list-item/resources.js +1 -1
- package/dist/collection/components/popover/PopoverManager.js +1 -1
- package/dist/collection/components/popover/popover.js +1 -1
- package/dist/collection/components/popover/resources.js +1 -1
- package/dist/collection/components/progress/progress.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +1 -1
- package/dist/collection/components/radio-button/resources.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/rating/function/star.js +1 -1
- package/dist/collection/components/rating/rating.js +1 -1
- package/dist/collection/components/resources.js +1 -1
- package/dist/collection/components/scrim/resources.js +1 -1
- package/dist/collection/components/scrim/scrim.js +1 -1
- package/dist/collection/components/segmented-control/segmented-control.js +1 -1
- package/dist/collection/components/segmented-control-item/resources.js +1 -1
- package/dist/collection/components/segmented-control-item/segmented-control-item.js +1 -1
- package/dist/collection/components/select/resources.js +1 -1
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/shell/resources.js +1 -1
- package/dist/collection/components/shell/shell.js +1 -1
- package/dist/collection/components/shell-center-row/resources.js +1 -1
- package/dist/collection/components/shell-center-row/shell-center-row.js +1 -1
- package/dist/collection/components/shell-panel/resources.js +1 -1
- package/dist/collection/components/shell-panel/shell-panel.js +1 -1
- package/dist/collection/components/slider/resources.js +1 -1
- package/dist/collection/components/slider/slider.js +1 -1
- package/dist/collection/components/sortable-list/resources.js +1 -1
- package/dist/collection/components/sortable-list/sortable-list.js +1 -1
- package/dist/collection/components/split-button/resources.js +1 -1
- package/dist/collection/components/split-button/split-button.js +1 -1
- package/dist/collection/components/stepper/stepper.js +1 -1
- package/dist/collection/components/stepper-item/stepper-item.js +1 -1
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tab-nav/tab-nav.js +1 -1
- package/dist/collection/components/tab-title/resources.js +1 -1
- package/dist/collection/components/tab-title/tab-title.js +1 -1
- package/dist/collection/components/tabs/resources.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/text-area/resources.js +1 -1
- package/dist/collection/components/text-area/text-area.js +1 -1
- package/dist/collection/components/tile/resources.js +1 -1
- package/dist/collection/components/tile/tile.js +1 -1
- package/dist/collection/components/tile-select/resources.js +1 -1
- package/dist/collection/components/tile-select/tile-select.js +1 -1
- package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
- package/dist/collection/components/time-picker/resources.js +1 -1
- package/dist/collection/components/time-picker/time-picker.js +1 -1
- package/dist/collection/components/tip/resources.js +1 -1
- package/dist/collection/components/tip/tip.js +1 -1
- package/dist/collection/components/tip-group/tip-group.js +1 -1
- package/dist/collection/components/tip-manager/resources.js +1 -1
- package/dist/collection/components/tip-manager/tip-manager.js +1 -1
- package/dist/collection/components/tooltip/TooltipManager.js +1 -1
- package/dist/collection/components/tooltip/resources.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/components/tooltip/utils.js +1 -1
- package/dist/collection/components/tree/tree.js +1 -1
- package/dist/collection/components/tree/utils.js +1 -1
- package/dist/collection/components/tree-item/resources.js +1 -1
- package/dist/collection/components/tree-item/tree-item.js +1 -1
- package/dist/collection/components/value-list/resources.js +1 -1
- package/dist/collection/components/value-list/utils.js +1 -1
- package/dist/collection/components/value-list/value-list.js +1 -1
- package/dist/collection/components/value-list-item/resources.js +1 -1
- package/dist/collection/components/value-list-item/value-list-item.js +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/utils/array.js +1 -1
- package/dist/collection/utils/conditionalSlot.js +1 -1
- package/dist/collection/utils/config.js +1 -1
- package/dist/collection/utils/date.js +1 -1
- package/dist/collection/utils/dom.js +1 -1
- package/dist/collection/utils/filter.js +1 -1
- package/dist/collection/utils/floating-ui.js +1 -1
- package/dist/collection/utils/focusTrapComponent.js +1 -1
- package/dist/collection/utils/form.js +1 -1
- package/dist/collection/utils/globalAttributes.js +1 -1
- package/dist/collection/utils/globalScript.js +1 -1
- package/dist/collection/utils/guid.js +1 -1
- package/dist/collection/utils/interactive.js +1 -1
- package/dist/collection/utils/key.js +1 -1
- package/dist/collection/utils/label.js +1 -1
- package/dist/collection/utils/loadable.js +1 -1
- package/dist/collection/utils/locale.js +1 -1
- package/dist/collection/utils/math.js +1 -1
- package/dist/collection/utils/mode.js +1 -1
- package/dist/collection/utils/number.js +1 -1
- package/dist/collection/utils/observers.js +1 -1
- package/dist/collection/utils/openCloseComponent.js +1 -1
- package/dist/collection/utils/resources.js +1 -1
- package/dist/collection/utils/t9n.js +1 -1
- package/dist/collection/utils/time.js +1 -1
- package/dist/components/ExpandToggle.js +1 -1
- package/dist/components/FloatingArrow.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/action-group.js +1 -1
- package/dist/components/action-menu.js +1 -1
- package/dist/components/action.js +1 -1
- package/dist/components/array.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calcite-accordion-item.js +1 -1
- package/dist/components/calcite-accordion.js +1 -1
- package/dist/components/calcite-action-bar.js +1 -1
- package/dist/components/calcite-action-group.js +1 -1
- package/dist/components/calcite-action-menu.js +1 -1
- package/dist/components/calcite-action-pad.js +1 -1
- package/dist/components/calcite-action.js +1 -1
- package/dist/components/calcite-alert.js +1 -1
- package/dist/components/calcite-avatar.js +1 -1
- package/dist/components/calcite-block-section.js +1 -1
- package/dist/components/calcite-block.js +1 -1
- package/dist/components/calcite-button.js +1 -1
- package/dist/components/calcite-card.js +1 -1
- package/dist/components/calcite-checkbox.js +1 -1
- package/dist/components/calcite-chip-group.js +1 -1
- package/dist/components/calcite-chip.js +1 -1
- package/dist/components/calcite-color-picker-hex-input.js +2 -2
- package/dist/components/calcite-color-picker-swatch.js +1 -1
- package/dist/components/calcite-color-picker.js +377 -314
- package/dist/components/calcite-combobox-item-group.js +1 -1
- package/dist/components/calcite-combobox-item.js +1 -1
- package/dist/components/calcite-combobox.js +1 -1
- package/dist/components/calcite-date-picker-day.js +1 -1
- package/dist/components/calcite-date-picker-month-header.js +1 -1
- package/dist/components/calcite-date-picker-month.js +1 -1
- package/dist/components/calcite-date-picker.js +1 -1
- package/dist/components/calcite-dropdown-group.js +1 -1
- package/dist/components/calcite-dropdown-item.js +1 -1
- package/dist/components/calcite-dropdown.js +1 -1
- package/dist/components/calcite-fab.js +1 -1
- package/dist/components/calcite-filter.js +1 -1
- package/dist/components/calcite-flow-item.js +1 -1
- package/dist/components/calcite-flow.js +1 -1
- package/dist/components/calcite-graph.js +1 -1
- package/dist/components/calcite-handle.js +1 -1
- package/dist/components/calcite-icon.js +1 -1
- package/dist/components/calcite-inline-editable.js +1 -1
- package/dist/components/calcite-input-date-picker.js +1 -1
- package/dist/components/calcite-input-message.js +1 -1
- package/dist/components/calcite-input-number.js +2 -617
- package/dist/components/calcite-input-text.js +1 -1
- package/dist/components/calcite-input-time-picker.js +1 -1
- package/dist/components/calcite-input.js +1 -1
- package/dist/components/calcite-label.js +1 -1
- package/dist/components/calcite-link.js +1 -1
- package/dist/components/calcite-list-item-group.js +1 -1
- package/dist/components/calcite-list-item.js +1 -1
- package/dist/components/calcite-list.js +40 -30
- package/dist/components/calcite-loader.js +1 -1
- package/dist/components/calcite-modal.js +1 -1
- package/dist/components/calcite-notice.js +1 -1
- package/dist/components/calcite-option-group.js +1 -1
- package/dist/components/calcite-option.js +1 -1
- package/dist/components/calcite-pagination.js +1 -1
- package/dist/components/calcite-panel.js +1 -1
- package/dist/components/calcite-pick-list-group.js +1 -1
- package/dist/components/calcite-pick-list-item.js +1 -1
- package/dist/components/calcite-pick-list.js +1 -1
- package/dist/components/calcite-popover.js +1 -1
- package/dist/components/calcite-progress.js +1 -1
- package/dist/components/calcite-radio-button-group.js +1 -1
- package/dist/components/calcite-radio-button.js +1 -1
- package/dist/components/calcite-rating.js +1 -1
- package/dist/components/calcite-scrim.js +1 -1
- package/dist/components/calcite-segmented-control-item.js +1 -1
- package/dist/components/calcite-segmented-control.js +1 -1
- package/dist/components/calcite-select.js +1 -1
- package/dist/components/calcite-shell-center-row.js +1 -1
- package/dist/components/calcite-shell-panel.js +1 -1
- package/dist/components/calcite-shell.js +1 -1
- package/dist/components/calcite-slider.js +1 -1
- package/dist/components/calcite-sortable-list.js +1 -1
- package/dist/components/calcite-split-button.js +1 -1
- package/dist/components/calcite-stepper-item.js +1 -1
- package/dist/components/calcite-stepper.js +1 -1
- package/dist/components/calcite-switch.js +1 -1
- package/dist/components/calcite-tab-nav.js +1 -1
- package/dist/components/calcite-tab-title.js +1 -1
- package/dist/components/calcite-tab.js +1 -1
- package/dist/components/calcite-tabs.js +1 -1
- package/dist/components/calcite-text-area.js +1 -1
- package/dist/components/calcite-tile-select-group.js +1 -1
- package/dist/components/calcite-tile-select.js +1 -1
- package/dist/components/calcite-tile.js +1 -1
- package/dist/components/calcite-time-picker.js +1 -1
- package/dist/components/calcite-tip-group.js +1 -1
- package/dist/components/calcite-tip-manager.js +1 -1
- package/dist/components/calcite-tip.js +1 -1
- package/dist/components/calcite-tooltip.js +1 -1
- package/dist/components/calcite-tree-item.js +1 -1
- package/dist/components/calcite-tree.js +1 -1
- package/dist/components/calcite-value-list-item.js +1 -1
- package/dist/components/calcite-value-list.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/color-picker-hex-input.js +252 -88
- package/dist/components/color-picker-swatch.js +42 -2118
- package/dist/components/composed-offset-position.esm.js +1 -1
- package/dist/components/conditionalSlot.js +1 -1
- package/dist/components/date-picker-day.js +1 -1
- package/dist/components/date-picker-month-header.js +1 -1
- package/dist/components/date-picker-month.js +1 -1
- package/dist/components/date-picker.js +2 -2
- package/dist/components/date.js +1 -1
- package/dist/components/debounce.js +1 -1
- package/dist/components/dom.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/filter.js +1 -1
- package/dist/components/filter2.js +1 -1
- package/dist/components/floating-ui.js +68 -62
- package/dist/components/focusTrapComponent.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/graph.js +1 -1
- package/dist/components/guid.js +1 -1
- package/dist/components/handle.js +1 -1
- package/dist/components/icon.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +2116 -0
- package/dist/components/input-number.js +623 -0
- package/dist/components/input.js +2 -2
- package/dist/components/interactive.js +1 -1
- package/dist/components/key.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label2.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loadable.js +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/locale.js +2 -2
- package/dist/components/math.js +1 -1
- package/dist/components/observers.js +1 -1
- package/dist/components/openCloseComponent.js +1 -1
- package/dist/components/panel.js +1 -1
- package/dist/components/pick-list-item.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/resources.js +1 -1
- package/dist/components/resources2.js +1 -1
- package/dist/components/resources3.js +1 -1
- package/dist/components/scrim.js +1 -1
- package/dist/components/shared-list-render.js +1 -1
- package/dist/components/sortable.esm.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/t9n.js +1 -1
- package/dist/components/tab-nav.js +1 -1
- package/dist/components/tab-title.js +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/throttle.js +1 -1
- package/dist/components/tile.js +1 -1
- package/dist/components/time-picker.js +2 -2
- package/dist/components/tooltip.js +1 -1
- package/dist/components/utils.js +112 -31
- package/dist/components/utils2.js +1 -1
- package/dist/components/utils3.js +1 -1
- package/dist/esm/{ExpandToggle-095e2f69.js → ExpandToggle-84cd3334.js} +5 -5
- package/dist/esm/{FloatingArrow-4e190499.js → FloatingArrow-2a728102.js} +2 -2
- package/dist/esm/{Heading-08826e02.js → Heading-aa5e7f03.js} +2 -2
- package/dist/esm/{app-globals-a86875ad.js → app-globals-9a63f836.js} +2 -2
- package/dist/esm/{array-937e8e63.js → array-cba42ef7.js} +1 -1
- package/dist/esm/calcite-accordion_2.entry.js +7 -7
- package/dist/esm/calcite-action-bar.entry.js +15 -15
- package/dist/esm/calcite-action-group.entry.js +13 -13
- package/dist/esm/calcite-action-menu.entry.js +9 -9
- package/dist/esm/calcite-action-pad.entry.js +14 -14
- package/dist/esm/calcite-action.entry.js +11 -11
- package/dist/esm/calcite-alert.entry.js +12 -12
- package/dist/esm/calcite-avatar.entry.js +6 -6
- package/dist/esm/calcite-block_2.entry.js +12 -12
- package/dist/esm/calcite-button.entry.js +13 -13
- package/dist/esm/calcite-card.entry.js +10 -10
- package/dist/esm/calcite-checkbox.entry.js +10 -10
- package/dist/esm/calcite-chip-group.entry.js +8 -8
- package/dist/esm/calcite-chip.entry.js +12 -12
- package/dist/esm/calcite-color-picker_3.entry.js +585 -339
- package/dist/esm/calcite-combobox_3.entry.js +18 -18
- package/dist/esm/calcite-date-picker_4.entry.js +13 -13
- package/dist/esm/calcite-dropdown_3.entry.js +12 -12
- package/dist/esm/calcite-fab.entry.js +7 -7
- package/dist/esm/calcite-filter.entry.js +13 -13
- package/dist/esm/calcite-flow-item.entry.js +12 -12
- package/dist/esm/calcite-flow.entry.js +3 -3
- package/dist/esm/calcite-graph_2.entry.js +13 -13
- package/dist/esm/calcite-handle.entry.js +10 -10
- package/dist/esm/calcite-icon.entry.js +6 -6
- package/dist/esm/calcite-inline-editable.entry.js +12 -12
- package/dist/esm/calcite-input-date-picker.entry.js +18 -18
- package/dist/esm/calcite-input-message.entry.js +5 -5
- package/dist/esm/calcite-input-number.entry.js +13 -13
- package/dist/esm/calcite-input-text.entry.js +13 -13
- package/dist/esm/calcite-input-time-picker_2.entry.js +14 -14
- package/dist/esm/calcite-input.entry.js +13 -13
- package/dist/esm/calcite-label.entry.js +6 -6
- package/dist/esm/calcite-link.entry.js +7 -7
- package/dist/esm/calcite-list_3.entry.js +50 -40
- package/dist/esm/calcite-loader.entry.js +3 -3
- package/dist/esm/calcite-modal.entry.js +13 -13
- package/dist/esm/calcite-notice.entry.js +12 -12
- package/dist/esm/calcite-option_3.entry.js +10 -10
- package/dist/esm/calcite-pagination.entry.js +10 -10
- package/dist/esm/calcite-panel.entry.js +14 -14
- package/dist/esm/calcite-pick-list_3.entry.js +16 -16
- package/dist/esm/calcite-popover.entry.js +16 -16
- package/dist/esm/calcite-progress.entry.js +2 -2
- package/dist/esm/calcite-radio-button-group.entry.js +3 -3
- package/dist/esm/calcite-radio-button.entry.js +10 -10
- package/dist/esm/calcite-rating.entry.js +13 -13
- package/dist/esm/calcite-scrim.entry.js +9 -9
- package/dist/esm/calcite-segmented-control_2.entry.js +9 -9
- package/dist/esm/calcite-shell_3.entry.js +11 -11
- package/dist/esm/calcite-sortable-list.entry.js +5 -5
- package/dist/esm/calcite-split-button.entry.js +4 -4
- package/dist/esm/calcite-stepper_2.entry.js +10 -10
- package/dist/esm/calcite-switch.entry.js +10 -10
- package/dist/esm/calcite-tab_4.entry.js +7 -7
- package/dist/esm/calcite-text-area.entry.js +15 -15
- package/dist/esm/calcite-tile-select_2.entry.js +5 -5
- package/dist/esm/calcite-tile.entry.js +8 -8
- package/dist/esm/calcite-tip_3.entry.js +11 -11
- package/dist/esm/calcite-tooltip.entry.js +9 -9
- package/dist/esm/calcite-tree_2.entry.js +9 -9
- package/dist/esm/calcite-value-list_2.entry.js +16 -16
- package/dist/esm/calcite.js +6 -6
- package/dist/esm/{composed-offset-position.esm-fb83e249.js → composed-offset-position.esm-2c2ff148.js} +1 -1
- package/dist/esm/{conditionalSlot-98fcfe31.js → conditionalSlot-734f45e3.js} +3 -3
- package/dist/esm/{debounce-911eef82.js → debounce-13053af0.js} +1 -1
- package/dist/esm/{dom-2b55c6b1.js → dom-3643d47b.js} +3 -3
- package/dist/esm/{filter-6a2a0d23.js → filter-c124b3a7.js} +2 -2
- package/dist/esm/{floating-ui-1f96fa4e.js → floating-ui-dde330fd.js} +71 -65
- package/dist/esm/{focusTrapComponent-9f5c20f0.js → focusTrapComponent-be382f0c.js} +2 -2
- package/dist/esm/{form-ef433149.js → form-9b4d08d5.js} +3 -3
- package/dist/esm/{guid-08c9d9d2.js → guid-00c961cf.js} +1 -1
- package/dist/esm/{index-34f68bbe.js → index-de813188.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/{interactive-a2eb6b56.js → interactive-7577fa95.js} +1 -1
- package/dist/esm/{key-a12e3d36.js → key-204f54dc.js} +1 -1
- package/dist/esm/{label-e5638056.js → label-aa3ca023.js} +2 -2
- package/dist/esm/{loadable-7ddbc3f7.js → loadable-295e7059.js} +1 -1
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{locale-cdbef5ac.js → locale-cf07a13b.js} +4 -4
- package/dist/esm/{math-2b6a45bc.js → math-81cb18a5.js} +1 -1
- package/dist/esm/{observers-58b3356b.js → observers-e24920a0.js} +1 -1
- package/dist/esm/{openCloseComponent-6350a6b9.js → openCloseComponent-d6957380.js} +2 -2
- package/dist/esm/{resources-f97f2e3d.js → resources-20a9105d.js} +1 -1
- package/dist/esm/{resources-95e5c0bc.js → resources-510afe06.js} +1 -1
- package/dist/esm/{resources-52988112.js → resources-b814eba0.js} +5 -5
- package/dist/esm/{resources-87498192.js → resources-b81c1240.js} +1 -1
- package/dist/esm/{resources-66bba32b.js → resources-d27d888f.js} +1 -1
- package/dist/esm/{resources-509df361.js → resources-f496ba11.js} +1 -1
- package/dist/esm/{sortable.esm-69990d9c.js → sortable.esm-8c3ec43a.js} +1 -1
- package/dist/esm/{t9n-c5155b27.js → t9n-62bf4e90.js} +3 -3
- package/dist/esm/{throttle-161e1712.js → throttle-ab3e5fce.js} +2 -2
- package/dist/esm/utils-119581ee.js +195 -0
- package/dist/esm/{utils-4c71f289.js → utils-1692b158.js} +3 -3
- package/dist/extras/docs-json.json +156 -30
- package/dist/extras/vscode-data.json +22 -2
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +54 -23
- package/dist/types/components/color-picker/interfaces.d.ts +1 -0
- package/dist/types/components/color-picker/resources.d.ts +28 -18
- package/dist/types/components/color-picker/utils.d.ts +16 -7
- package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +33 -16
- package/dist/types/components/color-picker-hex-input/resources.d.ts +2 -2
- package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +3 -2
- package/dist/types/components/color-picker-swatch/resources.d.ts +6 -1
- package/dist/types/components/list/list.d.ts +7 -2
- package/dist/types/components/list/resources.d.ts +1 -1
- package/dist/types/components.d.ts +62 -6
- package/dist/types/preact.d.ts +2 -1
- package/hydrate/index.js +796 -447
- package/package.json +4 -5
- package/dist/calcite/p-2927ff1d.js +0 -6
- package/dist/calcite/p-3623550f.entry.js +0 -6
- package/dist/calcite/p-5782f6ba.js +0 -6
- package/dist/calcite/p-5e1869b5.js +0 -6
- package/dist/calcite/p-663a4c37.js +0 -6
- package/dist/calcite/p-8b7561ca.js +0 -6
- package/dist/calcite/p-95860b15.entry.js +0 -6
- package/dist/calcite/p-b0a41644.js +0 -6
- package/dist/calcite/p-b1dcf567.js +0 -6
- package/dist/calcite/p-b73ede81.entry.js +0 -6
- package/dist/calcite/p-c107f270.entry.js +0 -6
- package/dist/calcite/p-f8d77f71.entry.js +0 -6
- package/dist/cjs/utils-78b4120a.js +0 -124
- package/dist/esm/utils-ab93be5f.js +0 -114
package/hydrate/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
* v1.4.0-next.
|
|
4
|
+
* v1.4.0-next.6
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
@@ -10389,50 +10389,91 @@ class Alert {
|
|
|
10389
10389
|
}; }
|
|
10390
10390
|
}
|
|
10391
10391
|
|
|
10392
|
-
function rgbToHex(color) {
|
|
10393
|
-
const { r, g, b } = color;
|
|
10394
|
-
return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b
|
|
10395
|
-
.toString(16)
|
|
10396
|
-
.padStart(2, "0")}`.toLowerCase();
|
|
10397
|
-
}
|
|
10398
10392
|
const hexChar = /^[0-9A-F]$/i;
|
|
10399
|
-
const
|
|
10393
|
+
const shorthandHex = /^#[0-9A-F]{3}$/i;
|
|
10400
10394
|
const longhandHex = /^#[0-9A-F]{6}$/i;
|
|
10401
|
-
|
|
10402
|
-
|
|
10395
|
+
const shorthandHexWithAlpha = /^#[0-9A-F]{4}$/i;
|
|
10396
|
+
const longhandHexWithAlpha = /^#[0-9A-F]{8}$/i;
|
|
10397
|
+
const alphaToOpacity = (alpha) => Number((alpha * 100).toFixed());
|
|
10398
|
+
const opacityToAlpha = (opacity) => Number((opacity / 100).toFixed(2));
|
|
10399
|
+
function isValidHex(hex, hasAlpha = false) {
|
|
10400
|
+
return isShorthandHex(hex, hasAlpha) || isLonghandHex(hex, hasAlpha);
|
|
10401
|
+
}
|
|
10402
|
+
function evaluateHex(hex, length, pattern) {
|
|
10403
|
+
if (!hex) {
|
|
10404
|
+
return false;
|
|
10405
|
+
}
|
|
10406
|
+
return hex.length === length && pattern.test(hex);
|
|
10403
10407
|
}
|
|
10404
|
-
function isShorthandHex(hex) {
|
|
10405
|
-
|
|
10408
|
+
function isShorthandHex(hex, hasAlpha = false) {
|
|
10409
|
+
const hexLength = hasAlpha ? 5 : 4;
|
|
10410
|
+
const hexPattern = hasAlpha ? shorthandHexWithAlpha : shorthandHex;
|
|
10411
|
+
return evaluateHex(hex, hexLength, hexPattern);
|
|
10406
10412
|
}
|
|
10407
|
-
function isLonghandHex(hex) {
|
|
10408
|
-
|
|
10413
|
+
function isLonghandHex(hex, hasAlpha = false) {
|
|
10414
|
+
const hexLength = hasAlpha ? 9 : 7;
|
|
10415
|
+
const hexPattern = hasAlpha ? longhandHexWithAlpha : longhandHex;
|
|
10416
|
+
return evaluateHex(hex, hexLength, hexPattern);
|
|
10409
10417
|
}
|
|
10410
|
-
function normalizeHex(hex) {
|
|
10418
|
+
function normalizeHex(hex, hasAlpha = false, convertFromHexToHexa = false) {
|
|
10411
10419
|
hex = hex.toLowerCase();
|
|
10412
10420
|
if (!hex.startsWith("#")) {
|
|
10413
10421
|
hex = `#${hex}`;
|
|
10414
10422
|
}
|
|
10415
|
-
if (isShorthandHex(hex)) {
|
|
10416
|
-
return rgbToHex(hexToRGB(hex));
|
|
10423
|
+
if (isShorthandHex(hex, hasAlpha)) {
|
|
10424
|
+
return rgbToHex(hexToRGB(hex, hasAlpha));
|
|
10425
|
+
}
|
|
10426
|
+
if (hasAlpha && convertFromHexToHexa && isValidHex(hex, false /* we only care about RGB hex for conversion */)) {
|
|
10427
|
+
const isShorthand = isShorthandHex(hex, false);
|
|
10428
|
+
return rgbToHex(hexToRGB(`${hex}${isShorthand ? "f" : "ff"}`, true));
|
|
10417
10429
|
}
|
|
10418
10430
|
return hex;
|
|
10419
10431
|
}
|
|
10420
|
-
function
|
|
10421
|
-
|
|
10432
|
+
function hexify(color, hasAlpha = false) {
|
|
10433
|
+
return hasAlpha ? color.hexa() : color.hex();
|
|
10434
|
+
}
|
|
10435
|
+
function rgbToHex(color) {
|
|
10436
|
+
const { r, g, b } = color;
|
|
10437
|
+
const rChars = numToHex(r);
|
|
10438
|
+
const gChars = numToHex(g);
|
|
10439
|
+
const bChars = numToHex(b);
|
|
10440
|
+
const alphaChars = "a" in color ? numToHex(color.a * 255) : "";
|
|
10441
|
+
return `#${rChars}${gChars}${bChars}${alphaChars}`.toLowerCase();
|
|
10442
|
+
}
|
|
10443
|
+
function numToHex(num) {
|
|
10444
|
+
return num.toString(16).padStart(2, "0");
|
|
10445
|
+
}
|
|
10446
|
+
function normalizeAlpha(colorObject) {
|
|
10447
|
+
const normalized = { ...colorObject, a: colorObject.alpha ?? 1 /* Color() will omit alpha if 1 */ };
|
|
10448
|
+
delete normalized.alpha;
|
|
10449
|
+
return normalized;
|
|
10450
|
+
}
|
|
10451
|
+
function normalizeColor(alphaColorObject) {
|
|
10452
|
+
const normalized = { ...alphaColorObject, alpha: alphaColorObject.a ?? 1 };
|
|
10453
|
+
delete normalized.a;
|
|
10454
|
+
return normalized;
|
|
10455
|
+
}
|
|
10456
|
+
function hexToRGB(hex, hasAlpha = false) {
|
|
10457
|
+
if (!isValidHex(hex, hasAlpha)) {
|
|
10422
10458
|
return null;
|
|
10423
10459
|
}
|
|
10424
10460
|
hex = hex.replace("#", "");
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
const
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10461
|
+
let r, g, b, a;
|
|
10462
|
+
const isShorthand = hex.length === 3 || hex.length === 4;
|
|
10463
|
+
if (isShorthand) {
|
|
10464
|
+
const [first, second, third, fourth] = hex.split("");
|
|
10465
|
+
r = parseInt(`${first}${first}`, 16);
|
|
10466
|
+
g = parseInt(`${second}${second}`, 16);
|
|
10467
|
+
b = parseInt(`${third}${third}`, 16);
|
|
10468
|
+
a = parseInt(`${fourth}${fourth}`, 16) / 255;
|
|
10469
|
+
}
|
|
10470
|
+
else {
|
|
10471
|
+
r = parseInt(hex.slice(0, 2), 16);
|
|
10472
|
+
g = parseInt(hex.slice(2, 4), 16);
|
|
10473
|
+
b = parseInt(hex.slice(4, 6), 16);
|
|
10474
|
+
a = parseInt(hex.slice(6, 8), 16) / 255;
|
|
10475
|
+
}
|
|
10476
|
+
return isNaN(a) ? { r, g, b } : { r, g, b, a };
|
|
10436
10477
|
}
|
|
10437
10478
|
// these utils allow users to pass enum values as strings without having to access the enum
|
|
10438
10479
|
// based on the approach suggested by https://github.com/microsoft/TypeScript/issues/17690#issuecomment-321365759,
|
|
@@ -10494,7 +10535,47 @@ function hasChannels(colorObject, ...channels) {
|
|
|
10494
10535
|
return channels.every((channel) => channel && colorObject && `${channel}` in colorObject);
|
|
10495
10536
|
}
|
|
10496
10537
|
function colorEqual(value1, value2) {
|
|
10497
|
-
return value1?.
|
|
10538
|
+
return value1?.rgb().array().toString() === value2?.rgb().array().toString();
|
|
10539
|
+
}
|
|
10540
|
+
function alphaCompatible(mode) {
|
|
10541
|
+
return (mode === CSSColorMode.HEXA ||
|
|
10542
|
+
mode === CSSColorMode.RGBA_CSS ||
|
|
10543
|
+
mode === CSSColorMode.HSLA_CSS ||
|
|
10544
|
+
mode === ObjectColorMode.RGBA ||
|
|
10545
|
+
mode === ObjectColorMode.HSLA ||
|
|
10546
|
+
mode === ObjectColorMode.HSVA);
|
|
10547
|
+
}
|
|
10548
|
+
function toAlphaMode(mode) {
|
|
10549
|
+
const alphaMode = mode === CSSColorMode.HEX
|
|
10550
|
+
? CSSColorMode.HEXA
|
|
10551
|
+
: mode === CSSColorMode.RGB_CSS
|
|
10552
|
+
? CSSColorMode.RGBA_CSS
|
|
10553
|
+
: mode === CSSColorMode.HSL_CSS
|
|
10554
|
+
? CSSColorMode.HSLA_CSS
|
|
10555
|
+
: mode === ObjectColorMode.RGB
|
|
10556
|
+
? ObjectColorMode.RGBA
|
|
10557
|
+
: mode === ObjectColorMode.HSL
|
|
10558
|
+
? ObjectColorMode.HSLA
|
|
10559
|
+
: mode === ObjectColorMode.HSV
|
|
10560
|
+
? ObjectColorMode.HSVA
|
|
10561
|
+
: mode;
|
|
10562
|
+
return alphaMode;
|
|
10563
|
+
}
|
|
10564
|
+
function toNonAlphaMode(mode) {
|
|
10565
|
+
const nonAlphaMode = mode === CSSColorMode.HEXA
|
|
10566
|
+
? CSSColorMode.HEX
|
|
10567
|
+
: mode === CSSColorMode.RGBA_CSS
|
|
10568
|
+
? CSSColorMode.RGB_CSS
|
|
10569
|
+
: mode === CSSColorMode.HSLA_CSS
|
|
10570
|
+
? CSSColorMode.HSL_CSS
|
|
10571
|
+
: mode === ObjectColorMode.RGBA
|
|
10572
|
+
? ObjectColorMode.RGB
|
|
10573
|
+
: mode === ObjectColorMode.HSLA
|
|
10574
|
+
? ObjectColorMode.HSL
|
|
10575
|
+
: mode === ObjectColorMode.HSVA
|
|
10576
|
+
? ObjectColorMode.HSV
|
|
10577
|
+
: mode;
|
|
10578
|
+
return nonAlphaMode;
|
|
10498
10579
|
}
|
|
10499
10580
|
|
|
10500
10581
|
/**
|
|
@@ -14378,30 +14459,36 @@ function zeroArray(array, length) {
|
|
|
14378
14459
|
var color = Color;
|
|
14379
14460
|
|
|
14380
14461
|
const CSS$P = {
|
|
14462
|
+
channel: "channel",
|
|
14463
|
+
channels: "channels",
|
|
14464
|
+
colorField: "color-field",
|
|
14465
|
+
colorFieldScope: "scope--color-field",
|
|
14466
|
+
colorMode: "color-mode",
|
|
14467
|
+
colorModeContainer: "color-mode-container",
|
|
14381
14468
|
container: "container",
|
|
14469
|
+
control: "control",
|
|
14470
|
+
controlAndScope: "control-and-scope",
|
|
14382
14471
|
controlSection: "control-section",
|
|
14383
|
-
|
|
14384
|
-
section: "section",
|
|
14472
|
+
deleteColor: "delete-color",
|
|
14385
14473
|
header: "header",
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14474
|
+
hexAndChannelsGroup: "hex-and-channels-group",
|
|
14475
|
+
hexOptions: "color-hex-options",
|
|
14476
|
+
hueScope: "scope--hue",
|
|
14477
|
+
hueSlider: "hue-slider",
|
|
14478
|
+
opacityScope: "scope--opacity",
|
|
14479
|
+
opacitySlider: "opacity-slider",
|
|
14480
|
+
preview: "preview",
|
|
14481
|
+
previewAndSliders: "preview-and-sliders",
|
|
14394
14482
|
saveColor: "save-color",
|
|
14395
|
-
|
|
14483
|
+
savedColor: "saved-color",
|
|
14484
|
+
savedColors: "saved-colors",
|
|
14396
14485
|
savedColorsButtons: "saved-colors-buttons",
|
|
14397
|
-
|
|
14398
|
-
colorFieldAndSlider: "color-field-and-slider",
|
|
14399
|
-
colorFieldAndSliderInteractive: "color-field-and-slider--interactive",
|
|
14400
|
-
colorFieldAndSliderWrap: "color-field-and-slider-wrap",
|
|
14486
|
+
savedColorsSection: "saved-colors-section",
|
|
14401
14487
|
scope: "scope",
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14488
|
+
section: "section",
|
|
14489
|
+
slider: "slider",
|
|
14490
|
+
sliders: "sliders",
|
|
14491
|
+
splitSection: "section--split"
|
|
14405
14492
|
};
|
|
14406
14493
|
const DEFAULT_COLOR$1 = color("#007AC2");
|
|
14407
14494
|
const DEFAULT_STORAGE_KEY_PREFIX = "calcite-color-";
|
|
@@ -14415,24 +14502,28 @@ const HSV_LIMITS = {
|
|
|
14415
14502
|
s: 100,
|
|
14416
14503
|
v: 100
|
|
14417
14504
|
};
|
|
14505
|
+
const OPACITY_LIMITS = {
|
|
14506
|
+
min: 0,
|
|
14507
|
+
max: 100
|
|
14508
|
+
};
|
|
14418
14509
|
const DIMENSIONS = {
|
|
14419
14510
|
s: {
|
|
14420
14511
|
slider: {
|
|
14421
|
-
height:
|
|
14422
|
-
width:
|
|
14512
|
+
height: 12,
|
|
14513
|
+
width: 104
|
|
14423
14514
|
},
|
|
14424
14515
|
colorField: {
|
|
14425
14516
|
height: 80,
|
|
14426
14517
|
width: 160
|
|
14427
14518
|
},
|
|
14428
14519
|
thumb: {
|
|
14429
|
-
radius:
|
|
14520
|
+
radius: 10
|
|
14430
14521
|
}
|
|
14431
14522
|
},
|
|
14432
14523
|
m: {
|
|
14433
14524
|
slider: {
|
|
14434
|
-
height:
|
|
14435
|
-
width:
|
|
14525
|
+
height: 12,
|
|
14526
|
+
width: 204
|
|
14436
14527
|
},
|
|
14437
14528
|
colorField: {
|
|
14438
14529
|
height: 150,
|
|
@@ -14444,15 +14535,15 @@ const DIMENSIONS = {
|
|
|
14444
14535
|
},
|
|
14445
14536
|
l: {
|
|
14446
14537
|
slider: {
|
|
14447
|
-
height:
|
|
14448
|
-
width:
|
|
14538
|
+
height: 12,
|
|
14539
|
+
width: 384
|
|
14449
14540
|
},
|
|
14450
14541
|
colorField: {
|
|
14451
14542
|
height: 200,
|
|
14452
14543
|
width: 464
|
|
14453
14544
|
},
|
|
14454
14545
|
thumb: {
|
|
14455
|
-
radius:
|
|
14546
|
+
radius: 10
|
|
14456
14547
|
}
|
|
14457
14548
|
}
|
|
14458
14549
|
};
|
|
@@ -14471,22 +14562,17 @@ const decimalPlaces = (value) => {
|
|
|
14471
14562
|
(match[2] ? +match[2] : 0));
|
|
14472
14563
|
};
|
|
14473
14564
|
|
|
14474
|
-
const colorPickerCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-h{display:none}/*!@:host([disabled])*/[disabled].sc-calcite-color-picker-h{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}/*!@:host([disabled]) *,\n:host([disabled]) ::slotted(*)*/[disabled].sc-calcite-color-picker-h *.sc-calcite-color-picker,.sc-calcite-color-picker-h[disabled] .sc-calcite-color-picker-s>*{pointer-events:none}/*!@:host*/.sc-calcite-color-picker-h{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}/*!@:host([disabled]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-color-picker-h[disabled] .sc-calcite-color-picker-s>[calcite-hydrated][disabled],[disabled].sc-calcite-color-picker-h [calcite-hydrated][disabled].sc-calcite-color-picker{opacity:1}/*!@:host([scale=s])
|
|
14565
|
+
const colorPickerCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-h{display:none}/*!@:host([disabled])*/[disabled].sc-calcite-color-picker-h{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}/*!@:host([disabled]) *,\n:host([disabled]) ::slotted(*)*/[disabled].sc-calcite-color-picker-h *.sc-calcite-color-picker,.sc-calcite-color-picker-h[disabled] .sc-calcite-color-picker-s>*{pointer-events:none}/*!@:host*/.sc-calcite-color-picker-h{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}/*!@:host([disabled]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-color-picker-h[disabled] .sc-calcite-color-picker-s>[calcite-hydrated][disabled],[disabled].sc-calcite-color-picker-h [calcite-hydrated][disabled].sc-calcite-color-picker{opacity:1}/*!@:host([scale=s])*/[scale=s].sc-calcite-color-picker-h{--calcite-color-picker-spacing:8px}/*!@:host([scale=s]) .container*/[scale=s].sc-calcite-color-picker-h .container.sc-calcite-color-picker{inline-size:160px}/*!@:host([scale=s]) .saved-colors*/[scale=s].sc-calcite-color-picker-h .saved-colors.sc-calcite-color-picker{gap:0.25rem;grid-template-columns:repeat(auto-fill, 20px)}/*!@:host([scale=m])*/[scale=m].sc-calcite-color-picker-h{--calcite-color-picker-spacing:12px}/*!@:host([scale=m]) .container*/[scale=m].sc-calcite-color-picker-h .container.sc-calcite-color-picker{inline-size:272px}/*!@:host([scale=l])*/[scale=l].sc-calcite-color-picker-h{--calcite-color-picker-spacing:16px;font-size:var(--calcite-font-size--1);line-height:1rem}/*!@:host([scale=l]) .container*/[scale=l].sc-calcite-color-picker-h .container.sc-calcite-color-picker{inline-size:464px}/*!@:host([scale=l]) .section:first-of-type*/[scale=l].sc-calcite-color-picker-h .section.sc-calcite-color-picker:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}/*!@:host([scale=l]) .saved-colors*/[scale=l].sc-calcite-color-picker-h .saved-colors.sc-calcite-color-picker{grid-template-columns:repeat(auto-fill, 32px)}/*!@:host([scale=l]) .control-section*/[scale=l].sc-calcite-color-picker-h .control-section.sc-calcite-color-picker{flex-wrap:nowrap;align-items:baseline;flex-wrap:wrap}/*!@:host([scale=l]) .color-hex-options*/[scale=l].sc-calcite-color-picker-h .color-hex-options.sc-calcite-color-picker{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around}/*!@:host([scale=l]) .color-mode-container*/[scale=l].sc-calcite-color-picker-h .color-mode-container.sc-calcite-color-picker{flex-shrink:3}/*!@.container*/.container.sc-calcite-color-picker{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}/*!@.control-and-scope*/.control-and-scope.sc-calcite-color-picker{position:relative;display:flex;cursor:pointer;touch-action:none}/*!@.scope*/.scope.sc-calcite-color-picker{position:absolute;z-index:1;font-size:var(--calcite-font-size--1);outline-color:transparent}/*!@.scope:focus*/.scope.sc-calcite-color-picker:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n );outline-offset:16px}/*!@.hex-and-channels-group*/.hex-and-channels-group.sc-calcite-color-picker{inline-size:100%}/*!@.hex-and-channels-group,\n.control-section*/.hex-and-channels-group.sc-calcite-color-picker,.control-section.sc-calcite-color-picker{display:flex;flex-direction:row;flex-wrap:wrap}/*!@.section*/.section.sc-calcite-color-picker{padding-block:0 var(--calcite-color-picker-spacing);padding-inline:var(--calcite-color-picker-spacing)}/*!@.section:first-of-type*/.section.sc-calcite-color-picker:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}/*!@.sliders*/.sliders.sc-calcite-color-picker{display:flex;flex-direction:column;justify-content:space-between;margin-inline-start:var(--calcite-color-picker-spacing)}/*!@.preview-and-sliders*/.preview-and-sliders.sc-calcite-color-picker{display:flex;align-items:center;padding:var(--calcite-color-picker-spacing)}/*!@.color-hex-options,\n.section--split*/.color-hex-options.sc-calcite-color-picker,.section--split.sc-calcite-color-picker{flex-grow:1}/*!@.header*/.header.sc-calcite-color-picker{display:flex;align-items:center;justify-content:space-between;color:var(--calcite-ui-text-1)}/*!@.color-mode-container*/.color-mode-container.sc-calcite-color-picker{padding-block-start:var(--calcite-color-picker-spacing)}/*!@.channels*/.channels.sc-calcite-color-picker{display:flex;row-gap:0.125rem}/*!@.channel[data-channel-index=\"3\"]*/.channel[data-channel-index=\"3\"].sc-calcite-color-picker{inline-size:159px}/*!@:host([scale=s]) .channels*/[scale=s].sc-calcite-color-picker-h .channels.sc-calcite-color-picker{flex-wrap:wrap}/*!@:host([scale=s]) .channel*/[scale=s].sc-calcite-color-picker-h .channel.sc-calcite-color-picker{flex-basis:30%;flex-grow:1}/*!@:host([scale=s]) .channel[data-channel-index=\"3\"]*/[scale=s].sc-calcite-color-picker-h .channel[data-channel-index=\"3\"].sc-calcite-color-picker{inline-size:unset;margin-inline-start:unset}/*!@:host([scale=l]) .channel[data-channel-index=\"3\"]*/[scale=l].sc-calcite-color-picker-h .channel[data-channel-index=\"3\"].sc-calcite-color-picker{inline-size:131px}/*!@.saved-colors*/.saved-colors.sc-calcite-color-picker{display:grid;gap:0.5rem;padding-block-start:var(--calcite-color-picker-spacing);grid-template-columns:repeat(auto-fill, 24px)}/*!@.saved-colors-buttons*/.saved-colors-buttons.sc-calcite-color-picker{display:flex}/*!@.saved-color*/.saved-color.sc-calcite-color-picker{outline-offset:0;outline-color:transparent;cursor:pointer}/*!@.saved-color:focus*/.saved-color.sc-calcite-color-picker:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}/*!@.saved-color:hover*/.saved-color.sc-calcite-color-picker:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
|
|
14475
14566
|
|
|
14476
14567
|
const throttleFor60FpsInMs = 16;
|
|
14477
|
-
const defaultValue = normalizeHex(DEFAULT_COLOR$1.hex());
|
|
14478
|
-
const defaultFormat = "auto";
|
|
14479
14568
|
class ColorPicker {
|
|
14480
14569
|
constructor(hostRef) {
|
|
14481
14570
|
registerInstance(this, hostRef);
|
|
14482
14571
|
this.calciteColorPickerChange = createEvent(this, "calciteColorPickerChange", 6);
|
|
14483
14572
|
this.calciteColorPickerInput = createEvent(this, "calciteColorPickerInput", 6);
|
|
14484
|
-
this.colorFieldAndSliderHovered = false;
|
|
14485
|
-
this.hueThumbState = "idle";
|
|
14486
14573
|
this.internalColorUpdateContext = null;
|
|
14487
14574
|
this.mode = CSSColorMode.HEX;
|
|
14488
14575
|
this.shiftKeyChannelAdjustment = 0;
|
|
14489
|
-
this.sliderThumbState = "idle";
|
|
14490
14576
|
this.handleTabActivate = (event) => {
|
|
14491
14577
|
this.channelMode = event.currentTarget.getAttribute("data-color-mode");
|
|
14492
14578
|
this.updateChannelsFromColor(this.color);
|
|
@@ -14531,7 +14617,7 @@ class ColorPicker {
|
|
|
14531
14617
|
this.internalColorSet(null);
|
|
14532
14618
|
return;
|
|
14533
14619
|
}
|
|
14534
|
-
const normalizedHex = color$1 && normalizeHex(color$1.
|
|
14620
|
+
const normalizedHex = color$1 && normalizeHex(hexify(color$1, alphaCompatible(this.mode)));
|
|
14535
14621
|
if (hex !== normalizedHex) {
|
|
14536
14622
|
this.internalColorSet(color(hex));
|
|
14537
14623
|
}
|
|
@@ -14543,16 +14629,20 @@ class ColorPicker {
|
|
|
14543
14629
|
this.handleChannelInput = (event) => {
|
|
14544
14630
|
const input = event.currentTarget;
|
|
14545
14631
|
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
14546
|
-
const
|
|
14547
|
-
|
|
14548
|
-
|
|
14632
|
+
const isAlphaChannel = channelIndex === 3;
|
|
14633
|
+
const limit = isAlphaChannel
|
|
14634
|
+
? OPACITY_LIMITS.max
|
|
14635
|
+
: this.channelMode === "rgb"
|
|
14636
|
+
? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
|
|
14637
|
+
: HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
|
|
14549
14638
|
let inputValue;
|
|
14550
14639
|
if (this.allowEmpty && !input.value) {
|
|
14551
14640
|
inputValue = "";
|
|
14552
14641
|
}
|
|
14553
14642
|
else {
|
|
14554
|
-
const value = Number(input.value)
|
|
14555
|
-
const
|
|
14643
|
+
const value = Number(input.value);
|
|
14644
|
+
const adjustedValue = value + this.shiftKeyChannelAdjustment;
|
|
14645
|
+
const clamped = clamp(adjustedValue, 0, limit);
|
|
14556
14646
|
inputValue = clamped.toString();
|
|
14557
14647
|
}
|
|
14558
14648
|
input.value = inputValue;
|
|
@@ -14566,11 +14656,13 @@ class ColorPicker {
|
|
|
14566
14656
|
const channels = [...this.channels];
|
|
14567
14657
|
const shouldClearChannels = this.allowEmpty && !input.value;
|
|
14568
14658
|
if (shouldClearChannels) {
|
|
14569
|
-
this.channels = [null, null, null];
|
|
14659
|
+
this.channels = [null, null, null, null];
|
|
14570
14660
|
this.internalColorSet(null);
|
|
14571
14661
|
return;
|
|
14572
14662
|
}
|
|
14573
|
-
|
|
14663
|
+
const isAlphaChannel = channelIndex === 3;
|
|
14664
|
+
const value = Number(input.value);
|
|
14665
|
+
channels[channelIndex] = isAlphaChannel ? opacityToAlpha(value) : value;
|
|
14574
14666
|
this.updateColorFromChannels(channels);
|
|
14575
14667
|
};
|
|
14576
14668
|
this.handleSavedColorKeyDown = (event) => {
|
|
@@ -14579,144 +14671,101 @@ class ColorPicker {
|
|
|
14579
14671
|
this.handleSavedColorSelect(event);
|
|
14580
14672
|
}
|
|
14581
14673
|
};
|
|
14582
|
-
this.
|
|
14583
|
-
this.colorFieldAndSliderInteractive = false;
|
|
14584
|
-
this.colorFieldAndSliderHovered = false;
|
|
14585
|
-
if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
|
|
14586
|
-
this.hueThumbState = "idle";
|
|
14587
|
-
this.sliderThumbState = "idle";
|
|
14588
|
-
this.drawColorFieldAndSlider();
|
|
14589
|
-
}
|
|
14590
|
-
};
|
|
14591
|
-
this.handleColorFieldAndSliderPointerDown = (event) => {
|
|
14674
|
+
this.handleColorFieldPointerDown = (event) => {
|
|
14592
14675
|
if (!isPrimaryPointerButton(event)) {
|
|
14593
14676
|
return;
|
|
14594
14677
|
}
|
|
14595
14678
|
const { offsetX, offsetY } = event;
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
this.
|
|
14600
|
-
this.
|
|
14679
|
+
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
14680
|
+
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
14681
|
+
this.activeCanvasInfo = {
|
|
14682
|
+
context: this.colorFieldRenderingContext,
|
|
14683
|
+
bounds: this.colorFieldRenderingContext.canvas.getBoundingClientRect()
|
|
14684
|
+
};
|
|
14685
|
+
this.captureColorFieldColor(offsetX, offsetY);
|
|
14686
|
+
this.colorFieldScopeNode.focus();
|
|
14687
|
+
};
|
|
14688
|
+
this.handleHueSliderPointerDown = (event) => {
|
|
14689
|
+
if (!isPrimaryPointerButton(event)) {
|
|
14690
|
+
return;
|
|
14601
14691
|
}
|
|
14602
|
-
|
|
14603
|
-
|
|
14604
|
-
|
|
14605
|
-
|
|
14692
|
+
const { offsetX } = event;
|
|
14693
|
+
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
14694
|
+
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
14695
|
+
this.activeCanvasInfo = {
|
|
14696
|
+
context: this.hueSliderRenderingContext,
|
|
14697
|
+
bounds: this.hueSliderRenderingContext.canvas.getBoundingClientRect()
|
|
14698
|
+
};
|
|
14699
|
+
this.captureHueSliderColor(offsetX);
|
|
14700
|
+
this.hueScopeNode.focus();
|
|
14701
|
+
};
|
|
14702
|
+
this.handleOpacitySliderPointerDown = (event) => {
|
|
14703
|
+
if (!isPrimaryPointerButton(event)) {
|
|
14704
|
+
return;
|
|
14606
14705
|
}
|
|
14706
|
+
const { offsetX } = event;
|
|
14607
14707
|
document.addEventListener("pointermove", this.globalPointerMoveHandler);
|
|
14608
14708
|
document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
|
|
14609
|
-
this.
|
|
14610
|
-
this.
|
|
14709
|
+
this.activeCanvasInfo = {
|
|
14710
|
+
context: this.opacitySliderRenderingContext,
|
|
14711
|
+
bounds: this.opacitySliderRenderingContext.canvas.getBoundingClientRect()
|
|
14712
|
+
};
|
|
14713
|
+
this.captureOpacitySliderValue(offsetX);
|
|
14714
|
+
this.opacityScopeNode.focus();
|
|
14611
14715
|
};
|
|
14612
14716
|
this.globalPointerUpHandler = (event) => {
|
|
14613
14717
|
if (!isPrimaryPointerButton(event)) {
|
|
14614
14718
|
return;
|
|
14615
14719
|
}
|
|
14616
|
-
const previouslyDragging = this.
|
|
14617
|
-
this.
|
|
14618
|
-
this.
|
|
14619
|
-
this.activeColorFieldAndSliderRect = null;
|
|
14620
|
-
this.drawColorFieldAndSlider();
|
|
14720
|
+
const previouslyDragging = this.activeCanvasInfo;
|
|
14721
|
+
this.activeCanvasInfo = null;
|
|
14722
|
+
this.drawColorControls();
|
|
14621
14723
|
if (previouslyDragging) {
|
|
14622
14724
|
this.calciteColorPickerChange.emit();
|
|
14623
14725
|
}
|
|
14624
14726
|
};
|
|
14625
14727
|
this.globalPointerMoveHandler = (event) => {
|
|
14626
|
-
const {
|
|
14627
|
-
|
|
14628
|
-
const hueThumbDragging = this.hueThumbState === "drag";
|
|
14629
|
-
if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
|
|
14728
|
+
const { activeCanvasInfo, el } = this;
|
|
14729
|
+
if (!el.isConnected || !activeCanvasInfo) {
|
|
14630
14730
|
return;
|
|
14631
14731
|
}
|
|
14732
|
+
const { context, bounds } = activeCanvasInfo;
|
|
14632
14733
|
let samplingX;
|
|
14633
14734
|
let samplingY;
|
|
14634
|
-
const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
|
|
14635
14735
|
const { clientX, clientY } = event;
|
|
14636
|
-
if (
|
|
14637
|
-
samplingX = clientX -
|
|
14638
|
-
samplingY = clientY -
|
|
14736
|
+
if (context.canvas.matches(":hover")) {
|
|
14737
|
+
samplingX = clientX - bounds.x;
|
|
14738
|
+
samplingY = clientY - bounds.y;
|
|
14639
14739
|
}
|
|
14640
14740
|
else {
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
samplingX = clientX - colorFieldAndSliderRect.x;
|
|
14647
|
-
}
|
|
14648
|
-
else if (clientX < colorFieldAndSliderRect.x) {
|
|
14741
|
+
// snap x and y to the closest edge
|
|
14742
|
+
if (clientX < bounds.x + bounds.width && clientX > bounds.x) {
|
|
14743
|
+
samplingX = clientX - bounds.x;
|
|
14744
|
+
}
|
|
14745
|
+
else if (clientX < bounds.x) {
|
|
14649
14746
|
samplingX = 0;
|
|
14650
14747
|
}
|
|
14651
14748
|
else {
|
|
14652
|
-
samplingX =
|
|
14749
|
+
samplingX = bounds.width;
|
|
14653
14750
|
}
|
|
14654
|
-
if (clientY <
|
|
14655
|
-
clientY
|
|
14656
|
-
samplingY = clientY - colorFieldAndSliderRect.y;
|
|
14751
|
+
if (clientY < bounds.y + bounds.height && clientY > bounds.y) {
|
|
14752
|
+
samplingY = clientY - bounds.y;
|
|
14657
14753
|
}
|
|
14658
|
-
else if (clientY <
|
|
14754
|
+
else if (clientY < bounds.y) {
|
|
14659
14755
|
samplingY = 0;
|
|
14660
14756
|
}
|
|
14661
14757
|
else {
|
|
14662
|
-
samplingY =
|
|
14758
|
+
samplingY = bounds.height;
|
|
14663
14759
|
}
|
|
14664
14760
|
}
|
|
14665
|
-
if (
|
|
14761
|
+
if (context === this.colorFieldRenderingContext) {
|
|
14666
14762
|
this.captureColorFieldColor(samplingX, samplingY, false);
|
|
14667
14763
|
}
|
|
14668
|
-
else {
|
|
14764
|
+
else if (context === this.hueSliderRenderingContext) {
|
|
14669
14765
|
this.captureHueSliderColor(samplingX);
|
|
14670
14766
|
}
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
const { dimensions: { colorField, slider, thumb } } = this;
|
|
14674
|
-
this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
|
|
14675
|
-
this.colorFieldAndSliderHovered = true;
|
|
14676
|
-
const region = this.getCanvasRegion(offsetY);
|
|
14677
|
-
if (region === "color-field") {
|
|
14678
|
-
const prevHueThumbState = this.hueThumbState;
|
|
14679
|
-
const color = this.baseColorFieldColor.hsv();
|
|
14680
|
-
const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
|
|
14681
|
-
const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
|
|
14682
|
-
const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
|
|
14683
|
-
let transitionedBetweenHoverAndIdle = false;
|
|
14684
|
-
if (prevHueThumbState === "idle" && hoveringThumb) {
|
|
14685
|
-
this.hueThumbState = "hover";
|
|
14686
|
-
transitionedBetweenHoverAndIdle = true;
|
|
14687
|
-
}
|
|
14688
|
-
else if (prevHueThumbState === "hover" && !hoveringThumb) {
|
|
14689
|
-
this.hueThumbState = "idle";
|
|
14690
|
-
transitionedBetweenHoverAndIdle = true;
|
|
14691
|
-
}
|
|
14692
|
-
if (this.hueThumbState !== "drag") {
|
|
14693
|
-
if (transitionedBetweenHoverAndIdle) {
|
|
14694
|
-
// refresh since we won't update color and thus no redraw
|
|
14695
|
-
this.drawColorFieldAndSlider();
|
|
14696
|
-
}
|
|
14697
|
-
}
|
|
14698
|
-
}
|
|
14699
|
-
else if (region === "slider") {
|
|
14700
|
-
const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
|
|
14701
|
-
const prevSliderThumbState = this.sliderThumbState;
|
|
14702
|
-
const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
|
|
14703
|
-
const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
|
|
14704
|
-
const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
|
|
14705
|
-
let sliderThumbTransitionedBetweenHoverAndIdle = false;
|
|
14706
|
-
if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
|
|
14707
|
-
this.sliderThumbState = "hover";
|
|
14708
|
-
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
14709
|
-
}
|
|
14710
|
-
else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
|
|
14711
|
-
this.sliderThumbState = "idle";
|
|
14712
|
-
sliderThumbTransitionedBetweenHoverAndIdle = true;
|
|
14713
|
-
}
|
|
14714
|
-
if (this.sliderThumbState !== "drag") {
|
|
14715
|
-
if (sliderThumbTransitionedBetweenHoverAndIdle) {
|
|
14716
|
-
// refresh since we won't update color and thus no redraw
|
|
14717
|
-
this.drawColorFieldAndSlider();
|
|
14718
|
-
}
|
|
14719
|
-
}
|
|
14767
|
+
else if (context === this.opacitySliderRenderingContext) {
|
|
14768
|
+
this.captureOpacitySliderValue(samplingX);
|
|
14720
14769
|
}
|
|
14721
14770
|
};
|
|
14722
14771
|
this.storeColorFieldScope = (node) => {
|
|
@@ -14732,23 +14781,35 @@ class ColorPicker {
|
|
|
14732
14781
|
return (hAsync("calcite-tab-title", { class: CSS$P.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate, selected: selected }, label));
|
|
14733
14782
|
};
|
|
14734
14783
|
this.renderChannelsTab = (channelMode) => {
|
|
14735
|
-
const { channelMode: activeChannelMode, channels, messages } = this;
|
|
14784
|
+
const { allowEmpty, channelMode: activeChannelMode, channels, messages, alphaChannel } = this;
|
|
14736
14785
|
const selected = channelMode === activeChannelMode;
|
|
14737
14786
|
const isRgb = channelMode === "rgb";
|
|
14738
|
-
const channelLabels = isRgb
|
|
14739
|
-
? [messages.r, messages.g, messages.b]
|
|
14740
|
-
: [messages.h, messages.s, messages.v];
|
|
14741
14787
|
const channelAriaLabels = isRgb
|
|
14742
14788
|
? [messages.red, messages.green, messages.blue]
|
|
14743
14789
|
: [messages.hue, messages.saturation, messages.value];
|
|
14744
14790
|
const direction = getElementDir(this.el);
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14791
|
+
const channelsToRender = alphaChannel ? channels : channels.slice(0, 3);
|
|
14792
|
+
return (hAsync("calcite-tab", { class: CSS$P.control, key: channelMode, selected: selected }, hAsync("div", { class: CSS$P.channels, dir: "ltr" }, channelsToRender.map((channelValue, index) => {
|
|
14793
|
+
const isAlphaChannel = index === 3;
|
|
14794
|
+
if (isAlphaChannel) {
|
|
14795
|
+
channelValue =
|
|
14796
|
+
allowEmpty && !channelValue ? channelValue : alphaToOpacity(channelValue);
|
|
14797
|
+
}
|
|
14798
|
+
/* the channel container is ltr, so we apply the host's direction */
|
|
14799
|
+
return this.renderChannel(channelValue, index, channelAriaLabels[index], direction, isAlphaChannel ? "%" : "");
|
|
14800
|
+
}))));
|
|
14801
|
+
};
|
|
14802
|
+
this.renderChannel = (value, index, ariaLabel, direction, suffix) => {
|
|
14803
|
+
return (hAsync("calcite-input", { class: CSS$P.channel, "data-channel-index": index, dir: direction, key: index, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, scale: this.scale === "l" ? "m" : "s",
|
|
14804
|
+
// workaround to ensure input borders overlap as desired
|
|
14805
|
+
// this is because the build transforms margin-left to its
|
|
14806
|
+
// logical-prop, which is undesired as channels are always ltr
|
|
14807
|
+
style: {
|
|
14808
|
+
marginLeft: index > 0 && !(this.scale === "s" && this.alphaChannel && index === 3) ? "-1px" : ""
|
|
14809
|
+
}, suffixText: suffix, type: "number", value: value?.toString() }));
|
|
14748
14810
|
};
|
|
14749
|
-
this.renderChannel = (value, index, label, ariaLabel, direction) => (hAsync("calcite-input", { class: CSS$P.channel, "data-channel-index": index, dir: direction, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value?.toString() }));
|
|
14750
14811
|
this.deleteColor = () => {
|
|
14751
|
-
const colorToDelete = this.color.
|
|
14812
|
+
const colorToDelete = hexify(this.color, this.alphaChannel);
|
|
14752
14813
|
const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
|
|
14753
14814
|
if (!inStorage) {
|
|
14754
14815
|
return;
|
|
@@ -14761,7 +14822,7 @@ class ColorPicker {
|
|
|
14761
14822
|
}
|
|
14762
14823
|
};
|
|
14763
14824
|
this.saveColor = () => {
|
|
14764
|
-
const colorToSave = this.color.
|
|
14825
|
+
const colorToSave = hexify(this.color, this.alphaChannel);
|
|
14765
14826
|
const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
|
|
14766
14827
|
if (alreadySaved) {
|
|
14767
14828
|
return;
|
|
@@ -14773,12 +14834,18 @@ class ColorPicker {
|
|
|
14773
14834
|
localStorage.setItem(storageKey, JSON.stringify(savedColors));
|
|
14774
14835
|
}
|
|
14775
14836
|
};
|
|
14776
|
-
this.
|
|
14777
|
-
if (
|
|
14778
|
-
|
|
14837
|
+
this.drawColorControls = throttle$1((type = "all") => {
|
|
14838
|
+
if ((type === "all" || type === "color-field") && this.colorFieldRenderingContext) {
|
|
14839
|
+
this.drawColorField();
|
|
14840
|
+
}
|
|
14841
|
+
if ((type === "all" || type === "hue-slider") && this.hueSliderRenderingContext) {
|
|
14842
|
+
this.drawHueSlider();
|
|
14843
|
+
}
|
|
14844
|
+
if (this.alphaChannel &&
|
|
14845
|
+
(type === "all" || type === "opacity-slider") &&
|
|
14846
|
+
this.opacitySliderRenderingContext) {
|
|
14847
|
+
this.drawOpacitySlider();
|
|
14779
14848
|
}
|
|
14780
|
-
this.drawColorField();
|
|
14781
|
-
this.drawHueSlider();
|
|
14782
14849
|
}, throttleFor60FpsInMs);
|
|
14783
14850
|
this.captureColorFieldColor = (x, y, skipEqual = true) => {
|
|
14784
14851
|
const { dimensions: { colorField: { height, width } } } = this;
|
|
@@ -14786,24 +14853,56 @@ class ColorPicker {
|
|
|
14786
14853
|
const value = Math.round((HSV_LIMITS.v / height) * (height - y));
|
|
14787
14854
|
this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
|
|
14788
14855
|
};
|
|
14789
|
-
this.
|
|
14790
|
-
this.
|
|
14791
|
-
this.updateCanvasSize(
|
|
14856
|
+
this.initColorField = (canvas) => {
|
|
14857
|
+
this.colorFieldRenderingContext = canvas.getContext("2d");
|
|
14858
|
+
this.updateCanvasSize("color-field");
|
|
14859
|
+
this.drawColorControls();
|
|
14860
|
+
};
|
|
14861
|
+
this.initHueSlider = (canvas) => {
|
|
14862
|
+
this.hueSliderRenderingContext = canvas.getContext("2d");
|
|
14863
|
+
this.updateCanvasSize("hue-slider");
|
|
14864
|
+
this.drawHueSlider();
|
|
14865
|
+
};
|
|
14866
|
+
this.initOpacitySlider = (canvas) => {
|
|
14867
|
+
this.opacitySliderRenderingContext = canvas.getContext("2d");
|
|
14868
|
+
this.updateCanvasSize("opacity-slider");
|
|
14869
|
+
this.drawOpacitySlider();
|
|
14870
|
+
};
|
|
14871
|
+
this.storeOpacityScope = (node) => {
|
|
14872
|
+
this.opacityScopeNode = node;
|
|
14873
|
+
};
|
|
14874
|
+
this.handleOpacityScopeKeyDown = (event) => {
|
|
14875
|
+
const modifier = event.shiftKey ? 10 : 1;
|
|
14876
|
+
const { key } = event;
|
|
14877
|
+
const arrowKeyToXOffset = {
|
|
14878
|
+
ArrowUp: 1,
|
|
14879
|
+
ArrowRight: 1,
|
|
14880
|
+
ArrowDown: -1,
|
|
14881
|
+
ArrowLeft: -1
|
|
14882
|
+
};
|
|
14883
|
+
if (arrowKeyToXOffset[key]) {
|
|
14884
|
+
event.preventDefault();
|
|
14885
|
+
const delta = opacityToAlpha(arrowKeyToXOffset[key] * modifier);
|
|
14886
|
+
this.captureHueSliderColor(this.opacityScopeLeft + delta);
|
|
14887
|
+
}
|
|
14792
14888
|
};
|
|
14793
14889
|
this.allowEmpty = false;
|
|
14890
|
+
this.alphaChannel = false;
|
|
14891
|
+
this.channelsDisabled = false;
|
|
14794
14892
|
this.color = DEFAULT_COLOR$1;
|
|
14795
14893
|
this.disabled = false;
|
|
14796
|
-
this.format =
|
|
14797
|
-
this.hideHex = false;
|
|
14894
|
+
this.format = "auto";
|
|
14798
14895
|
this.hideChannels = false;
|
|
14896
|
+
this.hexDisabled = false;
|
|
14897
|
+
this.hideHex = false;
|
|
14799
14898
|
this.hideSaved = false;
|
|
14899
|
+
this.savedDisabled = false;
|
|
14800
14900
|
this.scale = "m";
|
|
14801
14901
|
this.storageId = undefined;
|
|
14802
14902
|
this.messageOverrides = undefined;
|
|
14803
14903
|
this.numberingSystem = undefined;
|
|
14804
|
-
this.value =
|
|
14904
|
+
this.value = normalizeHex(hexify(DEFAULT_COLOR$1, this.alphaChannel));
|
|
14805
14905
|
this.defaultMessages = undefined;
|
|
14806
|
-
this.colorFieldAndSliderInteractive = false;
|
|
14807
14906
|
this.channelMode = "rgb";
|
|
14808
14907
|
this.channels = this.toChannels(DEFAULT_COLOR$1);
|
|
14809
14908
|
this.dimensions = DIMENSIONS.m;
|
|
@@ -14812,12 +14911,19 @@ class ColorPicker {
|
|
|
14812
14911
|
this.savedColors = [];
|
|
14813
14912
|
this.colorFieldScopeTop = undefined;
|
|
14814
14913
|
this.colorFieldScopeLeft = undefined;
|
|
14815
|
-
this.scopeOrientation = undefined;
|
|
14816
14914
|
this.hueScopeLeft = undefined;
|
|
14817
|
-
this.
|
|
14915
|
+
this.opacityScopeLeft = undefined;
|
|
14916
|
+
this.scopeOrientation = undefined;
|
|
14917
|
+
}
|
|
14918
|
+
handleAlphaChannelChange(alphaChannel) {
|
|
14919
|
+
const { format } = this;
|
|
14920
|
+
if (alphaChannel && format !== "auto" && !alphaCompatible(format)) {
|
|
14921
|
+
console.warn(`ignoring alphaChannel as the current format (${format}) does not support alpha`);
|
|
14922
|
+
this.alphaChannel = false;
|
|
14923
|
+
}
|
|
14818
14924
|
}
|
|
14819
14925
|
handleColorChange(color, oldColor) {
|
|
14820
|
-
this.
|
|
14926
|
+
this.drawColorControls();
|
|
14821
14927
|
this.updateChannelsFromColor(color);
|
|
14822
14928
|
this.previousColor = oldColor;
|
|
14823
14929
|
}
|
|
@@ -14827,7 +14933,8 @@ class ColorPicker {
|
|
|
14827
14933
|
}
|
|
14828
14934
|
handleScaleChange(scale = "m") {
|
|
14829
14935
|
this.updateDimensions(scale);
|
|
14830
|
-
this.updateCanvasSize(
|
|
14936
|
+
this.updateCanvasSize("all");
|
|
14937
|
+
this.drawColorControls();
|
|
14831
14938
|
}
|
|
14832
14939
|
onMessagesChange() {
|
|
14833
14940
|
/* wired up by t9n util */
|
|
@@ -14844,9 +14951,9 @@ class ColorPicker {
|
|
|
14844
14951
|
return;
|
|
14845
14952
|
}
|
|
14846
14953
|
modeChanged = this.mode !== nextMode;
|
|
14847
|
-
this.setMode(nextMode);
|
|
14954
|
+
this.setMode(nextMode, this.internalColorUpdateContext === null);
|
|
14848
14955
|
}
|
|
14849
|
-
const dragging = this.
|
|
14956
|
+
const dragging = this.activeCanvasInfo;
|
|
14850
14957
|
if (this.internalColorUpdateContext === "initial") {
|
|
14851
14958
|
return;
|
|
14852
14959
|
}
|
|
@@ -14857,17 +14964,16 @@ class ColorPicker {
|
|
|
14857
14964
|
}
|
|
14858
14965
|
return;
|
|
14859
14966
|
}
|
|
14860
|
-
const color$1 = allowEmpty && !value
|
|
14967
|
+
const color$1 = allowEmpty && !value
|
|
14968
|
+
? null
|
|
14969
|
+
: color(value != null && typeof value === "object" && alphaCompatible(this.mode)
|
|
14970
|
+
? normalizeColor(value)
|
|
14971
|
+
: value);
|
|
14861
14972
|
const colorChanged = !colorEqual(color$1, this.color);
|
|
14862
14973
|
if (modeChanged || colorChanged) {
|
|
14863
|
-
this.internalColorSet(color$1,
|
|
14974
|
+
this.internalColorSet(color$1, this.alphaChannel && !(this.mode.endsWith("a") || this.mode.endsWith("a-css")), "internal");
|
|
14864
14975
|
}
|
|
14865
14976
|
}
|
|
14866
|
-
//--------------------------------------------------------------------------
|
|
14867
|
-
//
|
|
14868
|
-
// Internal State/Props
|
|
14869
|
-
//
|
|
14870
|
-
//--------------------------------------------------------------------------
|
|
14871
14977
|
get baseColorFieldColor() {
|
|
14872
14978
|
return this.color || this.previousColor || DEFAULT_COLOR$1;
|
|
14873
14979
|
}
|
|
@@ -14923,7 +15029,7 @@ class ColorPicker {
|
|
|
14923
15029
|
if (!valueIsCompatible) {
|
|
14924
15030
|
this.showIncompatibleColorWarning(value, format);
|
|
14925
15031
|
}
|
|
14926
|
-
this.setMode(format);
|
|
15032
|
+
this.setMode(format, false);
|
|
14927
15033
|
this.internalColorSet(initialColor, false, "initial");
|
|
14928
15034
|
this.updateDimensions(this.scale);
|
|
14929
15035
|
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
@@ -14954,34 +15060,38 @@ class ColorPicker {
|
|
|
14954
15060
|
//
|
|
14955
15061
|
//--------------------------------------------------------------------------
|
|
14956
15062
|
render() {
|
|
14957
|
-
const { allowEmpty, color,
|
|
14958
|
-
const selectedColorInHex = color ? color
|
|
14959
|
-
const
|
|
14960
|
-
const
|
|
14961
|
-
const
|
|
14962
|
-
const
|
|
15063
|
+
const { allowEmpty, channelsDisabled, color, colorFieldScopeLeft, colorFieldScopeTop, dimensions: { colorField: { width: colorFieldWidth }, slider: { width: sliderWidth }, thumb: { radius: thumbRadius } }, hexDisabled, hideChannels, hideHex, hideSaved, hueScopeLeft, messages, alphaChannel, opacityScopeLeft, savedColors, savedDisabled, scale, scopeOrientation } = this;
|
|
15064
|
+
const selectedColorInHex = color ? hexify(color, alphaChannel) : null;
|
|
15065
|
+
const hueTop = thumbRadius;
|
|
15066
|
+
const hueLeft = hueScopeLeft ?? (sliderWidth * DEFAULT_COLOR$1.hue()) / HSV_LIMITS.h;
|
|
15067
|
+
const opacityTop = thumbRadius;
|
|
15068
|
+
const opacityLeft = opacityScopeLeft ??
|
|
15069
|
+
(colorFieldWidth * alphaToOpacity(DEFAULT_COLOR$1.alpha())) / OPACITY_LIMITS.max;
|
|
14963
15070
|
const noColor = color === null;
|
|
14964
15071
|
const vertical = scopeOrientation === "vertical";
|
|
14965
|
-
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
15072
|
+
const noHex = hexDisabled || hideHex;
|
|
15073
|
+
const noChannels = channelsDisabled || hideChannels;
|
|
15074
|
+
const noSaved = savedDisabled || hideSaved;
|
|
15075
|
+
return (hAsync("div", { class: CSS$P.container }, hAsync("div", { class: CSS$P.controlAndScope }, hAsync("canvas", { class: CSS$P.colorField, onPointerDown: this.handleColorFieldPointerDown,
|
|
15076
|
+
// eslint-disable-next-line react/jsx-sort-props
|
|
15077
|
+
ref: this.initColorField }), hAsync("div", { "aria-label": vertical ? messages.value : messages.saturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color?.saturationv() : color?.value()) || "0", class: { [CSS$P.scope]: true, [CSS$P.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
|
|
14969
15078
|
// eslint-disable-next-line react/jsx-sort-props
|
|
14970
|
-
ref: this.
|
|
15079
|
+
ref: this.storeColorFieldScope })), hAsync("div", { class: CSS$P.previewAndSliders }, hAsync("calcite-color-picker-swatch", { class: CSS$P.preview, color: selectedColorInHex, scale: "l" }), hAsync("div", { class: CSS$P.sliders }, hAsync("div", { class: CSS$P.controlAndScope }, hAsync("canvas", { class: { [CSS$P.slider]: true, [CSS$P.hueSlider]: true }, onPointerDown: this.handleHueSliderPointerDown,
|
|
14971
15080
|
// eslint-disable-next-line react/jsx-sort-props
|
|
14972
|
-
ref: this.
|
|
15081
|
+
ref: this.initHueSlider }), hAsync("div", { "aria-label": messages.hue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": color?.round().hue() || DEFAULT_COLOR$1.round().hue(), class: { [CSS$P.scope]: true, [CSS$P.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0",
|
|
14973
15082
|
// eslint-disable-next-line react/jsx-sort-props
|
|
14974
|
-
ref: this.storeHueScope })),
|
|
15083
|
+
ref: this.storeHueScope })), alphaChannel ? (hAsync("div", { class: CSS$P.controlAndScope }, hAsync("canvas", { class: { [CSS$P.slider]: true, [CSS$P.opacitySlider]: true }, onPointerDown: this.handleOpacitySliderPointerDown,
|
|
15084
|
+
// eslint-disable-next-line react/jsx-sort-props
|
|
15085
|
+
ref: this.initOpacitySlider }), hAsync("div", { "aria-label": messages.opacity, "aria-valuemax": OPACITY_LIMITS.max, "aria-valuemin": OPACITY_LIMITS.min, "aria-valuenow": (color || DEFAULT_COLOR$1).round().alpha(), class: { [CSS$P.scope]: true, [CSS$P.opacityScope]: true }, onKeyDown: this.handleOpacityScopeKeyDown, role: "slider", style: { top: `${opacityTop}px`, left: `${opacityLeft}px` }, tabindex: "0",
|
|
15086
|
+
// eslint-disable-next-line react/jsx-sort-props
|
|
15087
|
+
ref: this.storeOpacityScope }))) : null)), noHex && noChannels ? null : (hAsync("div", { class: {
|
|
14975
15088
|
[CSS$P.controlSection]: true,
|
|
14976
15089
|
[CSS$P.section]: true
|
|
14977
|
-
} },
|
|
14978
|
-
[CSS$P.header]: true,
|
|
14979
|
-
[CSS$P.headerHex]: true
|
|
14980
|
-
} }, messages.hex), hAsync("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS$P.control, hexLabel: messages.hex, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (hAsync("calcite-tabs", { class: {
|
|
15090
|
+
} }, hAsync("div", { class: CSS$P.hexAndChannelsGroup }, noHex ? null : (hAsync("div", { class: CSS$P.hexOptions }, hAsync("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, alphaChannel: alphaChannel, class: CSS$P.control, messages: messages, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: scale, value: selectedColorInHex }))), noChannels ? null : (hAsync("calcite-tabs", { class: {
|
|
14981
15091
|
[CSS$P.colorModeContainer]: true,
|
|
14982
15092
|
[CSS$P.splitSection]: true
|
|
14983
|
-
}, scale:
|
|
14984
|
-
...savedColors.map((color) => (hAsync("calcite-color-picker-swatch", {
|
|
15093
|
+
}, scale: scale === "l" ? "m" : "s" }, hAsync("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv")))))), noSaved ? null : (hAsync("div", { class: { [CSS$P.savedColorsSection]: true, [CSS$P.section]: true } }, hAsync("div", { class: CSS$P.header }, hAsync("label", null, messages.saved), hAsync("div", { class: CSS$P.savedColorsButtons }, hAsync("calcite-button", { appearance: "transparent", class: CSS$P.deleteColor, disabled: noColor, iconStart: "minus", kind: "neutral", label: messages.deleteColor, onClick: this.deleteColor, scale: scale, type: "button" }), hAsync("calcite-button", { appearance: "transparent", class: CSS$P.saveColor, disabled: noColor, iconStart: "plus", kind: "neutral", label: messages.saveColor, onClick: this.saveColor, scale: scale, type: "button" }))), savedColors.length > 0 ? (hAsync("div", { class: CSS$P.savedColors }, [
|
|
15094
|
+
...savedColors.map((color) => (hAsync("calcite-color-picker-swatch", { class: CSS$P.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
|
|
14985
15095
|
])) : null))));
|
|
14986
15096
|
}
|
|
14987
15097
|
// --------------------------------------------------------------------------
|
|
@@ -14997,23 +15107,38 @@ class ColorPicker {
|
|
|
14997
15107
|
showIncompatibleColorWarning(value, format) {
|
|
14998
15108
|
console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
|
|
14999
15109
|
}
|
|
15000
|
-
setMode(format) {
|
|
15001
|
-
|
|
15110
|
+
setMode(format, warn = true) {
|
|
15111
|
+
const mode = format === "auto" ? this.mode : format;
|
|
15112
|
+
this.mode = this.ensureCompatibleMode(mode, warn);
|
|
15113
|
+
}
|
|
15114
|
+
ensureCompatibleMode(mode, warn) {
|
|
15115
|
+
const { alphaChannel } = this;
|
|
15116
|
+
const isAlphaCompatible = alphaCompatible(mode);
|
|
15117
|
+
if (alphaChannel && !isAlphaCompatible) {
|
|
15118
|
+
const alphaMode = toAlphaMode(mode);
|
|
15119
|
+
if (warn) {
|
|
15120
|
+
console.warn(`setting format to (${alphaMode}) as the provided one (${mode}) does not support alpha`);
|
|
15121
|
+
}
|
|
15122
|
+
return alphaMode;
|
|
15123
|
+
}
|
|
15124
|
+
if (!alphaChannel && isAlphaCompatible) {
|
|
15125
|
+
const nonAlphaMode = toNonAlphaMode(mode);
|
|
15126
|
+
if (warn) {
|
|
15127
|
+
console.warn(`setting format to (${nonAlphaMode}) as the provided one (${mode}) does not support alpha`);
|
|
15128
|
+
}
|
|
15129
|
+
return nonAlphaMode;
|
|
15130
|
+
}
|
|
15131
|
+
return mode;
|
|
15002
15132
|
}
|
|
15003
15133
|
captureHueSliderColor(x) {
|
|
15004
15134
|
const { dimensions: { slider: { width } } } = this;
|
|
15005
15135
|
const hue = (360 / width) * x;
|
|
15006
15136
|
this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
|
|
15007
15137
|
}
|
|
15008
|
-
|
|
15009
|
-
const { dimensions: {
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
}
|
|
15013
|
-
if (y <= colorFieldHeight + sliderHeight) {
|
|
15014
|
-
return "slider";
|
|
15015
|
-
}
|
|
15016
|
-
return "none";
|
|
15138
|
+
captureOpacitySliderValue(x) {
|
|
15139
|
+
const { dimensions: { slider: { width } } } = this;
|
|
15140
|
+
const alpha = opacityToAlpha((OPACITY_LIMITS.max / width) * x);
|
|
15141
|
+
this.internalColorSet(this.baseColorFieldColor.alpha(alpha), false);
|
|
15017
15142
|
}
|
|
15018
15143
|
internalColorSet(color, skipEqual = true, context = "user-interaction") {
|
|
15019
15144
|
if (skipEqual && colorEqual(color, this.color)) {
|
|
@@ -15030,16 +15155,25 @@ class ColorPicker {
|
|
|
15030
15155
|
}
|
|
15031
15156
|
const hexMode = "hex";
|
|
15032
15157
|
if (format.includes(hexMode)) {
|
|
15033
|
-
|
|
15158
|
+
const hasAlpha = format === CSSColorMode.HEXA;
|
|
15159
|
+
return normalizeHex(hexify(color.round(), hasAlpha), hasAlpha);
|
|
15034
15160
|
}
|
|
15035
15161
|
if (format.includes("-css")) {
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15162
|
+
const value = color[format.replace("-css", "").replace("a", "")]().round().string();
|
|
15163
|
+
// Color omits alpha values when alpha is 1
|
|
15164
|
+
const needToInjectAlpha = (format.endsWith("a") || format.endsWith("a-css")) && color.alpha() === 1;
|
|
15165
|
+
if (needToInjectAlpha) {
|
|
15166
|
+
const model = value.slice(0, 3);
|
|
15167
|
+
const values = value.slice(4, -1);
|
|
15168
|
+
return `${model}a(${values}, ${color.alpha()})`;
|
|
15169
|
+
}
|
|
15170
|
+
return value;
|
|
15171
|
+
}
|
|
15172
|
+
const colorObject =
|
|
15173
|
+
/* Color() does not support hsva, hsla nor rgba, so we use the non-alpha mode */
|
|
15174
|
+
color[toNonAlphaMode(format)]().round().object();
|
|
15039
15175
|
if (format.endsWith("a")) {
|
|
15040
|
-
|
|
15041
|
-
colorObject.a = colorObject.alpha;
|
|
15042
|
-
delete colorObject.alpha;
|
|
15176
|
+
return normalizeAlpha(colorObject);
|
|
15043
15177
|
}
|
|
15044
15178
|
return colorObject;
|
|
15045
15179
|
}
|
|
@@ -15051,9 +15185,14 @@ class ColorPicker {
|
|
|
15051
15185
|
this.dimensions = DIMENSIONS[scale];
|
|
15052
15186
|
}
|
|
15053
15187
|
drawColorField() {
|
|
15054
|
-
const context = this.
|
|
15188
|
+
const context = this.colorFieldRenderingContext;
|
|
15055
15189
|
const { dimensions: { colorField: { height, width } } } = this;
|
|
15056
|
-
context.fillStyle = this.baseColorFieldColor
|
|
15190
|
+
context.fillStyle = this.baseColorFieldColor
|
|
15191
|
+
.hsv()
|
|
15192
|
+
.saturationv(100)
|
|
15193
|
+
.value(100)
|
|
15194
|
+
.alpha(1)
|
|
15195
|
+
.string();
|
|
15057
15196
|
context.fillRect(0, 0, width, height);
|
|
15058
15197
|
const whiteGradient = context.createLinearGradient(0, 0, width, 0);
|
|
15059
15198
|
whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
|
|
@@ -15068,6 +15207,9 @@ class ColorPicker {
|
|
|
15068
15207
|
this.drawActiveColorFieldColor();
|
|
15069
15208
|
}
|
|
15070
15209
|
setCanvasContextSize(canvas, { height, width }) {
|
|
15210
|
+
if (!canvas) {
|
|
15211
|
+
return;
|
|
15212
|
+
}
|
|
15071
15213
|
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
15072
15214
|
canvas.width = width * devicePixelRatio;
|
|
15073
15215
|
canvas.height = height * devicePixelRatio;
|
|
@@ -15076,21 +15218,21 @@ class ColorPicker {
|
|
|
15076
15218
|
const context = canvas.getContext("2d");
|
|
15077
15219
|
context.scale(devicePixelRatio, devicePixelRatio);
|
|
15078
15220
|
}
|
|
15079
|
-
updateCanvasSize(
|
|
15080
|
-
|
|
15081
|
-
|
|
15221
|
+
updateCanvasSize(context = "all") {
|
|
15222
|
+
const { dimensions } = this;
|
|
15223
|
+
if (context === "all" || context === "color-field") {
|
|
15224
|
+
this.setCanvasContextSize(this.colorFieldRenderingContext?.canvas, dimensions.colorField);
|
|
15225
|
+
}
|
|
15226
|
+
const adjustedSliderDimensions = {
|
|
15227
|
+
width: dimensions.slider.width,
|
|
15228
|
+
height: dimensions.slider.height + (dimensions.thumb.radius - dimensions.slider.height / 2) * 2
|
|
15229
|
+
};
|
|
15230
|
+
if (context === "all" || context === "hue-slider") {
|
|
15231
|
+
this.setCanvasContextSize(this.hueSliderRenderingContext?.canvas, adjustedSliderDimensions);
|
|
15232
|
+
}
|
|
15233
|
+
if (context === "all" || context === "opacity-slider") {
|
|
15234
|
+
this.setCanvasContextSize(this.opacitySliderRenderingContext?.canvas, adjustedSliderDimensions);
|
|
15082
15235
|
}
|
|
15083
|
-
this.setCanvasContextSize(canvas, {
|
|
15084
|
-
width: this.dimensions.colorField.width,
|
|
15085
|
-
height: this.dimensions.colorField.height +
|
|
15086
|
-
this.dimensions.slider.height +
|
|
15087
|
-
this.getSliderCapSpacing() * 2
|
|
15088
|
-
});
|
|
15089
|
-
this.drawColorFieldAndSlider();
|
|
15090
|
-
}
|
|
15091
|
-
containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
|
|
15092
|
-
return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
|
|
15093
|
-
Math.pow(boundsRadius, 2));
|
|
15094
15236
|
}
|
|
15095
15237
|
drawActiveColorFieldColor() {
|
|
15096
15238
|
const { color } = this;
|
|
@@ -15105,22 +15247,23 @@ class ColorPicker {
|
|
|
15105
15247
|
this.colorFieldScopeLeft = x;
|
|
15106
15248
|
this.colorFieldScopeTop = y;
|
|
15107
15249
|
});
|
|
15108
|
-
this.drawThumb(this.
|
|
15250
|
+
this.drawThumb(this.colorFieldRenderingContext, radius, x, y, hsvColor);
|
|
15109
15251
|
}
|
|
15110
|
-
drawThumb(context, radius, x, y, color
|
|
15252
|
+
drawThumb(context, radius, x, y, color) {
|
|
15111
15253
|
const startAngle = 0;
|
|
15112
15254
|
const endAngle = 2 * Math.PI;
|
|
15255
|
+
const outlineWidth = 1;
|
|
15256
|
+
radius = radius - outlineWidth;
|
|
15113
15257
|
context.beginPath();
|
|
15114
15258
|
context.arc(x, y, radius, startAngle, endAngle);
|
|
15115
|
-
context.shadowBlur = state === "hover" ? 32 : 16;
|
|
15116
|
-
context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
|
|
15117
15259
|
context.fillStyle = "#fff";
|
|
15118
15260
|
context.fill();
|
|
15261
|
+
context.strokeStyle = "rgba(0,0,0,0.3)";
|
|
15262
|
+
context.lineWidth = outlineWidth;
|
|
15263
|
+
context.stroke();
|
|
15119
15264
|
context.beginPath();
|
|
15120
15265
|
context.arc(x, y, radius - 3, startAngle, endAngle);
|
|
15121
|
-
context.
|
|
15122
|
-
context.shadowColor = "transparent";
|
|
15123
|
-
context.fillStyle = color.rgb().string();
|
|
15266
|
+
context.fillStyle = color.rgb().alpha(1).string();
|
|
15124
15267
|
context.fill();
|
|
15125
15268
|
}
|
|
15126
15269
|
drawActiveHueSliderColor() {
|
|
@@ -15129,18 +15272,19 @@ class ColorPicker {
|
|
|
15129
15272
|
return;
|
|
15130
15273
|
}
|
|
15131
15274
|
const hsvColor = color.hsv().saturationv(100).value(100);
|
|
15132
|
-
const { dimensions: {
|
|
15275
|
+
const { dimensions: { slider: { height, width }, thumb: { radius } } } = this;
|
|
15133
15276
|
const x = hsvColor.hue() / (360 / width);
|
|
15134
|
-
const y = height / 2 +
|
|
15277
|
+
const y = radius - height / 2 + height / 2;
|
|
15135
15278
|
requestAnimationFrame(() => {
|
|
15136
15279
|
this.hueScopeLeft = x;
|
|
15137
|
-
this.hueScopeTop = y;
|
|
15138
15280
|
});
|
|
15139
|
-
this.drawThumb(this.
|
|
15281
|
+
this.drawThumb(this.hueSliderRenderingContext, radius, x, y, hsvColor);
|
|
15140
15282
|
}
|
|
15141
15283
|
drawHueSlider() {
|
|
15142
|
-
const context = this.
|
|
15143
|
-
const { dimensions: {
|
|
15284
|
+
const context = this.hueSliderRenderingContext;
|
|
15285
|
+
const { dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
|
|
15286
|
+
const x = 0;
|
|
15287
|
+
const y = thumbRadius - height / 2;
|
|
15144
15288
|
const gradient = context.createLinearGradient(0, 0, width, 0);
|
|
15145
15289
|
const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
|
|
15146
15290
|
const offset = 1 / (hueSliderColorStopKeywords.length - 1);
|
|
@@ -15149,27 +15293,107 @@ class ColorPicker {
|
|
|
15149
15293
|
gradient.addColorStop(currentOffset, color(keyword).string());
|
|
15150
15294
|
currentOffset += offset;
|
|
15151
15295
|
});
|
|
15296
|
+
context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
|
|
15297
|
+
this.drawSliderPath(context, height, width, x, y);
|
|
15152
15298
|
context.fillStyle = gradient;
|
|
15153
|
-
context.
|
|
15154
|
-
context.
|
|
15299
|
+
context.fill();
|
|
15300
|
+
context.strokeStyle = "rgba(0,0,0,0.3)";
|
|
15301
|
+
context.lineWidth = 1;
|
|
15302
|
+
context.stroke();
|
|
15155
15303
|
this.drawActiveHueSliderColor();
|
|
15156
15304
|
}
|
|
15305
|
+
drawOpacitySlider() {
|
|
15306
|
+
const context = this.opacitySliderRenderingContext;
|
|
15307
|
+
const { baseColorFieldColor: previousColor, dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
|
|
15308
|
+
const x = 0;
|
|
15309
|
+
const y = thumbRadius - height / 2;
|
|
15310
|
+
context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
|
|
15311
|
+
const gradient = context.createLinearGradient(0, y, width, 0);
|
|
15312
|
+
const startColor = previousColor.rgb().alpha(0);
|
|
15313
|
+
const midColor = previousColor.rgb().alpha(0.5);
|
|
15314
|
+
const endColor = previousColor.rgb().alpha(1);
|
|
15315
|
+
gradient.addColorStop(0, startColor.string());
|
|
15316
|
+
gradient.addColorStop(0.5, midColor.string());
|
|
15317
|
+
gradient.addColorStop(1, endColor.string());
|
|
15318
|
+
this.drawSliderPath(context, height, width, x, y);
|
|
15319
|
+
const pattern = context.createPattern(this.getCheckeredBackgroundPattern(), "repeat");
|
|
15320
|
+
context.fillStyle = pattern;
|
|
15321
|
+
context.fill();
|
|
15322
|
+
context.fillStyle = gradient;
|
|
15323
|
+
context.fill();
|
|
15324
|
+
context.strokeStyle = "rgba(0,0,0,0.3)";
|
|
15325
|
+
context.lineWidth = 1;
|
|
15326
|
+
context.stroke();
|
|
15327
|
+
this.drawActiveOpacitySliderColor();
|
|
15328
|
+
}
|
|
15329
|
+
drawSliderPath(context, height, width, x, y) {
|
|
15330
|
+
const radius = height / 2 + 1;
|
|
15331
|
+
context.beginPath();
|
|
15332
|
+
context.moveTo(x + radius, y);
|
|
15333
|
+
context.lineTo(x + width - radius, y);
|
|
15334
|
+
context.quadraticCurveTo(x + width, y, x + width, y + radius);
|
|
15335
|
+
context.lineTo(x + width, y + height - radius);
|
|
15336
|
+
context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
|
|
15337
|
+
context.lineTo(x + radius, y + height);
|
|
15338
|
+
context.quadraticCurveTo(x, y + height, x, y + height - radius);
|
|
15339
|
+
context.lineTo(x, y + radius);
|
|
15340
|
+
context.quadraticCurveTo(x, y, x + radius, y);
|
|
15341
|
+
context.closePath();
|
|
15342
|
+
}
|
|
15343
|
+
getCheckeredBackgroundPattern() {
|
|
15344
|
+
if (this.checkerPattern) {
|
|
15345
|
+
return this.checkerPattern;
|
|
15346
|
+
}
|
|
15347
|
+
const pattern = document.createElement("canvas");
|
|
15348
|
+
pattern.width = 10;
|
|
15349
|
+
pattern.height = 10;
|
|
15350
|
+
const patternContext = pattern.getContext("2d");
|
|
15351
|
+
patternContext.fillStyle = "#ccc";
|
|
15352
|
+
patternContext.fillRect(0, 0, 10, 10);
|
|
15353
|
+
patternContext.fillStyle = "#fff";
|
|
15354
|
+
patternContext.fillRect(0, 0, 5, 5);
|
|
15355
|
+
patternContext.fillRect(5, 5, 5, 5);
|
|
15356
|
+
this.checkerPattern = pattern;
|
|
15357
|
+
return pattern;
|
|
15358
|
+
}
|
|
15359
|
+
drawActiveOpacitySliderColor() {
|
|
15360
|
+
const { color } = this;
|
|
15361
|
+
if (!color) {
|
|
15362
|
+
return;
|
|
15363
|
+
}
|
|
15364
|
+
const hsvColor = color;
|
|
15365
|
+
const { dimensions: { slider: { width }, thumb: { radius } } } = this;
|
|
15366
|
+
const x = alphaToOpacity(hsvColor.alpha()) / (OPACITY_LIMITS.max / width);
|
|
15367
|
+
const y = radius;
|
|
15368
|
+
requestAnimationFrame(() => {
|
|
15369
|
+
this.opacityScopeLeft = x;
|
|
15370
|
+
});
|
|
15371
|
+
this.drawThumb(this.opacitySliderRenderingContext, radius, x, y, hsvColor);
|
|
15372
|
+
}
|
|
15157
15373
|
updateColorFromChannels(channels) {
|
|
15158
15374
|
this.internalColorSet(color(channels, this.channelMode));
|
|
15159
15375
|
}
|
|
15160
15376
|
updateChannelsFromColor(color) {
|
|
15161
|
-
this.channels = color ? this.toChannels(color) : [null, null, null];
|
|
15377
|
+
this.channels = color ? this.toChannels(color) : [null, null, null, null];
|
|
15162
15378
|
}
|
|
15163
15379
|
toChannels(color) {
|
|
15164
15380
|
const { channelMode } = this;
|
|
15165
|
-
|
|
15381
|
+
const channels = color[channelMode]()
|
|
15166
15382
|
.array()
|
|
15167
|
-
.map((value) =>
|
|
15383
|
+
.map((value, index) => {
|
|
15384
|
+
const isAlpha = index === 3;
|
|
15385
|
+
return isAlpha ? value : Math.floor(value);
|
|
15386
|
+
});
|
|
15387
|
+
if (channels.length === 3) {
|
|
15388
|
+
channels.push(1); // Color omits alpha when 1
|
|
15389
|
+
}
|
|
15390
|
+
return channels;
|
|
15168
15391
|
}
|
|
15169
15392
|
static get delegatesFocus() { return true; }
|
|
15170
15393
|
static get assetsDirs() { return ["assets"]; }
|
|
15171
15394
|
get el() { return getElement(this); }
|
|
15172
15395
|
static get watchers() { return {
|
|
15396
|
+
"alphaChannel": ["handleAlphaChannelChange"],
|
|
15173
15397
|
"color": ["handleColorChange"],
|
|
15174
15398
|
"format": ["handleFormatChange"],
|
|
15175
15399
|
"scale": ["handleScaleChange"],
|
|
@@ -15183,12 +15407,16 @@ class ColorPicker {
|
|
|
15183
15407
|
"$tagName$": "calcite-color-picker",
|
|
15184
15408
|
"$members$": {
|
|
15185
15409
|
"allowEmpty": [516, "allow-empty"],
|
|
15410
|
+
"alphaChannel": [4, "alpha-channel"],
|
|
15411
|
+
"channelsDisabled": [4, "channels-disabled"],
|
|
15186
15412
|
"color": [1040],
|
|
15187
15413
|
"disabled": [516],
|
|
15188
15414
|
"format": [513],
|
|
15189
|
-
"hideHex": [516, "hide-hex"],
|
|
15190
15415
|
"hideChannels": [516, "hide-channels"],
|
|
15416
|
+
"hexDisabled": [4, "hex-disabled"],
|
|
15417
|
+
"hideHex": [516, "hide-hex"],
|
|
15191
15418
|
"hideSaved": [516, "hide-saved"],
|
|
15419
|
+
"savedDisabled": [516, "saved-disabled"],
|
|
15192
15420
|
"scale": [513],
|
|
15193
15421
|
"storageId": [513, "storage-id"],
|
|
15194
15422
|
"messageOverrides": [1040],
|
|
@@ -15196,7 +15424,6 @@ class ColorPicker {
|
|
|
15196
15424
|
"value": [1025],
|
|
15197
15425
|
"messages": [1040],
|
|
15198
15426
|
"defaultMessages": [32],
|
|
15199
|
-
"colorFieldAndSliderInteractive": [32],
|
|
15200
15427
|
"channelMode": [32],
|
|
15201
15428
|
"channels": [32],
|
|
15202
15429
|
"dimensions": [32],
|
|
@@ -15204,56 +15431,144 @@ class ColorPicker {
|
|
|
15204
15431
|
"savedColors": [32],
|
|
15205
15432
|
"colorFieldScopeTop": [32],
|
|
15206
15433
|
"colorFieldScopeLeft": [32],
|
|
15207
|
-
"scopeOrientation": [32],
|
|
15208
15434
|
"hueScopeLeft": [32],
|
|
15209
|
-
"
|
|
15435
|
+
"opacityScopeLeft": [32],
|
|
15436
|
+
"scopeOrientation": [32],
|
|
15210
15437
|
"setFocus": [64]
|
|
15211
15438
|
},
|
|
15212
15439
|
"$listeners$": [[2, "keydown", "handleChannelKeyUpOrDown"], [2, "keyup", "handleChannelKeyUpOrDown"]],
|
|
15213
15440
|
"$lazyBundleId$": "-",
|
|
15214
|
-
"$attrsToReflect$": [["allowEmpty", "allow-empty"], ["disabled", "disabled"], ["format", "format"], ["
|
|
15441
|
+
"$attrsToReflect$": [["allowEmpty", "allow-empty"], ["disabled", "disabled"], ["format", "format"], ["hideChannels", "hide-channels"], ["hideHex", "hide-hex"], ["hideSaved", "hide-saved"], ["savedDisabled", "saved-disabled"], ["scale", "scale"], ["storageId", "storage-id"], ["numberingSystem", "numbering-system"]]
|
|
15215
15442
|
}; }
|
|
15216
15443
|
}
|
|
15217
15444
|
|
|
15218
15445
|
const CSS$O = {
|
|
15219
15446
|
container: "container",
|
|
15220
|
-
|
|
15221
|
-
|
|
15447
|
+
hexInput: "hex-input",
|
|
15448
|
+
opacityInput: "opacity-input"
|
|
15222
15449
|
};
|
|
15223
15450
|
|
|
15224
|
-
const colorPickerHexInputCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker-hex-input{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker-hex-input{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker-hex-input{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker-hex-input{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker-hex-input{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-hex-input-h{display:none}/*!@:host*/.sc-calcite-color-picker-hex-input-h{display:block}/*!@.container*/.container.sc-calcite-color-picker-hex-input{display:
|
|
15451
|
+
const colorPickerHexInputCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker-hex-input{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker-hex-input{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker-hex-input{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker-hex-input{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker-hex-input{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker-hex-input:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-hex-input-h{display:none}/*!@:host*/.sc-calcite-color-picker-hex-input-h{display:block}/*!@.container*/.container.sc-calcite-color-picker-hex-input{display:flex;inline-size:100%;flex-wrap:nowrap;align-items:center}/*!@.hex-input*/.hex-input.sc-calcite-color-picker-hex-input{flex-grow:1;text-transform:uppercase}/*!@.opacity-input*/.opacity-input.sc-calcite-color-picker-hex-input{inline-size:68px;margin-inline-start:-1px}/*!@:host([scale=s]) .container*/[scale=s].sc-calcite-color-picker-hex-input-h .container.sc-calcite-color-picker-hex-input{flex-wrap:wrap;row-gap:0.125rem}/*!@:host([scale=s]) .opacity-input*/[scale=s].sc-calcite-color-picker-hex-input-h .opacity-input.sc-calcite-color-picker-hex-input{inline-size:unset;margin-inline-start:unset}/*!@:host([scale=l]) .opacity-input*/[scale=l].sc-calcite-color-picker-hex-input-h .opacity-input.sc-calcite-color-picker-hex-input{inline-size:88px}";
|
|
15225
15452
|
|
|
15226
15453
|
const DEFAULT_COLOR = color();
|
|
15227
15454
|
class ColorPickerHexInput {
|
|
15228
15455
|
constructor(hostRef) {
|
|
15229
15456
|
registerInstance(this, hostRef);
|
|
15230
15457
|
this.calciteColorPickerHexInputChange = createEvent(this, "calciteColorPickerHexInputChange", 6);
|
|
15231
|
-
this.
|
|
15232
|
-
const node = this.
|
|
15458
|
+
this.onHexInputBlur = () => {
|
|
15459
|
+
const node = this.hexInputNode;
|
|
15233
15460
|
const inputValue = node.value;
|
|
15234
15461
|
const hex = `#${inputValue}`;
|
|
15235
|
-
const
|
|
15236
|
-
|
|
15462
|
+
const { allowEmpty, internalColor } = this;
|
|
15463
|
+
const willClearValue = allowEmpty && !inputValue;
|
|
15464
|
+
const isLonghand = isLonghandHex(hex);
|
|
15465
|
+
if (willClearValue || (isValidHex(hex) && isLonghand)) {
|
|
15237
15466
|
return;
|
|
15238
15467
|
}
|
|
15239
15468
|
// manipulating DOM directly since rerender doesn't update input value
|
|
15240
15469
|
node.value =
|
|
15241
|
-
|
|
15470
|
+
allowEmpty && !internalColor
|
|
15242
15471
|
? ""
|
|
15243
|
-
: this.
|
|
15472
|
+
: this.formatHexForInternalInput(rgbToHex(
|
|
15473
|
+
// always display hex input in RRGGBB format
|
|
15474
|
+
internalColor.object()));
|
|
15244
15475
|
};
|
|
15245
|
-
this.
|
|
15246
|
-
|
|
15476
|
+
this.onOpacityInputBlur = () => {
|
|
15477
|
+
const node = this.opacityInputNode;
|
|
15478
|
+
const inputValue = node.value;
|
|
15479
|
+
const { allowEmpty, internalColor } = this;
|
|
15480
|
+
const willClearValue = allowEmpty && !inputValue;
|
|
15481
|
+
if (willClearValue) {
|
|
15482
|
+
return;
|
|
15483
|
+
}
|
|
15484
|
+
// manipulating DOM directly since rerender doesn't update input value
|
|
15485
|
+
node.value =
|
|
15486
|
+
allowEmpty && !internalColor ? "" : this.formatOpacityForInternalInput(internalColor);
|
|
15487
|
+
};
|
|
15488
|
+
this.onHexInputChange = () => {
|
|
15489
|
+
const nodeValue = this.hexInputNode.value;
|
|
15490
|
+
let value = nodeValue;
|
|
15491
|
+
if (value) {
|
|
15492
|
+
const normalized = normalizeHex(value, false);
|
|
15493
|
+
const preserveExistingAlpha = isValidHex(normalized) && this.alphaChannel;
|
|
15494
|
+
if (preserveExistingAlpha && this.internalColor) {
|
|
15495
|
+
const alphaHex = normalizeHex(this.internalColor.hexa(), true).slice(-2);
|
|
15496
|
+
value = `${normalized + alphaHex}`;
|
|
15497
|
+
}
|
|
15498
|
+
}
|
|
15499
|
+
this.internalSetValue(value, this.value);
|
|
15500
|
+
};
|
|
15501
|
+
this.onOpacityInputChange = () => {
|
|
15502
|
+
const node = this.opacityInputNode;
|
|
15503
|
+
let value;
|
|
15504
|
+
if (!node.value) {
|
|
15505
|
+
value = node.value;
|
|
15506
|
+
}
|
|
15507
|
+
else {
|
|
15508
|
+
const alpha = opacityToAlpha(Number(node.value));
|
|
15509
|
+
value = this.internalColor?.alpha(alpha).hexa();
|
|
15510
|
+
}
|
|
15511
|
+
this.internalSetValue(value, this.value);
|
|
15512
|
+
};
|
|
15513
|
+
this.onInputKeyDown = (event) => {
|
|
15514
|
+
const { altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
15515
|
+
const { alphaChannel, hexInputNode, internalColor, value } = this;
|
|
15516
|
+
const { key } = event;
|
|
15517
|
+
const composedPath = event.composedPath();
|
|
15518
|
+
if (key === "Tab" || key === "Enter") {
|
|
15519
|
+
if (composedPath.includes(hexInputNode)) {
|
|
15520
|
+
this.onHexInputChange();
|
|
15521
|
+
}
|
|
15522
|
+
else {
|
|
15523
|
+
this.onOpacityInputChange();
|
|
15524
|
+
}
|
|
15525
|
+
if (key === "Enter") {
|
|
15526
|
+
event.preventDefault();
|
|
15527
|
+
}
|
|
15528
|
+
return;
|
|
15529
|
+
}
|
|
15530
|
+
const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
|
|
15531
|
+
const oldValue = this.value;
|
|
15532
|
+
if (isNudgeKey) {
|
|
15533
|
+
if (!value) {
|
|
15534
|
+
this.internalSetValue(this.previousNonNullValue, oldValue);
|
|
15535
|
+
event.preventDefault();
|
|
15536
|
+
return;
|
|
15537
|
+
}
|
|
15538
|
+
const direction = key === "ArrowUp" ? 1 : -1;
|
|
15539
|
+
const bump = shiftKey ? 10 : 1;
|
|
15540
|
+
this.internalSetValue(hexify(this.nudgeRGBChannels(internalColor, bump * direction, composedPath.includes(hexInputNode) ? "rgb" : "a"), alphaChannel), oldValue);
|
|
15541
|
+
event.preventDefault();
|
|
15542
|
+
return;
|
|
15543
|
+
}
|
|
15544
|
+
const withModifiers = altKey || ctrlKey || metaKey;
|
|
15545
|
+
const singleChar = key.length === 1;
|
|
15546
|
+
const validHexChar = hexChar.test(key);
|
|
15547
|
+
if (singleChar && !withModifiers && !validHexChar) {
|
|
15548
|
+
event.preventDefault();
|
|
15549
|
+
}
|
|
15550
|
+
};
|
|
15551
|
+
this.onHexInputPaste = (event) => {
|
|
15552
|
+
const hex = event.clipboardData.getData("text");
|
|
15553
|
+
if (isValidHex(hex)) {
|
|
15554
|
+
event.preventDefault();
|
|
15555
|
+
this.hexInputNode.value = hex.slice(1);
|
|
15556
|
+
}
|
|
15247
15557
|
};
|
|
15248
15558
|
this.previousNonNullValue = this.value;
|
|
15249
|
-
this.
|
|
15250
|
-
this.
|
|
15559
|
+
this.storeHexInputRef = (node) => {
|
|
15560
|
+
this.hexInputNode = node;
|
|
15561
|
+
};
|
|
15562
|
+
this.storeOpacityInputRef = (node) => {
|
|
15563
|
+
this.opacityInputNode = node;
|
|
15251
15564
|
};
|
|
15252
|
-
this.hexLabel = "Hex";
|
|
15253
15565
|
this.allowEmpty = false;
|
|
15254
|
-
this.
|
|
15255
|
-
this.
|
|
15566
|
+
this.alphaChannel = false;
|
|
15567
|
+
this.hexLabel = "Hex";
|
|
15568
|
+
this.messages = undefined;
|
|
15256
15569
|
this.numberingSystem = undefined;
|
|
15570
|
+
this.scale = "m";
|
|
15571
|
+
this.value = normalizeHex(hexify(DEFAULT_COLOR, this.alphaChannel), this.alphaChannel, true);
|
|
15257
15572
|
this.internalColor = DEFAULT_COLOR;
|
|
15258
15573
|
}
|
|
15259
15574
|
//--------------------------------------------------------------------------
|
|
@@ -15262,10 +15577,10 @@ class ColorPickerHexInput {
|
|
|
15262
15577
|
//
|
|
15263
15578
|
//--------------------------------------------------------------------------
|
|
15264
15579
|
connectedCallback() {
|
|
15265
|
-
const { allowEmpty, value } = this;
|
|
15580
|
+
const { allowEmpty, alphaChannel, value } = this;
|
|
15266
15581
|
if (value) {
|
|
15267
|
-
const normalized = normalizeHex(value);
|
|
15268
|
-
if (isValidHex(normalized)) {
|
|
15582
|
+
const normalized = normalizeHex(value, alphaChannel);
|
|
15583
|
+
if (isValidHex(normalized, alphaChannel)) {
|
|
15269
15584
|
this.internalSetValue(normalized, normalized, false);
|
|
15270
15585
|
}
|
|
15271
15586
|
return;
|
|
@@ -15283,54 +15598,21 @@ class ColorPickerHexInput {
|
|
|
15283
15598
|
handleValueChange(value, oldValue) {
|
|
15284
15599
|
this.internalSetValue(value, oldValue, false);
|
|
15285
15600
|
}
|
|
15286
|
-
// using @Listen as a workaround for VDOM listener not firing
|
|
15287
|
-
onInputKeyDown(event) {
|
|
15288
|
-
const { altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
15289
|
-
const { internalColor, value } = this;
|
|
15290
|
-
const { key } = event;
|
|
15291
|
-
if (key === "Tab" || key === "Enter") {
|
|
15292
|
-
this.onInputChange();
|
|
15293
|
-
return;
|
|
15294
|
-
}
|
|
15295
|
-
const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
|
|
15296
|
-
const oldValue = this.value;
|
|
15297
|
-
if (isNudgeKey) {
|
|
15298
|
-
if (!value) {
|
|
15299
|
-
this.internalSetValue(this.previousNonNullValue, oldValue);
|
|
15300
|
-
event.preventDefault();
|
|
15301
|
-
return;
|
|
15302
|
-
}
|
|
15303
|
-
const direction = key === "ArrowUp" ? 1 : -1;
|
|
15304
|
-
const bump = shiftKey ? 10 : 1;
|
|
15305
|
-
this.internalSetValue(normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
|
|
15306
|
-
event.preventDefault();
|
|
15307
|
-
return;
|
|
15308
|
-
}
|
|
15309
|
-
const withModifiers = altKey || ctrlKey || metaKey;
|
|
15310
|
-
const singleChar = key.length === 1;
|
|
15311
|
-
const validHexChar = hexChar.test(key);
|
|
15312
|
-
if (singleChar && !withModifiers && !validHexChar) {
|
|
15313
|
-
event.preventDefault();
|
|
15314
|
-
}
|
|
15315
|
-
}
|
|
15316
|
-
onPaste(event) {
|
|
15317
|
-
const hex = event.clipboardData.getData("text");
|
|
15318
|
-
if (isValidHex(hex)) {
|
|
15319
|
-
event.preventDefault();
|
|
15320
|
-
this.inputNode.value = hex.slice(1);
|
|
15321
|
-
}
|
|
15322
|
-
}
|
|
15323
15601
|
//--------------------------------------------------------------------------
|
|
15324
15602
|
//
|
|
15325
15603
|
// Lifecycle
|
|
15326
15604
|
//
|
|
15327
15605
|
//--------------------------------------------------------------------------
|
|
15328
15606
|
render() {
|
|
15329
|
-
const { value } = this;
|
|
15330
|
-
const hexInputValue = this.
|
|
15331
|
-
|
|
15607
|
+
const { alphaChannel, hexLabel, internalColor, messages, scale, value } = this;
|
|
15608
|
+
const hexInputValue = this.formatHexForInternalInput(value);
|
|
15609
|
+
const opacityInputValue = this.formatOpacityForInternalInput(internalColor);
|
|
15610
|
+
const inputScale = scale === "l" ? "m" : "s";
|
|
15611
|
+
return (hAsync("div", { class: CSS$O.container }, hAsync("calcite-input", { class: CSS$O.hexInput, label: messages?.hex || hexLabel, maxLength: 6, numberingSystem: this.numberingSystem, onCalciteInputChange: this.onHexInputChange, onCalciteInternalInputBlur: this.onHexInputBlur, onKeyDown: this.onInputKeyDown, onPaste: this.onHexInputPaste, prefixText: "#", scale: inputScale, value: hexInputValue,
|
|
15612
|
+
// eslint-disable-next-line react/jsx-sort-props
|
|
15613
|
+
ref: this.storeHexInputRef }), alphaChannel ? (hAsync("calcite-input-number", { class: CSS$O.opacityInput, key: "opacity-input", label: messages?.opacity, max: OPACITY_LIMITS.max, maxLength: 3, min: OPACITY_LIMITS.min, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputNumberChange: this.onOpacityInputChange, onCalciteInternalInputNumberBlur: this.onOpacityInputBlur, onKeyDown: this.onInputKeyDown, scale: inputScale, suffixText: "%", value: opacityInputValue,
|
|
15332
15614
|
// eslint-disable-next-line react/jsx-sort-props
|
|
15333
|
-
ref: this.
|
|
15615
|
+
ref: this.storeOpacityInputRef })) : null));
|
|
15334
15616
|
}
|
|
15335
15617
|
//--------------------------------------------------------------------------
|
|
15336
15618
|
//
|
|
@@ -15340,7 +15622,7 @@ class ColorPickerHexInput {
|
|
|
15340
15622
|
/** Sets focus on the component. */
|
|
15341
15623
|
async setFocus() {
|
|
15342
15624
|
await componentLoaded(this);
|
|
15343
|
-
focusElement(this.
|
|
15625
|
+
focusElement(this.hexInputNode);
|
|
15344
15626
|
}
|
|
15345
15627
|
//--------------------------------------------------------------------------
|
|
15346
15628
|
//
|
|
@@ -15349,13 +15631,17 @@ class ColorPickerHexInput {
|
|
|
15349
15631
|
//--------------------------------------------------------------------------
|
|
15350
15632
|
internalSetValue(value, oldValue, emit = true) {
|
|
15351
15633
|
if (value) {
|
|
15352
|
-
const
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
const
|
|
15356
|
-
|
|
15357
|
-
|
|
15358
|
-
|
|
15634
|
+
const { alphaChannel } = this;
|
|
15635
|
+
const normalized = normalizeHex(value, alphaChannel, alphaChannel);
|
|
15636
|
+
if (isValidHex(normalized, alphaChannel)) {
|
|
15637
|
+
const { internalColor: currentColor } = this;
|
|
15638
|
+
const nextColor = color(normalized);
|
|
15639
|
+
const normalizedLonghand = normalizeHex(hexify(nextColor, alphaChannel), alphaChannel);
|
|
15640
|
+
const changed = !currentColor ||
|
|
15641
|
+
normalizedLonghand !== normalizeHex(hexify(currentColor, alphaChannel), alphaChannel);
|
|
15642
|
+
this.internalColor = nextColor;
|
|
15643
|
+
this.previousNonNullValue = normalizedLonghand;
|
|
15644
|
+
this.value = normalizedLonghand;
|
|
15359
15645
|
if (changed && emit) {
|
|
15360
15646
|
this.calciteColorPickerHexInputChange.emit();
|
|
15361
15647
|
}
|
|
@@ -15372,16 +15658,28 @@ class ColorPickerHexInput {
|
|
|
15372
15658
|
}
|
|
15373
15659
|
this.value = oldValue;
|
|
15374
15660
|
}
|
|
15375
|
-
|
|
15376
|
-
return hex ? hex.replace("#", "") : "";
|
|
15377
|
-
}
|
|
15378
|
-
|
|
15379
|
-
return color
|
|
15380
|
-
}
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
|
|
15661
|
+
formatHexForInternalInput(hex) {
|
|
15662
|
+
return hex ? hex.replace("#", "").slice(0, 6) : "";
|
|
15663
|
+
}
|
|
15664
|
+
formatOpacityForInternalInput(color) {
|
|
15665
|
+
return color ? `${alphaToOpacity(color.alpha())}` : "";
|
|
15666
|
+
}
|
|
15667
|
+
nudgeRGBChannels(color$1, amount, context) {
|
|
15668
|
+
let nudgedChannels;
|
|
15669
|
+
const channels = color$1.array();
|
|
15670
|
+
const rgbChannels = channels.slice(0, 3);
|
|
15671
|
+
if (context === "rgb") {
|
|
15672
|
+
const nudgedRGBChannels = rgbChannels.map((channel) => channel + amount);
|
|
15673
|
+
nudgedChannels = [
|
|
15674
|
+
...nudgedRGBChannels,
|
|
15675
|
+
this.alphaChannel ? channels[3] : undefined
|
|
15676
|
+
];
|
|
15384
15677
|
}
|
|
15678
|
+
else {
|
|
15679
|
+
const nudgedAlpha = opacityToAlpha(alphaToOpacity(color$1.alpha()) + amount);
|
|
15680
|
+
nudgedChannels = [...rgbChannels, nudgedAlpha];
|
|
15681
|
+
}
|
|
15682
|
+
return color(nudgedChannels);
|
|
15385
15683
|
}
|
|
15386
15684
|
get el() { return getElement(this); }
|
|
15387
15685
|
static get watchers() { return {
|
|
@@ -15392,15 +15690,17 @@ class ColorPickerHexInput {
|
|
|
15392
15690
|
"$flags$": 9,
|
|
15393
15691
|
"$tagName$": "calcite-color-picker-hex-input",
|
|
15394
15692
|
"$members$": {
|
|
15395
|
-
"hexLabel": [1, "hex-label"],
|
|
15396
15693
|
"allowEmpty": [4, "allow-empty"],
|
|
15694
|
+
"alphaChannel": [4, "alpha-channel"],
|
|
15695
|
+
"hexLabel": [1, "hex-label"],
|
|
15696
|
+
"messages": [16],
|
|
15697
|
+
"numberingSystem": [1, "numbering-system"],
|
|
15397
15698
|
"scale": [513],
|
|
15398
15699
|
"value": [1537],
|
|
15399
|
-
"numberingSystem": [1, "numbering-system"],
|
|
15400
15700
|
"internalColor": [32],
|
|
15401
15701
|
"setFocus": [64]
|
|
15402
15702
|
},
|
|
15403
|
-
"$listeners$":
|
|
15703
|
+
"$listeners$": undefined,
|
|
15404
15704
|
"$lazyBundleId$": "-",
|
|
15405
15705
|
"$attrsToReflect$": [["scale", "scale"], ["value", "value"]]
|
|
15406
15706
|
}; }
|
|
@@ -15408,14 +15708,20 @@ class ColorPickerHexInput {
|
|
|
15408
15708
|
|
|
15409
15709
|
const CSS$N = {
|
|
15410
15710
|
swatch: "swatch",
|
|
15411
|
-
|
|
15711
|
+
noColorSwatch: "swatch--no-color",
|
|
15712
|
+
checker: "checker"
|
|
15412
15713
|
};
|
|
15413
15714
|
const COLORS = {
|
|
15414
15715
|
borderLight: "rgba(0, 0, 0, 0.3)",
|
|
15415
15716
|
borderDark: "rgba(255, 255, 255, 0.15)"
|
|
15416
15717
|
};
|
|
15718
|
+
const checkerSquareSize = 4;
|
|
15719
|
+
const CHECKER_DIMENSIONS = {
|
|
15720
|
+
squareSize: checkerSquareSize,
|
|
15721
|
+
size: checkerSquareSize * 2
|
|
15722
|
+
};
|
|
15417
15723
|
|
|
15418
|
-
const colorPickerSwatchCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker-swatch{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker-swatch{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker-swatch{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker-swatch{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker-swatch{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-swatch-h{display:none}/*!@:host*/.sc-calcite-color-picker-swatch-h{position:relative;display:inline-flex}/*!@:host([scale=s])*/[scale=s].sc-calcite-color-picker-swatch-h{block-size:1.25rem;inline-size:1.25rem}/*!@:host([scale=m])*/[scale=m].sc-calcite-color-picker-swatch-h{block-size:1.5rem;inline-size:1.5rem}/*!@:host([scale=l])*/[scale=l].sc-calcite-color-picker-swatch-h{block-size:2rem;inline-size:2rem}/*!@.swatch*/.swatch.sc-calcite-color-picker-swatch{overflow:
|
|
15724
|
+
const colorPickerSwatchCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-color-picker-swatch{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-color-picker-swatch{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-color-picker-swatch{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-color-picker-swatch{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-color-picker-swatch{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-color-picker-swatch:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-color-picker-swatch-h{display:none}/*!@:host*/.sc-calcite-color-picker-swatch-h{position:relative;display:inline-flex}/*!@:host([scale=s])*/[scale=s].sc-calcite-color-picker-swatch-h{block-size:1.25rem;inline-size:1.25rem}/*!@:host([scale=m])*/[scale=m].sc-calcite-color-picker-swatch-h{block-size:1.5rem;inline-size:1.5rem}/*!@:host([scale=l])*/[scale=l].sc-calcite-color-picker-swatch-h{block-size:2rem;inline-size:2rem}/*!@.swatch*/.swatch.sc-calcite-color-picker-swatch{overflow:hidden;block-size:inherit;inline-size:inherit}/*!@.swatch rect*/.swatch.sc-calcite-color-picker-swatch rect.sc-calcite-color-picker-swatch{transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}/*!@.swatch--no-color rect*/.swatch--no-color.sc-calcite-color-picker-swatch rect.sc-calcite-color-picker-swatch{fill:var(--calcite-ui-foreground-1)}/*!@.swatch--no-color line*/.swatch--no-color.sc-calcite-color-picker-swatch line.sc-calcite-color-picker-swatch{stroke:var(--calcite-ui-danger)}/*!@.checker*/.checker.sc-calcite-color-picker-swatch{fill:#cacaca}";
|
|
15419
15725
|
|
|
15420
15726
|
class ColorPickerSwatch {
|
|
15421
15727
|
constructor(hostRef) {
|
|
@@ -15425,7 +15731,7 @@ class ColorPickerSwatch {
|
|
|
15425
15731
|
this.scale = "m";
|
|
15426
15732
|
}
|
|
15427
15733
|
handleColorChange(color$1) {
|
|
15428
|
-
this.internalColor = color(color$1);
|
|
15734
|
+
this.internalColor = color$1 ? color(color$1) : null;
|
|
15429
15735
|
}
|
|
15430
15736
|
//--------------------------------------------------------------------------
|
|
15431
15737
|
//
|
|
@@ -15436,12 +15742,38 @@ class ColorPickerSwatch {
|
|
|
15436
15742
|
this.handleColorChange(this.color);
|
|
15437
15743
|
}
|
|
15438
15744
|
render() {
|
|
15745
|
+
const isEmpty = !this.internalColor;
|
|
15746
|
+
const classes = {
|
|
15747
|
+
[CSS$N.swatch]: true,
|
|
15748
|
+
[CSS$N.noColorSwatch]: isEmpty
|
|
15749
|
+
};
|
|
15750
|
+
return (hAsync("svg", { class: classes, xmlns: "http://www.w3.org/2000/svg" }, this.renderSwatch()));
|
|
15751
|
+
}
|
|
15752
|
+
renderSwatch() {
|
|
15439
15753
|
const { active, el, internalColor } = this;
|
|
15440
15754
|
const borderRadius = active ? "100%" : "0";
|
|
15441
|
-
const hex = internalColor.hex();
|
|
15442
15755
|
const theme = getModeName(el);
|
|
15443
15756
|
const borderColor = theme === "light" ? COLORS.borderLight : COLORS.borderDark;
|
|
15444
|
-
|
|
15757
|
+
const commonSwatchProps = {
|
|
15758
|
+
height: "100%",
|
|
15759
|
+
rx: borderRadius,
|
|
15760
|
+
stroke: borderColor,
|
|
15761
|
+
// stroke-width and clip-path are needed to hide overflowing portion of stroke
|
|
15762
|
+
// see https://stackoverflow.com/a/7273346/194216
|
|
15763
|
+
// using attribute to work around Stencil using the prop name vs the attribute when rendering
|
|
15764
|
+
["stroke-width"]: "2",
|
|
15765
|
+
width: "100%"
|
|
15766
|
+
};
|
|
15767
|
+
const isEmpty = !internalColor;
|
|
15768
|
+
if (isEmpty) {
|
|
15769
|
+
return (hAsync(Fragment, null, hAsync("clipPath", { id: "shape" }, hAsync("rect", { height: "100%", rx: borderRadius, width: "100%" })), hAsync("rect", { "clip-path": `inset(0 round ${borderRadius})`, rx: borderRadius, ...commonSwatchProps }), hAsync("line", { "clip-path": "url(#shape)", "stroke-width": "3", x1: "100%", x2: "0", y1: "0", y2: "100%" })));
|
|
15770
|
+
}
|
|
15771
|
+
const alpha = internalColor.alpha();
|
|
15772
|
+
const hex = hexify(internalColor);
|
|
15773
|
+
const hexa = hexify(internalColor, alpha < 1);
|
|
15774
|
+
return (hAsync(Fragment, null, hAsync("title", null, hexa), hAsync("defs", null, hAsync("pattern", { height: CHECKER_DIMENSIONS.size, id: "checker", patternUnits: "userSpaceOnUse", width: CHECKER_DIMENSIONS.size, x: "0", y: "0" }, hAsync("rect", { class: CSS$N.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: "0", y: "0" }), hAsync("rect", { class: CSS$N.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: CHECKER_DIMENSIONS.squareSize, y: CHECKER_DIMENSIONS.squareSize }))), hAsync("rect", { fill: "url(#checker)", height: "100%", rx: borderRadius, width: "100%" }), hAsync("rect", { fill: hex, style: {
|
|
15775
|
+
"clip-path": alpha < 1 ? "polygon(100% 0, 0 0, 0 100%)" : `inset(0 round ${borderRadius})`
|
|
15776
|
+
}, ...commonSwatchProps }), alpha < 1 ? (hAsync("rect", { fill: hexa, key: "opacity-fill", style: { "clip-path": "polygon(100% 0, 100% 100%, 0 100%)" }, ...commonSwatchProps })) : null));
|
|
15445
15777
|
}
|
|
15446
15778
|
get el() { return getElement(this); }
|
|
15447
15779
|
static get watchers() { return {
|
|
@@ -15776,7 +16108,8 @@ const arrow = options => ({
|
|
|
15776
16108
|
y,
|
|
15777
16109
|
placement,
|
|
15778
16110
|
rects,
|
|
15779
|
-
platform
|
|
16111
|
+
platform,
|
|
16112
|
+
elements
|
|
15780
16113
|
} = state;
|
|
15781
16114
|
if (element == null) {
|
|
15782
16115
|
return {};
|
|
@@ -15789,14 +16122,18 @@ const arrow = options => ({
|
|
|
15789
16122
|
const axis = getMainAxisFromPlacement(placement);
|
|
15790
16123
|
const length = getLengthFromAxis(axis);
|
|
15791
16124
|
const arrowDimensions = await platform.getDimensions(element);
|
|
15792
|
-
const
|
|
15793
|
-
const
|
|
16125
|
+
const isYAxis = axis === 'y';
|
|
16126
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
16127
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
16128
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
15794
16129
|
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
15795
16130
|
const startDiff = coords[axis] - rects.reference[axis];
|
|
15796
16131
|
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
15797
|
-
let clientSize = arrowOffsetParent ?
|
|
15798
|
-
|
|
15799
|
-
|
|
16132
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
16133
|
+
|
|
16134
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
16135
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
16136
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
15800
16137
|
}
|
|
15801
16138
|
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
15802
16139
|
|
|
@@ -16337,28 +16674,9 @@ function getComputedStyle$1(element) {
|
|
|
16337
16674
|
return getWindow(element).getComputedStyle(element);
|
|
16338
16675
|
}
|
|
16339
16676
|
|
|
16340
|
-
|
|
16341
|
-
|
|
16342
|
-
const round = Math.round;
|
|
16343
|
-
|
|
16344
|
-
function getCssDimensions(element) {
|
|
16345
|
-
const css = getComputedStyle$1(element);
|
|
16346
|
-
let width = parseFloat(css.width);
|
|
16347
|
-
let height = parseFloat(css.height);
|
|
16348
|
-
const offsetWidth = element.offsetWidth;
|
|
16349
|
-
const offsetHeight = element.offsetHeight;
|
|
16350
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
16351
|
-
if (shouldFallback) {
|
|
16352
|
-
width = offsetWidth;
|
|
16353
|
-
height = offsetHeight;
|
|
16354
|
-
}
|
|
16355
|
-
return {
|
|
16356
|
-
width,
|
|
16357
|
-
height,
|
|
16358
|
-
fallback: shouldFallback
|
|
16359
|
-
};
|
|
16677
|
+
function isNode(value) {
|
|
16678
|
+
return value instanceof getWindow(value).Node;
|
|
16360
16679
|
}
|
|
16361
|
-
|
|
16362
16680
|
function getNodeName(node) {
|
|
16363
16681
|
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
|
|
16364
16682
|
}
|
|
@@ -16382,9 +16700,6 @@ function isHTMLElement(value) {
|
|
|
16382
16700
|
function isElement(value) {
|
|
16383
16701
|
return value instanceof getWindow(value).Element;
|
|
16384
16702
|
}
|
|
16385
|
-
function isNode(value) {
|
|
16386
|
-
return value instanceof getWindow(value).Node;
|
|
16387
|
-
}
|
|
16388
16703
|
function isShadowRoot(node) {
|
|
16389
16704
|
// Browsers without `ShadowRoot` support.
|
|
16390
16705
|
if (typeof ShadowRoot === 'undefined') {
|
|
@@ -16441,6 +16756,29 @@ function isLastTraversableNode(node) {
|
|
|
16441
16756
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
16442
16757
|
}
|
|
16443
16758
|
|
|
16759
|
+
const min = Math.min;
|
|
16760
|
+
const max = Math.max;
|
|
16761
|
+
const round = Math.round;
|
|
16762
|
+
|
|
16763
|
+
function getCssDimensions(element) {
|
|
16764
|
+
const css = getComputedStyle$1(element);
|
|
16765
|
+
let width = parseFloat(css.width);
|
|
16766
|
+
let height = parseFloat(css.height);
|
|
16767
|
+
const hasOffset = isHTMLElement(element);
|
|
16768
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
16769
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
16770
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
16771
|
+
if (shouldFallback) {
|
|
16772
|
+
width = offsetWidth;
|
|
16773
|
+
height = offsetHeight;
|
|
16774
|
+
}
|
|
16775
|
+
return {
|
|
16776
|
+
width,
|
|
16777
|
+
height,
|
|
16778
|
+
fallback: shouldFallback
|
|
16779
|
+
};
|
|
16780
|
+
}
|
|
16781
|
+
|
|
16444
16782
|
function unwrapElement(element) {
|
|
16445
16783
|
return !isElement(element) ? element.contextElement : element;
|
|
16446
16784
|
}
|
|
@@ -16522,16 +16860,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
16522
16860
|
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
16523
16861
|
}
|
|
16524
16862
|
}
|
|
16525
|
-
return {
|
|
16863
|
+
return rectToClientRect({
|
|
16526
16864
|
width,
|
|
16527
16865
|
height,
|
|
16528
|
-
top: y,
|
|
16529
|
-
right: x + width,
|
|
16530
|
-
bottom: y + height,
|
|
16531
|
-
left: x,
|
|
16532
16866
|
x,
|
|
16533
16867
|
y
|
|
16534
|
-
};
|
|
16868
|
+
});
|
|
16535
16869
|
}
|
|
16536
16870
|
|
|
16537
16871
|
function getDocumentElement(node) {
|
|
@@ -16730,6 +17064,13 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
16730
17064
|
}
|
|
16731
17065
|
return rectToClientRect(rect);
|
|
16732
17066
|
}
|
|
17067
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
17068
|
+
const parentNode = getParentNode(element);
|
|
17069
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
17070
|
+
return false;
|
|
17071
|
+
}
|
|
17072
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
17073
|
+
}
|
|
16733
17074
|
|
|
16734
17075
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
16735
17076
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
@@ -16747,19 +17088,17 @@ function getClippingElementAncestors(element, cache) {
|
|
|
16747
17088
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
16748
17089
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
16749
17090
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
16750
|
-
const
|
|
16751
|
-
|
|
16752
|
-
if (shouldIgnoreCurrentNode) {
|
|
17091
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
17092
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
16753
17093
|
currentContainingBlockComputedStyle = null;
|
|
17094
|
+
}
|
|
17095
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
17096
|
+
if (shouldDropCurrentNode) {
|
|
17097
|
+
// Drop non-containing blocks.
|
|
17098
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
16754
17099
|
} else {
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
// Drop non-containing blocks.
|
|
16758
|
-
result = result.filter(ancestor => ancestor !== currentNode);
|
|
16759
|
-
} else {
|
|
16760
|
-
// Record last containing block for next iteration.
|
|
16761
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
16762
|
-
}
|
|
17100
|
+
// Record last containing block for next iteration.
|
|
17101
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
16763
17102
|
}
|
|
16764
17103
|
currentNode = getParentNode(currentNode);
|
|
16765
17104
|
}
|
|
@@ -16796,10 +17135,7 @@ function getClippingRect(_ref) {
|
|
|
16796
17135
|
}
|
|
16797
17136
|
|
|
16798
17137
|
function getDimensions(element) {
|
|
16799
|
-
|
|
16800
|
-
return getCssDimensions(element);
|
|
16801
|
-
}
|
|
16802
|
-
return element.getBoundingClientRect();
|
|
17138
|
+
return getCssDimensions(element);
|
|
16803
17139
|
}
|
|
16804
17140
|
|
|
16805
17141
|
function getTrueOffsetParent(element, polyfill) {
|
|
@@ -16827,6 +17163,9 @@ function getContainingBlock(element) {
|
|
|
16827
17163
|
// such as table ancestors and cross browser bugs.
|
|
16828
17164
|
function getOffsetParent(element, polyfill) {
|
|
16829
17165
|
const window = getWindow(element);
|
|
17166
|
+
if (!isHTMLElement(element)) {
|
|
17167
|
+
return window;
|
|
17168
|
+
}
|
|
16830
17169
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
16831
17170
|
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
16832
17171
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
@@ -25493,7 +25832,7 @@ const CSS$s = {
|
|
|
25493
25832
|
tableContainer: "table-container",
|
|
25494
25833
|
sticky: "sticky-pos"
|
|
25495
25834
|
};
|
|
25496
|
-
const debounceTimeout =
|
|
25835
|
+
const debounceTimeout = 0;
|
|
25497
25836
|
|
|
25498
25837
|
const listCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}/*!@:root*/.sc-calcite-list:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}/*!@.calcite-animate*/.calcite-animate.sc-calcite-list{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}/*!@.calcite-animate__in*/.calcite-animate__in.sc-calcite-list{animation-name:in}/*!@.calcite-animate__in-down*/.calcite-animate__in-down.sc-calcite-list{animation-name:in-down}/*!@.calcite-animate__in-up*/.calcite-animate__in-up.sc-calcite-list{animation-name:in-up}/*!@.calcite-animate__in-scale*/.calcite-animate__in-scale.sc-calcite-list{animation-name:in-scale}@media (prefers-reduced-motion: reduce){/*!@:root*/.sc-calcite-list:root{--calcite-internal-duration-factor:0.01}}/*!@:root*/.sc-calcite-list:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}/*!@:host([hidden])*/[hidden].sc-calcite-list-h{display:none}/*!@:host([disabled])*/[disabled].sc-calcite-list-h{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}/*!@:host([disabled]) *,\n:host([disabled]) ::slotted(*)*/[disabled].sc-calcite-list-h *.sc-calcite-list,.sc-calcite-list-h[disabled] .sc-calcite-list-s>*{pointer-events:none}/*!@:host*/.sc-calcite-list-h{display:block}/*!@:host([disabled]) ::slotted([calcite-hydrated][disabled]),\n:host([disabled]) [calcite-hydrated][disabled]*/.sc-calcite-list-h[disabled] .sc-calcite-list-s>[calcite-hydrated][disabled],[disabled].sc-calcite-list-h [calcite-hydrated][disabled].sc-calcite-list{opacity:1}/*!@.container*/.container.sc-calcite-list{position:relative}/*!@.table-container*/.table-container.sc-calcite-list{position:relative;z-index:1;box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}/*!@.table-container **/.table-container.sc-calcite-list *.sc-calcite-list{box-sizing:border-box}/*!@.table*/.table.sc-calcite-list{inline-size:100%}/*!@::slotted(calcite-list-item)*/.sc-calcite-list-s>calcite-list-item{margin-block-end:1px;--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}/*!@::slotted(calcite-list-item:last-child)*/.sc-calcite-list-s>calcite-list-item:last-child{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}/*!@.sticky-pos*/.sticky-pos.sc-calcite-list{position:sticky;inset-block-start:0px;z-index:300}/*!@calcite-filter*/calcite-filter.sc-calcite-list{margin-block-end:1px}";
|
|
25499
25838
|
|
|
@@ -25506,6 +25845,7 @@ const listItemSelector = "calcite-list-item";
|
|
|
25506
25845
|
class List$1 {
|
|
25507
25846
|
constructor(hostRef) {
|
|
25508
25847
|
registerInstance(this, hostRef);
|
|
25848
|
+
this.calciteListChange = createEvent(this, "calciteListChange", 6);
|
|
25509
25849
|
this.calciteListFilter = createEvent(this, "calciteListFilter", 6);
|
|
25510
25850
|
this.listItems = [];
|
|
25511
25851
|
this.enabledListItems = [];
|
|
@@ -25526,10 +25866,13 @@ class List$1 {
|
|
|
25526
25866
|
}
|
|
25527
25867
|
}
|
|
25528
25868
|
};
|
|
25529
|
-
this.updateSelectedItems =
|
|
25869
|
+
this.updateSelectedItems = (emit = false) => {
|
|
25530
25870
|
this.selectedItems = this.enabledListItems.filter((item) => item.selected);
|
|
25531
|
-
|
|
25532
|
-
|
|
25871
|
+
if (emit) {
|
|
25872
|
+
this.calciteListChange.emit();
|
|
25873
|
+
}
|
|
25874
|
+
};
|
|
25875
|
+
this.updateFilteredItems = (emit = false) => {
|
|
25533
25876
|
const { listItems, filteredData, filterText } = this;
|
|
25534
25877
|
const values = filteredData.map((item) => item.value);
|
|
25535
25878
|
const groups = new Set();
|
|
@@ -25543,7 +25886,6 @@ class List$1 {
|
|
|
25543
25886
|
item.hidden = !matches;
|
|
25544
25887
|
return matches;
|
|
25545
25888
|
}) || [];
|
|
25546
|
-
this.filteredItems = filteredItems;
|
|
25547
25889
|
groups.forEach((group) => {
|
|
25548
25890
|
const hasAtLeastOneMatch = filteredItems.some((item) => group.contains(item));
|
|
25549
25891
|
group.hidden = !hasAtLeastOneMatch;
|
|
@@ -25559,14 +25901,17 @@ class List$1 {
|
|
|
25559
25901
|
}
|
|
25560
25902
|
});
|
|
25561
25903
|
groups.clear();
|
|
25562
|
-
|
|
25904
|
+
this.filteredItems = filteredItems;
|
|
25905
|
+
if (emit) {
|
|
25906
|
+
this.calciteListFilter.emit();
|
|
25907
|
+
}
|
|
25908
|
+
};
|
|
25563
25909
|
this.handleFilter = (event) => {
|
|
25564
25910
|
event.stopPropagation();
|
|
25565
25911
|
const { filteredItems, value } = event.currentTarget;
|
|
25566
25912
|
this.filteredData = filteredItems;
|
|
25567
25913
|
this.filterText = value;
|
|
25568
|
-
this.
|
|
25569
|
-
this.calciteListFilter.emit();
|
|
25914
|
+
this.updateListItems(true);
|
|
25570
25915
|
};
|
|
25571
25916
|
this.getItemData = () => {
|
|
25572
25917
|
return this.listItems.map((item) => ({
|
|
@@ -25576,6 +25921,23 @@ class List$1 {
|
|
|
25576
25921
|
value: item.value
|
|
25577
25922
|
}));
|
|
25578
25923
|
};
|
|
25924
|
+
this.updateListItems = debounce((emit = false) => {
|
|
25925
|
+
const { selectionAppearance, selectionMode } = this;
|
|
25926
|
+
const items = this.queryListItems();
|
|
25927
|
+
items.forEach((item) => {
|
|
25928
|
+
item.selectionAppearance = selectionAppearance;
|
|
25929
|
+
item.selectionMode = selectionMode;
|
|
25930
|
+
});
|
|
25931
|
+
this.listItems = items;
|
|
25932
|
+
if (this.filterEnabled) {
|
|
25933
|
+
this.dataForFilter = this.getItemData();
|
|
25934
|
+
this.filterEl.items = this.dataForFilter;
|
|
25935
|
+
}
|
|
25936
|
+
this.updateFilteredItems(emit);
|
|
25937
|
+
this.enabledListItems = items.filter((item) => !item.disabled && !item.closed);
|
|
25938
|
+
this.setActiveListItem();
|
|
25939
|
+
this.updateSelectedItems(emit);
|
|
25940
|
+
}, debounceTimeout);
|
|
25579
25941
|
this.queryListItems = () => {
|
|
25580
25942
|
return Array.from(this.el.querySelectorAll(listItemSelector));
|
|
25581
25943
|
};
|
|
@@ -25656,14 +26018,17 @@ class List$1 {
|
|
|
25656
26018
|
this.focusRow(enabledListItems[prevIndex]);
|
|
25657
26019
|
}
|
|
25658
26020
|
}
|
|
25659
|
-
|
|
26021
|
+
handleCalciteInternalListItemActive(event) {
|
|
25660
26022
|
const target = event.target;
|
|
25661
26023
|
const { listItems } = this;
|
|
25662
26024
|
listItems.forEach((listItem) => {
|
|
25663
26025
|
listItem.active = listItem === target;
|
|
25664
26026
|
});
|
|
25665
26027
|
}
|
|
25666
|
-
handleCalciteListItemSelect(
|
|
26028
|
+
handleCalciteListItemSelect() {
|
|
26029
|
+
this.updateSelectedItems(true);
|
|
26030
|
+
}
|
|
26031
|
+
handleCalciteInternalListItemSelect(event) {
|
|
25667
26032
|
const target = event.target;
|
|
25668
26033
|
const { listItems, selectionMode } = this;
|
|
25669
26034
|
listItems.forEach((listItem) => {
|
|
@@ -25674,7 +26039,7 @@ class List$1 {
|
|
|
25674
26039
|
this.updateSelectedItems();
|
|
25675
26040
|
}
|
|
25676
26041
|
handleCalciteListItemClose() {
|
|
25677
|
-
this.updateListItems();
|
|
26042
|
+
this.updateListItems(true);
|
|
25678
26043
|
}
|
|
25679
26044
|
//--------------------------------------------------------------------------
|
|
25680
26045
|
//
|
|
@@ -25701,7 +26066,7 @@ class List$1 {
|
|
|
25701
26066
|
if (filteredItems) {
|
|
25702
26067
|
this.filteredData = filteredItems;
|
|
25703
26068
|
}
|
|
25704
|
-
this.
|
|
26069
|
+
this.updateListItems();
|
|
25705
26070
|
}
|
|
25706
26071
|
// --------------------------------------------------------------------------
|
|
25707
26072
|
//
|
|
@@ -25724,22 +26089,6 @@ class List$1 {
|
|
|
25724
26089
|
// eslint-disable-next-line react/jsx-sort-props
|
|
25725
26090
|
ref: (el) => (this.filterEl = el) }))))) : null, hAsync("tbody", { class: CSS$s.tableContainer }, hAsync("slot", { onSlotchange: this.handleDefaultSlotChange })))));
|
|
25726
26091
|
}
|
|
25727
|
-
updateListItems() {
|
|
25728
|
-
const { selectionAppearance, selectionMode } = this;
|
|
25729
|
-
const items = this.queryListItems();
|
|
25730
|
-
items.forEach((item) => {
|
|
25731
|
-
item.selectionAppearance = selectionAppearance;
|
|
25732
|
-
item.selectionMode = selectionMode;
|
|
25733
|
-
});
|
|
25734
|
-
this.listItems = items;
|
|
25735
|
-
this.enabledListItems = items.filter((item) => !item.disabled && !item.closed);
|
|
25736
|
-
if (this.filterEnabled) {
|
|
25737
|
-
this.dataForFilter = this.getItemData();
|
|
25738
|
-
}
|
|
25739
|
-
this.setActiveListItem();
|
|
25740
|
-
this.updateSelectedItems();
|
|
25741
|
-
this.updateFilteredItems();
|
|
25742
|
-
}
|
|
25743
26092
|
get el() { return getElement(this); }
|
|
25744
26093
|
static get watchers() { return {
|
|
25745
26094
|
"filterEnabled": ["handleFilterEnabledChange"],
|
|
@@ -25766,7 +26115,7 @@ class List$1 {
|
|
|
25766
26115
|
"dataForFilter": [32],
|
|
25767
26116
|
"setFocus": [64]
|
|
25768
26117
|
},
|
|
25769
|
-
"$listeners$": [[0, "calciteInternalFocusPreviousItem", "handleCalciteInternalFocusPreviousItem"], [0, "calciteInternalListItemActive", "
|
|
26118
|
+
"$listeners$": [[0, "calciteInternalFocusPreviousItem", "handleCalciteInternalFocusPreviousItem"], [0, "calciteInternalListItemActive", "handleCalciteInternalListItemActive"], [0, "calciteListItemSelect", "handleCalciteListItemSelect"], [0, "calciteInternalListItemSelect", "handleCalciteInternalListItemSelect"], [0, "calciteListItemClose", "handleCalciteListItemClose"]],
|
|
25770
26119
|
"$lazyBundleId$": "-",
|
|
25771
26120
|
"$attrsToReflect$": [["disabled", "disabled"], ["filterEnabled", "filter-enabled"], ["filterPlaceholder", "filter-placeholder"], ["filterText", "filter-text"], ["loading", "loading"], ["selectionMode", "selection-mode"], ["selectionAppearance", "selection-appearance"]]
|
|
25772
26121
|
}; }
|