@prolibu-suite/cobalt-core 0.9.6 → 0.10.0
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/custom-elements.json +750 -80
- package/dist/cjs/co-accordion.cjs.entry.js +1 -1
- package/dist/cjs/co-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-app-shell.cjs.entry.js +4 -4
- package/dist/cjs/co-audio-player.cjs.entry.js +1 -1
- package/dist/cjs/co-autocomplete.cjs.entry.js +2 -2
- package/dist/cjs/co-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/co-avatar_2.cjs.entry.js +49 -17
- package/dist/cjs/co-badge.cjs.entry.js +11 -3
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +2 -2
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +55 -20
- package/dist/cjs/co-calendar_3.cjs.entry.js +27 -15
- package/dist/cjs/co-card.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox.cjs.entry.js +6 -6
- package/dist/cjs/co-chip_2.cjs.entry.js +8 -5
- package/dist/cjs/co-color-picker.cjs.entry.js +1048 -27
- package/dist/cjs/co-column-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-combobox.cjs.entry.js +2 -2
- package/dist/cjs/co-command-search.cjs.entry.js +1 -1
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +1 -1
- package/dist/cjs/co-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range.cjs.entry.js +2 -2
- package/dist/cjs/co-date-time-picker.cjs.entry.js +101 -130
- package/dist/cjs/co-drive-card.cjs.entry.js +2 -2
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-emoji-picker.cjs.entry.js +4 -4
- package/dist/cjs/co-empty-state.cjs.entry.js +4 -4
- package/dist/cjs/co-event-calendar.cjs.entry.js +4 -4
- package/dist/cjs/co-event-popover.cjs.entry.js +3 -3
- package/dist/cjs/co-fab.cjs.entry.js +3 -3
- package/dist/cjs/co-file-field.cjs.entry.js +102 -106
- package/dist/cjs/co-file-type-tile.cjs.entry.js +3 -3
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +6 -6
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +26 -4
- package/dist/cjs/co-json-field.cjs.entry.js +5 -5
- package/dist/cjs/co-lightbox.cjs.entry.js +204 -21
- package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
- package/dist/cjs/co-list-item.cjs.entry.js +5 -5
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +84 -3
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +6 -4
- package/dist/cjs/co-navbar.cjs.entry.js +4 -4
- package/dist/cjs/co-number-field.cjs.entry.js +272 -9
- package/dist/cjs/co-overlay.cjs.entry.js +6 -4
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
- package/dist/cjs/co-popover.cjs.entry.js +58 -21
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +47 -3
- package/dist/cjs/co-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +4 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +4 -4
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +11 -8
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +7 -3
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +4 -3
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-segmented-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-select.cjs.entry.js +2 -2
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +3 -3
- package/dist/cjs/co-switch.cjs.entry.js +6 -6
- package/dist/cjs/co-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/co-tab.cjs.entry.js +3 -3
- package/dist/cjs/co-tags-field.cjs.entry.js +8 -8
- package/dist/cjs/co-textarea.cjs.entry.js +6 -6
- package/dist/cjs/co-time-field.cjs.entry.js +325 -0
- package/dist/cjs/co-toast.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +4 -4
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/co-transfer-list.cjs.entry.js +1 -1
- package/dist/cjs/co-video.cjs.entry.js +32 -7
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/color-CML2Cfdh.js +142 -0
- package/dist/cjs/{dateI18n-wblvKRq_.js → dateI18n-BK2qHqoC.js} +36 -0
- package/dist/cjs/{fieldChip-BLzo9MEV.js → fieldChip-B6YIGU1V.js} +1 -1
- package/dist/cjs/fileI18n-6sdbKvo6.js +88 -0
- package/dist/cjs/{index-DFZ5YhIT.js → index-BYwrR87Z.js} +28 -10
- package/dist/cjs/{index-DK-2Lzmf.js → index-MDAnKsze.js} +25 -21
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{positioning-DCj_AJ2T.js → positioning-CyatXeT_.js} +32 -13
- package/dist/cjs/{requiredMark-C1xcrzSZ.js → requiredMark-D-t-IPN0.js} +1 -1
- package/dist/cjs/{toolbar-config-BQfWTW6P.js → toolbar-config-BSGas-Wl.js} +10 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-f83b48fd.entry.js → p-011dc80b.entry.js} +1 -1
- package/dist/cobalt/{p-316c62c0.entry.js → p-0678c797.entry.js} +1 -1
- package/dist/cobalt/{p-43bd298d.entry.js → p-08e42e00.entry.js} +1 -1
- package/dist/cobalt/{p-1c68bc41.entry.js → p-10b82207.entry.js} +1 -1
- package/dist/cobalt/{p-a8c64cc3.entry.js → p-15d59169.entry.js} +1 -1
- package/dist/cobalt/{p-07d570a6.entry.js → p-16954cea.entry.js} +1 -1
- package/dist/cobalt/{p-85a61e28.entry.js → p-17244412.entry.js} +1 -1
- package/dist/cobalt/p-1788aab5.entry.js +1 -0
- package/dist/cobalt/p-1a589c8e.entry.js +1 -0
- package/dist/cobalt/{p-da546d08.entry.js → p-1dc55e43.entry.js} +1 -1
- package/dist/cobalt/p-20a39218.entry.js +1 -0
- package/dist/cobalt/{p-4c7e3984.entry.js → p-23ab0cc5.entry.js} +1 -1
- package/dist/cobalt/{p-fabe5fb2.entry.js → p-2636b7eb.entry.js} +1 -1
- package/dist/cobalt/{p-88a0659f.entry.js → p-27a7e549.entry.js} +1 -1
- package/dist/cobalt/{p-18d34b01.entry.js → p-290066ef.entry.js} +1 -1
- package/dist/cobalt/{p-89e38c5e.entry.js → p-2f9cbbd5.entry.js} +1 -1
- package/dist/cobalt/{p-ef5e1167.entry.js → p-325b91b6.entry.js} +1 -1
- package/dist/cobalt/{p-60cb66f5.entry.js → p-37f5036b.entry.js} +1 -1
- package/dist/cobalt/p-3cc3ff93.entry.js +1 -0
- package/dist/cobalt/p-410bee4d.entry.js +1 -0
- package/dist/cobalt/{p-6795a258.entry.js → p-44c4e4a3.entry.js} +1 -1
- package/dist/cobalt/{p-4b083da4.entry.js → p-44ea675f.entry.js} +1 -1
- package/dist/cobalt/{p-2828ecf6.entry.js → p-4592ca00.entry.js} +1 -1
- package/dist/cobalt/p-4908f33f.entry.js +1 -0
- package/dist/cobalt/{p-342e1da4.entry.js → p-4d65e713.entry.js} +1 -1
- package/dist/cobalt/{p-dca4cd5f.entry.js → p-4d897896.entry.js} +1 -1
- package/dist/cobalt/{p-33ea4a90.entry.js → p-50bcc76f.entry.js} +1 -1
- package/dist/cobalt/{p-ac91259e.entry.js → p-5298c030.entry.js} +1 -1
- package/dist/cobalt/p-54c987d7.entry.js +1 -0
- package/dist/cobalt/p-56551580.entry.js +1 -0
- package/dist/cobalt/p-58137c9e.entry.js +1 -0
- package/dist/cobalt/{p-4f754c9a.entry.js → p-58d9b650.entry.js} +1 -1
- package/dist/cobalt/p-59963937.entry.js +1 -0
- package/dist/cobalt/{p-2d329ac8.entry.js → p-623cc195.entry.js} +1 -1
- package/dist/cobalt/p-63825d7f.entry.js +1 -0
- package/dist/cobalt/{p-8e667eb6.entry.js → p-66b11b38.entry.js} +1 -1
- package/dist/cobalt/{p-fb3a095b.entry.js → p-6bf6bc3e.entry.js} +1 -1
- package/dist/cobalt/p-6f700f0d.entry.js +1 -0
- package/dist/cobalt/p-73c6d735.entry.js +1 -0
- package/dist/cobalt/{p-a6357340.entry.js → p-76249983.entry.js} +1 -1
- package/dist/cobalt/{p-bfc2a849.entry.js → p-82266f11.entry.js} +1 -1
- package/dist/cobalt/{p-a9b29cc2.entry.js → p-826ee074.entry.js} +1 -1
- package/dist/cobalt/{p-23b3ff3f.entry.js → p-83a9a05a.entry.js} +1 -1
- package/dist/cobalt/{p-568cfe8d.entry.js → p-83ea631d.entry.js} +1 -1
- package/dist/cobalt/p-85501c6a.entry.js +1 -0
- package/dist/cobalt/{p-dfd25f1d.entry.js → p-88195a63.entry.js} +1 -1
- package/dist/cobalt/p-8fa5dc4a.entry.js +1 -0
- package/dist/cobalt/{p-c8dba82f.entry.js → p-91e73a92.entry.js} +1 -1
- package/dist/cobalt/{p-ac466658.entry.js → p-92b092db.entry.js} +1 -1
- package/dist/cobalt/{p-36197363.entry.js → p-996f4e38.entry.js} +1 -1
- package/dist/cobalt/p-BRbgGqLw.js +1 -0
- package/dist/cobalt/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/cobalt/p-DFHRS9cJ.js +1 -0
- package/dist/cobalt/{p-CrtiywTB.js → p-DH5lfRNj.js} +1 -1
- package/dist/{components/p-WeuPA9Rw.js → cobalt/p-DOL2zACE.js} +1 -1
- package/dist/cobalt/p-D_zA1Pv4.js +1 -0
- package/dist/cobalt/{p-fef5db54.entry.js → p-a32b20eb.entry.js} +1 -1
- package/dist/cobalt/p-aa9400bf.entry.js +1 -0
- package/dist/cobalt/{p-8eb485c8.entry.js → p-aaca6dab.entry.js} +1 -1
- package/dist/cobalt/{p-e5495539.entry.js → p-aae86f96.entry.js} +1 -1
- package/dist/cobalt/{p-8f38e24d.entry.js → p-ad33c40e.entry.js} +1 -1
- package/dist/cobalt/p-b0c4fc71.entry.js +1 -0
- package/dist/cobalt/{p-da18b5f4.entry.js → p-b1e8d69e.entry.js} +1 -1
- package/dist/cobalt/p-b48917c9.entry.js +1 -0
- package/dist/cobalt/{p-7e53e9c8.entry.js → p-b565104d.entry.js} +1 -1
- package/dist/cobalt/{p-b0319a2d.entry.js → p-b90d41e4.entry.js} +1 -1
- package/dist/cobalt/{p-c5684c79.entry.js → p-bd683db3.entry.js} +1 -1
- package/dist/cobalt/{p-1ddbc48b.entry.js → p-c124e82b.entry.js} +1 -1
- package/dist/cobalt/{p-95efe661.entry.js → p-c2ebf0ec.entry.js} +1 -1
- package/dist/cobalt/{p-76420ac1.entry.js → p-c32c176a.entry.js} +1 -1
- package/dist/cobalt/{p-54ae807d.entry.js → p-c465d619.entry.js} +1 -1
- package/dist/cobalt/{p-ab45d9bd.entry.js → p-c91d4fc6.entry.js} +1 -1
- package/dist/cobalt/{p-ce35c898.entry.js → p-d29bb0fa.entry.js} +1 -1
- package/dist/cobalt/{p-7c5e846a.entry.js → p-db805569.entry.js} +1 -1
- package/dist/cobalt/p-e01f9b9a.entry.js +1 -0
- package/dist/cobalt/p-e3aae282.entry.js +1 -0
- package/dist/cobalt/{p-d15d3a97.entry.js → p-e4264532.entry.js} +1 -1
- package/dist/cobalt/{p-93c68029.entry.js → p-e48f4e45.entry.js} +1 -1
- package/dist/cobalt/{p-3f0eed59.entry.js → p-e49a564c.entry.js} +1 -1
- package/dist/cobalt/p-e8a2f993.entry.js +1 -0
- package/dist/cobalt/p-e8a4e6b0.entry.js +1 -0
- package/dist/cobalt/p-ea20f048.entry.js +1 -0
- package/dist/cobalt/{p-c1e7fb32.entry.js → p-eb063cc0.entry.js} +1 -1
- package/dist/cobalt/p-eb82358d.entry.js +1 -0
- package/dist/cobalt/{p-2114c036.entry.js → p-eb8691f2.entry.js} +1 -1
- package/dist/cobalt/{p-e8878cf9.entry.js → p-ee2023da.entry.js} +1 -1
- package/dist/cobalt/p-ee9a623d.entry.js +1 -0
- package/dist/cobalt/p-ef5ca521.entry.js +1 -0
- package/dist/cobalt/p-f4e1c3c3.entry.js +1 -0
- package/dist/cobalt/{p-e364b8a5.entry.js → p-f57dffca.entry.js} +1 -1
- package/dist/cobalt/p-f6691108.entry.js +1 -0
- package/dist/cobalt/p-f68dd124.entry.js +1 -0
- package/dist/cobalt/p-fMqVDypp.js +1 -0
- package/dist/cobalt/{p-0c463d9a.entry.js → p-fd150cc6.entry.js} +1 -1
- package/dist/cobalt/{p-0e91e5c4.entry.js → p-fe7e8813.entry.js} +1 -1
- package/dist/cobalt/p-gKnOhsd2.js +1 -0
- package/dist/cobalt/p-jYd9gu_c.js +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/co-app-shell/co-app-shell.css +107 -41
- package/dist/collection/components/co-app-shell/co-app-shell.js +2 -2
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-badge/co-badge.css +18 -0
- package/dist/collection/components/co-badge/co-badge.js +29 -1
- package/dist/collection/components/co-button/co-button.css +4 -4
- package/dist/collection/components/co-checkbox/co-checkbox.css +12 -3
- package/dist/collection/components/co-checkbox/co-checkbox.js +6 -6
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +1 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-picker/co-color-picker.css +252 -5
- package/dist/collection/components/co-color-picker/co-color-picker.js +932 -15
- package/dist/collection/components/co-color-picker/presets.js +113 -15
- package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +1 -1
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
- package/dist/collection/components/co-date-field/co-date-field.js +4 -4
- package/dist/collection/components/co-date-range/co-date-range.js +1 -1
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.css +128 -32
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +142 -138
- package/dist/collection/components/co-drawer/co-drawer.css +99 -36
- package/dist/collection/components/co-drawer/co-drawer.js +19 -7
- package/dist/collection/components/co-drive-card/co-drive-card.js +1 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +1 -1
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.js +2 -2
- package/dist/collection/components/co-empty-state/co-empty-state.css +28 -0
- package/dist/collection/components/co-empty-state/co-empty-state.js +2 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +2 -2
- package/dist/collection/components/co-event-popover/co-event-popover.js +1 -1
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.css +55 -2
- package/dist/collection/components/co-file-field/co-file-field.js +41 -13
- package/dist/collection/components/co-file-field/co-file-field.utils.js +51 -4
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +2 -2
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +2 -2
- package/dist/collection/components/co-icon-button/co-icon-button.css +40 -2
- package/dist/collection/components/co-icon-button/co-icon-button.js +43 -4
- package/dist/collection/components/co-input/co-input.css +33 -0
- package/dist/collection/components/co-input/co-input.js +25 -2
- package/dist/collection/components/co-json-field/co-json-field.js +3 -3
- package/dist/collection/components/co-lightbox/co-lightbox.css +23 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +209 -20
- package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
- package/dist/collection/components/co-list-item/co-list-item.js +4 -4
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +2 -2
- package/dist/collection/components/co-menu/co-menu.js +1 -1
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
- package/dist/collection/components/co-menu-item/co-menu-item.js +67 -3
- package/dist/collection/components/co-modal/co-modal.css +106 -37
- package/dist/collection/components/co-modal/co-modal.js +4 -2
- package/dist/collection/components/co-navbar/co-navbar.css +4 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +22 -0
- package/dist/collection/components/co-number-field/co-number-field.js +216 -9
- package/dist/collection/components/co-option-list/co-option-list.css +25 -4
- package/dist/collection/components/co-option-list/co-option-list.js +26 -3
- package/dist/collection/components/co-overlay/co-overlay.js +5 -3
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +18 -3
- package/dist/collection/components/co-popover/co-popover.js +83 -20
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.js +3 -3
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +14 -1
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +9 -6
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +7 -3
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +3 -2
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.css +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.css +18 -0
- package/dist/collection/components/co-skeleton/co-skeleton.js +83 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +3 -3
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +2 -2
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-time-field/co-time-field.css +111 -0
- package/dist/collection/components/co-time-field/co-time-field.js +536 -0
- package/dist/collection/components/co-toast/co-toast.css +13 -7
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +16 -11
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +7 -1
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +12 -1
- package/dist/collection/components/co-tooltip/co-tooltip.js +49 -16
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-video/co-video.js +34 -9
- package/dist/collection/utils/amountText.js +95 -0
- package/dist/collection/utils/color.js +109 -3
- package/dist/collection/utils/colorPickerI18n.js +55 -0
- package/dist/collection/utils/dateI18n.js +36 -0
- package/dist/collection/utils/fileI18n.js +3 -0
- package/dist/collection/utils/positioning.js +37 -4
- package/dist/collection/utils/submenu.js +35 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-badge.js +1 -1
- package/dist/components/co-breadcrumb-item.js +1 -1
- package/dist/components/co-breadcrumb.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-calendar.js +1 -1
- package/dist/components/co-carousel.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-drive-card.js +1 -1
- package/dist/components/co-drop-zone.js +1 -1
- package/dist/components/co-emoji-picker.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-event-popover.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-file-type-tile.js +1 -1
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-footer.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-media-thumb.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-rich-text-toolbar.js +1 -1
- package/dist/components/co-rich-text-viewer.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-time-field.d.ts +11 -0
- package/dist/components/co-time-field.js +1 -0
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-9ceBPSd1.js +1 -0
- package/dist/components/p-B1QFLcY9.js +1 -0
- package/dist/components/p-B2IsXte7.js +1 -0
- package/dist/components/p-B4NCaKrR.js +1 -0
- package/dist/components/p-BBP5__CY.js +1 -0
- package/dist/components/{p-Dabi98BI.js → p-BGDqldEg.js} +1 -1
- package/dist/components/p-BRbgGqLw.js +1 -0
- package/dist/components/p-Be_kyNRE.js +1 -0
- package/dist/components/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/components/p-BsTO1uUA.js +1 -0
- package/dist/components/{p-CuZXTvDM.js → p-Bv6U5y3d.js} +1 -1
- package/dist/components/p-BxP8OBw6.js +1 -0
- package/dist/components/{p-P8wvwhM2.js → p-CFFDmGPS.js} +1 -1
- package/dist/components/{p-CA_JAK9s.js → p-CT2enQ6h.js} +1 -1
- package/dist/components/p-CXPRaTuo.js +1 -0
- package/dist/components/{p-D5EdMieb.js → p-Cl3AdEQJ.js} +1 -1
- package/dist/components/p-CnX3L8aF.js +1 -0
- package/dist/components/p-DFHRS9cJ.js +1 -0
- package/dist/components/p-DIo66nBr.js +1 -0
- package/dist/components/{p-Dj1EZ5qD.js → p-DNJAIVfI.js} +1 -1
- package/dist/{cobalt/p-WeuPA9Rw.js → components/p-DOL2zACE.js} +1 -1
- package/dist/components/p-DRP8D9ro.js +1 -0
- package/dist/components/p-DkDTmHCg.js +1 -0
- package/dist/components/{p-Bxk96Zgc.js → p-Du_CgT5E.js} +1 -1
- package/dist/components/{p-BHYtxTzM.js → p-HxVRXXXC.js} +1 -1
- package/dist/components/{p-B0Dc-I_C.js → p-NNxjElcX.js} +1 -1
- package/dist/components/p-gKnOhsd2.js +1 -0
- package/dist/components/p-jYd9gu_c.js +1 -0
- package/dist/components/{p-D4qzGifz.js → p-vby0ITbe.js} +1 -1
- package/dist/components/{p-D6OUW6oW.js → p-x4grh-eZ.js} +1 -1
- package/dist/esm/co-accordion.entry.js +1 -1
- package/dist/esm/co-action-bar.entry.js +1 -1
- package/dist/esm/co-app-shell.entry.js +4 -4
- package/dist/esm/co-audio-player.entry.js +1 -1
- package/dist/esm/co-autocomplete.entry.js +2 -2
- package/dist/esm/co-avatar-group.entry.js +1 -1
- package/dist/esm/co-avatar_2.entry.js +49 -17
- package/dist/esm/co-badge.entry.js +11 -3
- package/dist/esm/co-bottom-sheet.entry.js +1 -1
- package/dist/esm/co-breadcrumb-item.entry.js +1 -1
- package/dist/esm/co-breadcrumb.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +2 -2
- package/dist/esm/co-calendar-month_2.entry.js +37 -2
- package/dist/esm/co-calendar_3.entry.js +27 -15
- package/dist/esm/co-card.entry.js +1 -1
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +2 -2
- package/dist/esm/co-checkbox-group.entry.js +2 -2
- package/dist/esm/co-checkbox.entry.js +6 -6
- package/dist/esm/co-chip_2.entry.js +8 -5
- package/dist/esm/co-color-picker.entry.js +1048 -27
- package/dist/esm/co-column-picker.entry.js +3 -3
- package/dist/esm/co-combobox.entry.js +2 -2
- package/dist/esm/co-command-search.entry.js +1 -1
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +1 -1
- package/dist/esm/co-date-picker.entry.js +3 -3
- package/dist/esm/co-date-range-picker.entry.js +3 -3
- package/dist/esm/co-date-range.entry.js +2 -2
- package/dist/esm/co-date-time-picker.entry.js +101 -130
- package/dist/esm/co-drive-card.entry.js +2 -2
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-emoji-picker.entry.js +4 -4
- package/dist/esm/co-empty-state.entry.js +4 -4
- package/dist/esm/co-event-calendar.entry.js +4 -4
- package/dist/esm/co-event-popover.entry.js +3 -3
- package/dist/esm/co-fab.entry.js +3 -3
- package/dist/esm/co-file-field.entry.js +95 -99
- package/dist/esm/co-file-type-tile.entry.js +3 -3
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +6 -6
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +26 -4
- package/dist/esm/co-json-field.entry.js +5 -5
- package/dist/esm/co-lightbox.entry.js +204 -21
- package/dist/esm/co-list-footer.entry.js +2 -2
- package/dist/esm/co-list-item.entry.js +5 -5
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +3 -3
- package/dist/esm/co-menu-divider.entry.js +2 -2
- package/dist/esm/co-menu-item.entry.js +84 -3
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +6 -4
- package/dist/esm/co-navbar.entry.js +4 -4
- package/dist/esm/co-number-field.entry.js +272 -9
- package/dist/esm/co-overlay.entry.js +6 -4
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +3 -3
- package/dist/esm/co-popover.entry.js +58 -21
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +3 -3
- package/dist/esm/co-provider-logo_2.entry.js +47 -3
- package/dist/esm/co-radio-group.entry.js +1 -1
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +4 -4
- package/dist/esm/co-ref-field.entry.js +4 -4
- package/dist/esm/co-rich-text-editor.entry.js +11 -8
- package/dist/esm/co-rich-text-toolbar.entry.js +7 -3
- package/dist/esm/co-rich-text-viewer.entry.js +4 -3
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-segmented-bar.entry.js +1 -1
- package/dist/esm/co-select.entry.js +2 -2
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +2 -2
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +3 -3
- package/dist/esm/co-switch.entry.js +6 -6
- package/dist/esm/co-tab-group.entry.js +3 -3
- package/dist/esm/co-tab.entry.js +3 -3
- package/dist/esm/co-tags-field.entry.js +8 -8
- package/dist/esm/co-textarea.entry.js +6 -6
- package/dist/esm/co-time-field.entry.js +323 -0
- package/dist/esm/co-toast.entry.js +2 -2
- package/dist/esm/co-toggle-button-group.entry.js +4 -4
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/co-transfer-list.entry.js +1 -1
- package/dist/esm/co-video.entry.js +32 -7
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/color-BRbgGqLw.js +136 -0
- package/dist/esm/{dateI18n-CnNpoKwg.js → dateI18n-jYd9gu_c.js} +36 -0
- package/dist/esm/{fieldChip-DsAfq1e0.js → fieldChip-uyggU8VV.js} +1 -1
- package/dist/esm/fileI18n-gKnOhsd2.js +84 -0
- package/dist/esm/{index-RuXxdKzC.js → index-68iUQp5j.js} +28 -10
- package/dist/esm/{index-CrtiywTB.js → index-DH5lfRNj.js} +25 -21
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{positioning-BMdapAL8.js → positioning-DFHRS9cJ.js} +32 -13
- package/dist/esm/{requiredMark-DCD-ZA51.js → requiredMark-BCJUuZvC.js} +1 -1
- package/dist/esm/{toolbar-config-WeuPA9Rw.js → toolbar-config-DOL2zACE.js} +10 -0
- package/dist/types/components/co-badge/co-badge.d.ts +7 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +1 -1
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +358 -4
- package/dist/types/components/co-color-picker/presets.d.ts +107 -4
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +43 -21
- package/dist/types/components/co-drawer/co-drawer.d.ts +4 -3
- package/dist/types/components/co-file-field/co-file-field.d.ts +14 -0
- package/dist/types/components/co-file-field/co-file-field.utils.d.ts +18 -1
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +9 -0
- package/dist/types/components/co-input/co-input.d.ts +4 -0
- package/dist/types/components/co-lightbox/co-lightbox.d.ts +60 -4
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +16 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +42 -1
- package/dist/types/components/co-option-list/co-option-list.d.ts +3 -0
- package/dist/types/components/co-overlay/co-overlay.d.ts +4 -2
- package/dist/types/components/co-popover/co-popover.d.ts +16 -0
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +1 -1
- package/dist/types/components/co-skeleton/co-skeleton.d.ts +13 -0
- package/dist/types/components/co-time-field/co-time-field.d.ts +60 -0
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +5 -0
- package/dist/types/components/co-video/co-video.d.ts +4 -0
- package/dist/types/components.d.ts +451 -87
- package/dist/types/utils/amountText.d.ts +34 -0
- package/dist/types/utils/color.d.ts +44 -1
- package/dist/types/utils/colorPickerI18n.d.ts +26 -0
- package/dist/types/utils/dateI18n.d.ts +12 -0
- package/dist/types/utils/fileI18n.d.ts +1 -0
- package/dist/types/utils/positioning.d.ts +10 -0
- package/dist/types/utils/submenu.d.ts +44 -0
- package/package.json +3 -3
- package/dist/cjs/color-YhUkm10t.js +0 -32
- package/dist/cjs/time-LBHtzLHe.js +0 -42
- package/dist/cobalt/p-07904986.entry.js +0 -1
- package/dist/cobalt/p-09799193.entry.js +0 -1
- package/dist/cobalt/p-17ae943c.entry.js +0 -1
- package/dist/cobalt/p-23a103a0.entry.js +0 -1
- package/dist/cobalt/p-2f88d151.entry.js +0 -1
- package/dist/cobalt/p-3495fda1.entry.js +0 -1
- package/dist/cobalt/p-409f28bb.entry.js +0 -1
- package/dist/cobalt/p-682b3313.entry.js +0 -1
- package/dist/cobalt/p-6bf814f9.entry.js +0 -1
- package/dist/cobalt/p-7532c739.entry.js +0 -1
- package/dist/cobalt/p-7c88163e.entry.js +0 -1
- package/dist/cobalt/p-7cf4b4ae.entry.js +0 -1
- package/dist/cobalt/p-7ea87b75.entry.js +0 -1
- package/dist/cobalt/p-8183f56f.entry.js +0 -1
- package/dist/cobalt/p-8345b25f.entry.js +0 -1
- package/dist/cobalt/p-983af614.entry.js +0 -1
- package/dist/cobalt/p-BG4WRR22.js +0 -1
- package/dist/cobalt/p-BMdapAL8.js +0 -1
- package/dist/cobalt/p-CF8OB_TM.js +0 -1
- package/dist/cobalt/p-CnNpoKwg.js +0 -1
- package/dist/cobalt/p-T4la7ly_.js +0 -1
- package/dist/cobalt/p-a2d31248.entry.js +0 -1
- package/dist/cobalt/p-a6b5cadd.entry.js +0 -1
- package/dist/cobalt/p-b8581787.entry.js +0 -1
- package/dist/cobalt/p-bcedbd73.entry.js +0 -1
- package/dist/cobalt/p-d40a465f.entry.js +0 -1
- package/dist/cobalt/p-dea43204.entry.js +0 -1
- package/dist/cobalt/p-dfcf667d.entry.js +0 -1
- package/dist/cobalt/p-e6882ddd.entry.js +0 -1
- package/dist/cobalt/p-e84eda2e.entry.js +0 -1
- package/dist/cobalt/p-f25967fb.entry.js +0 -1
- package/dist/cobalt/p-f5f1b463.entry.js +0 -1
- package/dist/cobalt/p-fd39f410.entry.js +0 -1
- package/dist/cobalt/p-mAGnZXRn.js +0 -1
- package/dist/components/p-BMdapAL8.js +0 -1
- package/dist/components/p-BTQEg3UO.js +0 -1
- package/dist/components/p-Bbny3WUc.js +0 -1
- package/dist/components/p-Bz0QZqnB.js +0 -1
- package/dist/components/p-CF8OB_TM.js +0 -1
- package/dist/components/p-CR0izsJC.js +0 -1
- package/dist/components/p-CnNpoKwg.js +0 -1
- package/dist/components/p-DI1ek0EB.js +0 -1
- package/dist/components/p-DP0bbhfN.js +0 -1
- package/dist/components/p-D_9BRkj6.js +0 -1
- package/dist/components/p-DbipMAyT.js +0 -1
- package/dist/components/p-DgUBcJIS.js +0 -1
- package/dist/components/p-DolCkNsL.js +0 -1
- package/dist/components/p-hfGFsvaD.js +0 -1
- package/dist/esm/color-BG4WRR22.js +0 -30
- package/dist/esm/time-CF8OB_TM.js +0 -37
|
@@ -86,8 +86,14 @@
|
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
gap: 2px;
|
|
88
88
|
padding: 3px;
|
|
89
|
+
/* border-box: con [full-width] el div interno lleva width:100% y este padding;
|
|
90
|
+
en content-box pintaba 6px más ancho que el host (sin part= para parchear afuera). */
|
|
91
|
+
box-sizing: border-box;
|
|
89
92
|
border-radius: 10px;
|
|
90
|
-
|
|
93
|
+
/* Track un escalón más oscuro (muted = gray-200) + hairline: sobre gray-100 la pill
|
|
94
|
+
blanca no se despegaba. Semántico: se tematiza en dark. */
|
|
95
|
+
background: var(--co-semantic-surface-muted);
|
|
96
|
+
box-shadow: inset 0 0 0 1px var(--co-semantic-border-subtle);
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
.co-toggle-button-group--track ::slotted(co-toggle-button) {
|
|
@@ -65,13 +65,13 @@ export class CoToggleButtonGroup {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h("div", { key: '
|
|
68
|
+
return (h("div", { key: '791c8d809965eb0287cf8c4fd8d23787e7956932', class: {
|
|
69
69
|
'co-toggle-button-group': true,
|
|
70
70
|
[`co-toggle-button-group--${this.direction}`]: true,
|
|
71
71
|
[`co-toggle-button-group--${this.variant}`]: true,
|
|
72
72
|
'co-toggle-button-group--disabled': this.disabled,
|
|
73
73
|
'co-toggle-button-group--full': this.fullWidth,
|
|
74
|
-
}, role: "group" }, h("slot", { key: '
|
|
74
|
+
}, role: "group" }, h("slot", { key: 'fa4b4b06eeac7b90e2fa8df41f9f1b6c7b34accc' })));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "co-toggle-button-group"; }
|
|
77
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
word-wrap: break-word;
|
|
70
70
|
|
|
71
71
|
/* Entry animation */
|
|
72
|
-
transition: opacity var(--co-motion-duration-
|
|
72
|
+
transition: opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.co-tooltip__panel--positioned {
|
|
@@ -77,6 +77,17 @@
|
|
|
77
77
|
opacity: 1;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/* Exit animation: fades out in place (no slide) — the panel keeps its
|
|
81
|
+
--positioned transform (translate 0), so only opacity needs to move.
|
|
82
|
+
`instant` matches the short-lived nature of a tooltip. */
|
|
83
|
+
.co-tooltip__panel--closing {
|
|
84
|
+
visibility: visible;
|
|
85
|
+
opacity: 0;
|
|
86
|
+
transition:
|
|
87
|
+
opacity var(--co-motion-duration-instant) var(--co-motion-ease-in),
|
|
88
|
+
transform var(--co-motion-duration-instant) var(--co-motion-ease-in);
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
/* Slide-in from direction */
|
|
81
92
|
.co-tooltip__panel--top {
|
|
82
93
|
transform: translateY(4px);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import { computePosition,
|
|
2
|
+
import { computePosition, findScrollParents, getOffsetAncestor } from "../../utils/positioning";
|
|
3
3
|
export class CoTooltip {
|
|
4
4
|
constructor() {
|
|
5
5
|
// ── Props ──────────────────────────────────────────────────
|
|
@@ -10,7 +10,7 @@ export class CoTooltip {
|
|
|
10
10
|
/** Gap in px between the trigger and tooltip. */
|
|
11
11
|
this.offset = 8;
|
|
12
12
|
/** Delay in ms before showing the tooltip on hover. */
|
|
13
|
-
this.showDelay =
|
|
13
|
+
this.showDelay = 80;
|
|
14
14
|
/** Delay in ms before hiding the tooltip on mouse leave. */
|
|
15
15
|
this.hideDelay = 100;
|
|
16
16
|
/** Prevent the tooltip from appearing. */
|
|
@@ -28,6 +28,8 @@ export class CoTooltip {
|
|
|
28
28
|
// ── State ──────────────────────────────────────────────────
|
|
29
29
|
this.visible = false;
|
|
30
30
|
this.actualPlacement = 'top';
|
|
31
|
+
/** Fase de salida: mantiene el panel montado mientras corre la transición de cierre. */
|
|
32
|
+
this.closing = false;
|
|
31
33
|
/** Activación del trigger (click/tap): el tooltip se oculta y queda
|
|
32
34
|
* SUPRIMIDO hasta que el puntero salga y vuelva a entrar (o el foco salga).
|
|
33
35
|
* Sin esto, el tooltip re-aparece SOBRE el menú/popover que el click abrió
|
|
@@ -59,6 +61,21 @@ export class CoTooltip {
|
|
|
59
61
|
this.clearTimers();
|
|
60
62
|
this.visible = false;
|
|
61
63
|
};
|
|
64
|
+
// ── Closing phase ──────────────────────────────────────────
|
|
65
|
+
this.finishClose = () => {
|
|
66
|
+
clearTimeout(this.closeFallbackTimer);
|
|
67
|
+
if (this.visible)
|
|
68
|
+
return; // reabierto durante el cierre
|
|
69
|
+
this.closing = false;
|
|
70
|
+
this.panelEl = undefined;
|
|
71
|
+
};
|
|
72
|
+
this.handlePanelTransitionEnd = (e) => {
|
|
73
|
+
if (this.visible || !this.closing)
|
|
74
|
+
return;
|
|
75
|
+
if (e.target !== this.panelEl || e.propertyName !== 'opacity')
|
|
76
|
+
return;
|
|
77
|
+
this.finishClose();
|
|
78
|
+
};
|
|
62
79
|
// ── Event handlers ─────────────────────────────────────────
|
|
63
80
|
this.handleMouseEnter = () => {
|
|
64
81
|
this.scheduleShow();
|
|
@@ -135,10 +152,17 @@ export class CoTooltip {
|
|
|
135
152
|
disconnectedCallback() {
|
|
136
153
|
this.clearTimers();
|
|
137
154
|
this.cleanupListeners();
|
|
155
|
+
clearTimeout(this.closeFallbackTimer);
|
|
156
|
+
// Desconectado a mitad del exit: si se reconecta luego sin haber pasado
|
|
157
|
+
// por finishClose, `closing` quedaría stale en true y el panel nacería
|
|
158
|
+
// en fase de salida (mismo fix que co-popover).
|
|
159
|
+
this.closing = false;
|
|
138
160
|
}
|
|
139
161
|
// ── Watchers ───────────────────────────────────────────────
|
|
140
162
|
onVisibleChange(isVisible) {
|
|
141
163
|
if (isVisible) {
|
|
164
|
+
this.closing = false;
|
|
165
|
+
clearTimeout(this.closeFallbackTimer);
|
|
142
166
|
this.scheduleUpdate();
|
|
143
167
|
requestAnimationFrame(() => {
|
|
144
168
|
requestAnimationFrame(() => {
|
|
@@ -151,10 +175,16 @@ export class CoTooltip {
|
|
|
151
175
|
this.cleanupListeners();
|
|
152
176
|
this.cachedOffsetAncestor = null;
|
|
153
177
|
this.offsetAncestorComputed = false;
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
|
|
178
|
+
// Panel keeps its ref/position frozen through the exit animation — the ref
|
|
179
|
+
// is dropped only when `finishClose` actually unmounts the node
|
|
180
|
+
// (transitionend, or the fallback timer). `panelEl` is intentionally NOT
|
|
181
|
+
// cleared here (mirrors co-popover).
|
|
182
|
+
this.closing = true;
|
|
183
|
+
// Fallback por si transitionend no dispara (tab oculta, display:none ancestro).
|
|
184
|
+
// ⚠️ Atado al token: debe superar --co-motion-duration-instant (80ms) con
|
|
185
|
+
// margen — si el retune sube `instant` bastante, revisar esta constante.
|
|
186
|
+
clearTimeout(this.closeFallbackTimer);
|
|
187
|
+
this.closeFallbackTimer = setTimeout(() => this.finishClose(), 250);
|
|
158
188
|
}
|
|
159
189
|
}
|
|
160
190
|
onDisabledChange(isDisabled) {
|
|
@@ -200,14 +230,15 @@ export class CoTooltip {
|
|
|
200
230
|
}
|
|
201
231
|
}
|
|
202
232
|
// ── Scroll/resize listeners ────────────────────────────────
|
|
233
|
+
// Mismo criterio que co-popover: el capture de window no ve el scroll de un
|
|
234
|
+
// contenedor que vive dentro de un shadow root (los eventos `scroll` no son
|
|
235
|
+
// `composed`), así que hay que engancharse a los scrollers reales.
|
|
203
236
|
addScrollListeners() {
|
|
204
237
|
window.addEventListener('resize', this.scheduleUpdate, { passive: true });
|
|
205
238
|
window.addEventListener('scroll', this.scheduleUpdate, { passive: true, capture: true });
|
|
206
|
-
this.scrollParents =
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
scrollAncestor.addEventListener('scroll', this.scheduleUpdate, { passive: true });
|
|
210
|
-
this.scrollParents.push(scrollAncestor);
|
|
239
|
+
this.scrollParents = findScrollParents(this.el);
|
|
240
|
+
for (const parent of this.scrollParents) {
|
|
241
|
+
parent.addEventListener('scroll', this.scheduleUpdate, { passive: true });
|
|
211
242
|
}
|
|
212
243
|
}
|
|
213
244
|
cleanupListeners() {
|
|
@@ -225,16 +256,17 @@ export class CoTooltip {
|
|
|
225
256
|
// ── Render ─────────────────────────────────────────────────
|
|
226
257
|
render() {
|
|
227
258
|
const side = this.actualPlacement.split('-')[0];
|
|
228
|
-
return (h("div", { key: '
|
|
259
|
+
return (h("div", { key: '816929fb58effd04bcf80d05701958908ec519ab', class: "co-tooltip" }, h("div", { key: 'c10088f6be74066442214018b7caa96a74720854', class: "co-tooltip__trigger", ref: (el) => (this.triggerEl = el), onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onPointerDown: this.handlePointerDown, onFocusin: this.handleFocusIn, onFocusout: this.handleFocusOut, onKeyDown: this.handleKeyDown, "aria-describedby": this.visible ? 'tooltip-panel' : undefined }, h("slot", { key: '59ccc1dc05c746a6e7b1bc28162286c82104af55' })), (this.visible || this.closing) && this.content && (h("div", { key: 'e6df791ab51d0d7f02687d13adbcf75783d93f60', id: "tooltip-panel", class: {
|
|
229
260
|
'co-tooltip__panel': true,
|
|
230
261
|
[`co-tooltip__panel--${side}`]: true,
|
|
231
|
-
|
|
262
|
+
'co-tooltip__panel--closing': this.closing,
|
|
263
|
+
}, role: "tooltip", popover: "manual", onTransitionEnd: this.handlePanelTransitionEnd, ref: (el) => {
|
|
232
264
|
if (el && el !== this.panelEl) {
|
|
233
265
|
this.panelEl = el;
|
|
234
266
|
this.promotePanel();
|
|
235
267
|
this.scheduleUpdate();
|
|
236
268
|
}
|
|
237
|
-
}, style: { maxWidth: this.maxWidth } }, this.arrow && h("div", { key: '
|
|
269
|
+
}, style: { maxWidth: this.maxWidth } }, this.arrow && h("div", { key: 'b9d9ac7b80f011641b50f26d1e9d4a596ee5a355', class: `co-tooltip__arrow co-tooltip__arrow--${side}` }), h("span", { key: '2b6ff2b0408b4529d6c63d173846dde96dce8e16', class: "co-tooltip__content" }, this.content)))));
|
|
238
270
|
}
|
|
239
271
|
static get is() { return "co-tooltip"; }
|
|
240
272
|
static get encapsulation() { return "shadow"; }
|
|
@@ -335,7 +367,7 @@ export class CoTooltip {
|
|
|
335
367
|
"setter": false,
|
|
336
368
|
"reflect": false,
|
|
337
369
|
"attribute": "show-delay",
|
|
338
|
-
"defaultValue": "
|
|
370
|
+
"defaultValue": "80"
|
|
339
371
|
},
|
|
340
372
|
"hideDelay": {
|
|
341
373
|
"type": "number",
|
|
@@ -462,7 +494,8 @@ export class CoTooltip {
|
|
|
462
494
|
static get states() {
|
|
463
495
|
return {
|
|
464
496
|
"visible": {},
|
|
465
|
-
"actualPlacement": {}
|
|
497
|
+
"actualPlacement": {},
|
|
498
|
+
"closing": {}
|
|
466
499
|
};
|
|
467
500
|
}
|
|
468
501
|
static get elementRef() { return "el"; }
|
|
@@ -205,7 +205,7 @@ export class CoTransferList {
|
|
|
205
205
|
"references": {
|
|
206
206
|
"TransferOption": {
|
|
207
207
|
"location": "local",
|
|
208
|
-
"path": "/Users/agox/
|
|
208
|
+
"path": "/Users/agox/Documents/Prolibu/prolibu-cobalt/packages/core/src/components/co-transfer-list/co-transfer-list.tsx",
|
|
209
209
|
"id": "src/components/co-transfer-list/co-transfer-list.tsx::TransferOption"
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -197,6 +197,12 @@ export class CoVideo {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
this.handleContainerTouchStart = () => {
|
|
200
|
+
// `controlsAutoHide={false}` significa controles FIJOS: sin este guard un
|
|
201
|
+
// solo tap los apaga y ya no vuelven mientras siga reproduciendo (el resto
|
|
202
|
+
// de caminos que los reponen sí respetan el prop). En un visor que además
|
|
203
|
+
// atrapa el Tab, eso deja controles invisibles pero focusables.
|
|
204
|
+
if (!this.controlsAutoHide)
|
|
205
|
+
return;
|
|
200
206
|
if (this.showControlBar && this.isPlaying) {
|
|
201
207
|
this.showControlBar = false;
|
|
202
208
|
}
|
|
@@ -210,7 +216,11 @@ export class CoVideo {
|
|
|
210
216
|
return;
|
|
211
217
|
this.duration = this.videoEl.duration;
|
|
212
218
|
this.hasError = false;
|
|
213
|
-
this.coReady.emit({
|
|
219
|
+
this.coReady.emit({
|
|
220
|
+
duration: this.duration,
|
|
221
|
+
width: this.videoEl.videoWidth,
|
|
222
|
+
height: this.videoEl.videoHeight,
|
|
223
|
+
});
|
|
214
224
|
if (this.currentTime > 0 && this.currentTime < this.duration) {
|
|
215
225
|
this.videoEl.currentTime = this.currentTime;
|
|
216
226
|
}
|
|
@@ -568,10 +578,16 @@ export class CoVideo {
|
|
|
568
578
|
// LIFECYCLE
|
|
569
579
|
// ═══════════════════════════════════════════════════
|
|
570
580
|
componentWillLoad() {
|
|
581
|
+
var _a, _b;
|
|
571
582
|
this.parseRates();
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
this.
|
|
583
|
+
// Los `?? default` no son paranoia: bajo el transform de @stencil/vitest
|
|
584
|
+
// los defaults de class-field (y por tanto de @Prop) no están aplicados
|
|
585
|
+
// todavía acá, así que `this.volume` llega undefined → NaN → jsdom tira
|
|
586
|
+
// al asignar `videoEl.volume` en componentDidLoad y ABORTA el resto del
|
|
587
|
+
// hook (bind de eventos ya hecho, pero autoplay y seeds no).
|
|
588
|
+
this.volumeLevel = Math.max(0, Math.min(1, (_a = this.volume) !== null && _a !== void 0 ? _a : 1));
|
|
589
|
+
this.isMuted = (_b = this.muted) !== null && _b !== void 0 ? _b : false;
|
|
590
|
+
this.internalPlaybackRate = this.playbackRate || 1;
|
|
575
591
|
}
|
|
576
592
|
componentDidLoad() {
|
|
577
593
|
if (this.videoEl) {
|
|
@@ -579,6 +595,15 @@ export class CoVideo {
|
|
|
579
595
|
this.videoEl.volume = this.volumeLevel;
|
|
580
596
|
this.videoEl.muted = this.isMuted;
|
|
581
597
|
this.videoEl.playbackRate = this.internalPlaybackRate;
|
|
598
|
+
// Metadata (and even `canplay`) can land BEFORE these listeners bind —
|
|
599
|
+
// a cached or local file resolves inside the same task the vdom created
|
|
600
|
+
// the <video> in. The events that would have set duration / cleared the
|
|
601
|
+
// loader are already gone by now, so the player would sit forever on
|
|
602
|
+
// "0:00" with a dead seek bar. Seed from the element's own state.
|
|
603
|
+
if (this.videoEl.readyState >= 1)
|
|
604
|
+
this.onLoadedMetadata();
|
|
605
|
+
if (this.videoEl.readyState >= 3)
|
|
606
|
+
this.onCanPlay();
|
|
582
607
|
if (this.autoplay && this.muted) {
|
|
583
608
|
this.videoEl.play().catch(() => { });
|
|
584
609
|
}
|
|
@@ -789,14 +814,14 @@ export class CoVideo {
|
|
|
789
814
|
// ═══════════════════════════════════════════════════
|
|
790
815
|
render() {
|
|
791
816
|
const aspectClass = `co-video--${this.aspectRatio.replace(':', '-')}`;
|
|
792
|
-
return (h(Host, { key: '
|
|
817
|
+
return (h(Host, { key: '57e64ad600356a7243a63db39a54ee20e45b3f81' }, h("div", { key: '4f76f20be1f9c0d6994c58fc41fc5a9cda08de20', class: {
|
|
793
818
|
'co-video': true,
|
|
794
819
|
[aspectClass]: true,
|
|
795
820
|
[`co-video--rounded-${this.rounded}`]: true,
|
|
796
821
|
'co-video--disabled': this.disabled,
|
|
797
822
|
'co-video--fullscreen': this.isFullscreen,
|
|
798
823
|
'co-video--playing': this.isPlaying,
|
|
799
|
-
}, part: "container", ref: el => (this.containerEl = el), role: "region", "aria-label": this.t.player, tabindex: 0, onKeyDown: this.handleKeyDown, onMouseMove: this.handleContainerMouseMove, onMouseLeave: this.handleContainerMouseLeave, onTouchStart: this.handleContainerTouchStart }, h("video", { key: '
|
|
824
|
+
}, part: "container", ref: el => (this.containerEl = el), role: "region", "aria-label": this.t.player, tabindex: 0, onKeyDown: this.handleKeyDown, onMouseMove: this.handleContainerMouseMove, onMouseLeave: this.handleContainerMouseLeave, onTouchStart: this.handleContainerTouchStart }, h("video", { key: '518abe8e649c46e5478f4f2d8b37f827fb1559c0', ref: el => (this.videoEl = el), class: "co-video__native", part: "video", src: this.src || undefined, poster: undefined, preload: this.preload, loop: this.loop, playsinline: true, tabindex: -1, controlsList: this.allowDownload ? undefined : 'nodownload' }), this.renderPoster(), this.renderLoader(), this.renderBigPlayButton(), this.renderError(), h("div", { key: '368f4a7857a0def28ebfe830fff8c38280c35900', class: "co-video__click-area", onClick: this.handleVideoAreaClick }), this.renderControls())));
|
|
800
825
|
}
|
|
801
826
|
static get is() { return "co-video"; }
|
|
802
827
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1455,11 +1480,11 @@ export class CoVideo {
|
|
|
1455
1480
|
"composed": true,
|
|
1456
1481
|
"docs": {
|
|
1457
1482
|
"tags": [],
|
|
1458
|
-
"text": ""
|
|
1483
|
+
"text": "Metadata lista. Incluye el tama\u00F1o INTR\u00CDNSECO del medio para que el host\npueda ajustar su caja al frame (0 \u00D7 0 si el navegador a\u00FAn no lo sabe)."
|
|
1459
1484
|
},
|
|
1460
1485
|
"complexType": {
|
|
1461
|
-
"original": "{ duration: number }",
|
|
1462
|
-
"resolved": "{ duration: number; }",
|
|
1486
|
+
"original": "{ duration: number; width: number; height: number }",
|
|
1487
|
+
"resolved": "{ duration: number; width: number; height: number; }",
|
|
1463
1488
|
"references": {}
|
|
1464
1489
|
}
|
|
1465
1490
|
}, {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Texto de montos para co-number-field `format="amount"`.
|
|
3
|
+
*
|
|
4
|
+
* El campo pinta coma = miles y punto = decimal (formato de la app). El texto
|
|
5
|
+
* PEGADO, en cambio, viene con el formato de DONDE se copió: es-CO usa el punto
|
|
6
|
+
* para miles (`121.123,20`), en-US al revés (`121,123.20`). Los dos separadores
|
|
7
|
+
* intercambian rol según el locale, así que no alcanza con borrar lo que no sea
|
|
8
|
+
* dígito: hay que decidir CUÁL es el decimal antes de descartar el otro.
|
|
9
|
+
* Puerto del util probado de V1 (shared-components `utils/numericInput.js`).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Topes de longitud: pegar una COLUMNA entera de Excel concatena todos los
|
|
13
|
+
* dígitos en un solo número — sin tope, cada tecla siguiente re-formatea un
|
|
14
|
+
* string gigante (y la agrupación de miles se vuelve costosa) y parseFloat
|
|
15
|
+
* termina en Infinity. 15 enteros = rango seguro de Number; 8 decimales =
|
|
16
|
+
* paridad con el numeral de V1 (`$ 0,0.[00000000]`).
|
|
17
|
+
*/
|
|
18
|
+
const MAX_INTEGER_DIGITS = 15;
|
|
19
|
+
const MAX_DECIMAL_DIGITS = 8;
|
|
20
|
+
const capDigits = (integer, decimals) => ({
|
|
21
|
+
integer: integer.slice(0, MAX_INTEGER_DIGITS),
|
|
22
|
+
decimals: decimals.slice(0, MAX_DECIMAL_DIGITS),
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Interpreta un número pegado sin saber de qué locale viene.
|
|
26
|
+
*
|
|
27
|
+
* Reglas, en orden:
|
|
28
|
+
* 1. Con AMBOS separadores, el ÚLTIMO es el decimal (`121.123,20` → `121123.20`).
|
|
29
|
+
* 2. Separador repetido = miles (`123.123.123` → `123123123`).
|
|
30
|
+
* 3. Uno solo: grupo de exactamente 3 dígitos detrás = miles (`34,640` → `34640`,
|
|
31
|
+
* como formatea la propia app); cualquier otra cantidad = decimal (`121,20`).
|
|
32
|
+
*
|
|
33
|
+
* Devuelve el número crudo listo para `parseFloat` ('' si no hay dígitos).
|
|
34
|
+
*/
|
|
35
|
+
export function parseNumericText(text) {
|
|
36
|
+
const cleaned = String(text !== null && text !== void 0 ? text : '').replace(/[^\d.,]/g, '');
|
|
37
|
+
if (!cleaned)
|
|
38
|
+
return '';
|
|
39
|
+
const lastDot = cleaned.lastIndexOf('.');
|
|
40
|
+
const lastComma = cleaned.lastIndexOf(',');
|
|
41
|
+
let decimalIndex = -1;
|
|
42
|
+
if (lastDot >= 0 && lastComma >= 0) {
|
|
43
|
+
decimalIndex = Math.max(lastDot, lastComma);
|
|
44
|
+
}
|
|
45
|
+
else if (lastDot >= 0 || lastComma >= 0) {
|
|
46
|
+
const separator = lastDot >= 0 ? '.' : ',';
|
|
47
|
+
const groups = cleaned.split(separator);
|
|
48
|
+
if (groups.length === 2 && groups[1].length !== 3)
|
|
49
|
+
decimalIndex = cleaned.lastIndexOf(separator);
|
|
50
|
+
}
|
|
51
|
+
const { integer, decimals } = capDigits((decimalIndex >= 0 ? cleaned.slice(0, decimalIndex) : cleaned).replace(/[.,]/g, ''), decimalIndex >= 0 ? cleaned.slice(decimalIndex + 1).replace(/[.,]/g, '') : '');
|
|
52
|
+
if (!integer && !decimals)
|
|
53
|
+
return '';
|
|
54
|
+
return decimals ? `${integer || '0'}.${decimals}` : integer;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Deja texto que YA está en el formato del campo (coma = miles, punto = decimal)
|
|
58
|
+
* como número crudo: dígitos y un único punto, con signo sólo si se permite.
|
|
59
|
+
* Un "-" solo se conserva como estado transitorio de tipeo (parseFloat da NaN
|
|
60
|
+
* y el caller no emite).
|
|
61
|
+
*/
|
|
62
|
+
export function stripAmountText(text, allowNegative = false) {
|
|
63
|
+
const source = String(text !== null && text !== void 0 ? text : '');
|
|
64
|
+
const negative = allowNegative && /^\s*-/.test(source);
|
|
65
|
+
const cleaned = source.replace(/[^\d.]/g, '');
|
|
66
|
+
const [rawInteger, ...rawDecimals] = cleaned.split('.');
|
|
67
|
+
const { integer, decimals } = capDigits(rawInteger, rawDecimals.join(''));
|
|
68
|
+
const raw = rawDecimals.length ? `${integer}.${decimals}` : integer;
|
|
69
|
+
if (!raw)
|
|
70
|
+
return negative ? '-' : '';
|
|
71
|
+
return negative ? `-${raw}` : raw;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Agrupa la parte ENTERA de un número crudo con comas de miles, sin tocar los
|
|
75
|
+
* decimales ni un punto colgante a medio tipear (`1234.` → `1,234.`).
|
|
76
|
+
*/
|
|
77
|
+
export function formatAmountText(raw) {
|
|
78
|
+
if (!raw)
|
|
79
|
+
return '';
|
|
80
|
+
const negative = raw.startsWith('-');
|
|
81
|
+
const body = negative ? raw.slice(1) : raw;
|
|
82
|
+
const dotIndex = body.indexOf('.');
|
|
83
|
+
const integer = dotIndex >= 0 ? body.slice(0, dotIndex) : body;
|
|
84
|
+
const rest = dotIndex >= 0 ? body.slice(dotIndex) : '';
|
|
85
|
+
// Recorrido O(n): el idiom con lookahead (`/\B(?=(\d{3})+(?!\d))/g`) es
|
|
86
|
+
// CUADRÁTICO en la cantidad de dígitos — inofensivo para un número, letal
|
|
87
|
+
// dentro de un handler de input (medido: 12k dígitos ≈ 81ms por tecla en M4).
|
|
88
|
+
let grouped = '';
|
|
89
|
+
for (let i = 0; i < integer.length; i++) {
|
|
90
|
+
if (i > 0 && (integer.length - i) % 3 === 0)
|
|
91
|
+
grouped += ',';
|
|
92
|
+
grouped += integer[i];
|
|
93
|
+
}
|
|
94
|
+
return `${negative ? '-' : ''}${grouped}${rest}`;
|
|
95
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared color utilities for Cobalt components.
|
|
3
|
-
* WCAG sRGB relative luminance for contrast detection.
|
|
3
|
+
* WCAG sRGB relative luminance for contrast detection + conversión HSV para el picker.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/** Antes privada: la necesita el picker, no sólo `luminance`. */
|
|
6
|
+
export function parseHex(hex) {
|
|
6
7
|
if (!hex || typeof hex !== 'string')
|
|
7
8
|
return null;
|
|
8
|
-
const h = hex.replace('#', '');
|
|
9
|
+
const h = hex.trim().replace('#', '');
|
|
10
|
+
if (!/^[0-9a-f]+$/i.test(h))
|
|
11
|
+
return null;
|
|
9
12
|
if (h.length === 3) {
|
|
10
13
|
return { r: parseInt(h[0] + h[0], 16), g: parseInt(h[1] + h[1], 16), b: parseInt(h[2] + h[2], 16) };
|
|
11
14
|
}
|
|
@@ -14,6 +17,109 @@ function parseHex(hex) {
|
|
|
14
17
|
}
|
|
15
18
|
return null;
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Clampea a 0–255 y redondea. Un canal no finito cuenta como 0: sin eso,
|
|
22
|
+
* `NaN.toString(16)` es `'nan'` y salía `'#NAN0000'` — un string truthy que NO es
|
|
23
|
+
* hex y que el consumidor guarda en el modelo sin enterarse.
|
|
24
|
+
*/
|
|
25
|
+
export function rgbToHex(r, g, b) {
|
|
26
|
+
const to2 = (n) => Math.max(0, Math.min(255, Math.round(Number.isFinite(n) ? n : 0)))
|
|
27
|
+
.toString(16)
|
|
28
|
+
.padStart(2, '0')
|
|
29
|
+
.toUpperCase();
|
|
30
|
+
return `#${to2(r)}${to2(g)}${to2(b)}`;
|
|
31
|
+
}
|
|
32
|
+
export function hexToHsv(hex) {
|
|
33
|
+
const c = parseHex(hex);
|
|
34
|
+
if (!c)
|
|
35
|
+
return null;
|
|
36
|
+
const r = c.r / 255, g = c.g / 255, b = c.b / 255;
|
|
37
|
+
const max = Math.max(r, g, b);
|
|
38
|
+
const min = Math.min(r, g, b);
|
|
39
|
+
const d = max - min;
|
|
40
|
+
let h = 0;
|
|
41
|
+
if (d !== 0) {
|
|
42
|
+
if (max === r)
|
|
43
|
+
h = ((g - b) / d) % 6;
|
|
44
|
+
else if (max === g)
|
|
45
|
+
h = (b - r) / d + 2;
|
|
46
|
+
else
|
|
47
|
+
h = (r - g) / d + 4;
|
|
48
|
+
h *= 60;
|
|
49
|
+
if (h < 0)
|
|
50
|
+
h += 360;
|
|
51
|
+
}
|
|
52
|
+
return { h, s: max === 0 ? 0 : (d / max) * 100, v: max * 100 };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* TOTAL por contrato: siempre devuelve un `#RRGGBB` válido, con cualquier entrada
|
|
56
|
+
* numérica. Un canal no finito (NaN / ±Infinity) entra como 0.
|
|
57
|
+
* ⚠️ No es paranoia: el arrastre saca el ángulo de `(clientX - rect.left) / rect.width`,
|
|
58
|
+
* y un panel medido antes del layout (o con `display:none`) da `rect.width === 0`
|
|
59
|
+
* → NaN/Infinity. Sin este saneo, `table[Math.floor(NaN) % 6]` es `undefined` y el
|
|
60
|
+
* destructuring TIRA `TypeError` en pleno drag; con `s`/`v` no finitos salía el
|
|
61
|
+
* string `'#NANNANNAN'`, que es peor porque es truthy y se guarda en el modelo.
|
|
62
|
+
*/
|
|
63
|
+
export function hsvToHex({ h, s, v }) {
|
|
64
|
+
const finite = (n) => (Number.isFinite(n) ? n : 0);
|
|
65
|
+
const hh = ((finite(h) % 360) + 360) % 360;
|
|
66
|
+
const S = finite(s) / 100, V = finite(v) / 100;
|
|
67
|
+
const c = V * S;
|
|
68
|
+
const x = c * (1 - Math.abs(((hh / 60) % 2) - 1));
|
|
69
|
+
const m = V - c;
|
|
70
|
+
const seg = Math.floor(hh / 60);
|
|
71
|
+
const table = [
|
|
72
|
+
[c, x, 0],
|
|
73
|
+
[x, c, 0],
|
|
74
|
+
[0, c, x],
|
|
75
|
+
[0, x, c],
|
|
76
|
+
[x, 0, c],
|
|
77
|
+
[c, 0, x],
|
|
78
|
+
];
|
|
79
|
+
const [r, g, b] = table[seg % 6];
|
|
80
|
+
return rgbToHex((r + m) * 255, (g + m) * 255, (b + m) * 255);
|
|
81
|
+
}
|
|
82
|
+
/** 3 o 6 dígitos, con o sin `#`. 8 dígitos NO: este picker no maneja alpha. */
|
|
83
|
+
export function isValidHex(v) {
|
|
84
|
+
return /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test((v || '').trim());
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Normaliza lo que se pega desde otra herramienta. Cubre hex, `rgb()/rgba()` y
|
|
88
|
+
* `hsl()/hsla()`. NO cubre nombres CSS (`rebeccapurple`): necesitarían una tabla
|
|
89
|
+
* de 148 entradas o un elemento de medición, y este módulo corre en el proyecto
|
|
90
|
+
* de tests de Node, sin DOM.
|
|
91
|
+
*/
|
|
92
|
+
export function parseCssColor(input) {
|
|
93
|
+
const s = (input || '').trim();
|
|
94
|
+
if (!s)
|
|
95
|
+
return null;
|
|
96
|
+
if (isValidHex(s)) {
|
|
97
|
+
const c = parseHex(s);
|
|
98
|
+
return rgbToHex(c.r, c.g, c.b);
|
|
99
|
+
}
|
|
100
|
+
// Los grupos del regex admiten formas que `+` convierte a NaN ('1.2.3', '-', '--5').
|
|
101
|
+
// Se RECHAZAN (null), no se clampean: ante un pegado corrupto, devolver rojo o negro
|
|
102
|
+
// sería una mentira, y `null` ya es parte del contrato. Esto NO toca el clamp de lo
|
|
103
|
+
// bien formado pero fuera de rango — `rgb(300, 300, 300)` sigue dando '#FFFFFF'.
|
|
104
|
+
const rgb = s.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+[\d.%]+)?\s*\)$/i);
|
|
105
|
+
if (rgb) {
|
|
106
|
+
const [r, g, b] = [+rgb[1], +rgb[2], +rgb[3]];
|
|
107
|
+
if (![r, g, b].every(Number.isFinite))
|
|
108
|
+
return null;
|
|
109
|
+
return rgbToHex(r, g, b);
|
|
110
|
+
}
|
|
111
|
+
const hsl = s.match(/^hsla?\(\s*([\d.-]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%(?:[\s,/]+[\d.%]+)?\s*\)$/i);
|
|
112
|
+
if (hsl) {
|
|
113
|
+
const H = +hsl[1], L = +hsl[3] / 100, Sl = +hsl[2] / 100;
|
|
114
|
+
if (![H, L, Sl].every(Number.isFinite))
|
|
115
|
+
return null;
|
|
116
|
+
// HSL → HSV, y de ahí al hex por el mismo camino que todo lo demás.
|
|
117
|
+
const v = L + Sl * Math.min(L, 1 - L);
|
|
118
|
+
const sv = v === 0 ? 0 : 2 * (1 - L / v);
|
|
119
|
+
return hsvToHex({ h: H, s: sv * 100, v: v * 100 });
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
17
123
|
/** WCAG sRGB relative luminance (0–1). */
|
|
18
124
|
export function luminance(hex) {
|
|
19
125
|
const c = parseHex(hex);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Textos de co-color-picker. Mismo patrón que fileI18n/dateI18n: el componente
|
|
3
|
+
* shipea es/en/pt keyado por la prop `locale`. Defaults en INGLÉS — un literal
|
|
4
|
+
* en español dentro de un co-* deja al host sin forma de traducirlo.
|
|
5
|
+
* Las plantillas usan `{n}` y se resuelven con `fillTemplate` de fileI18n
|
|
6
|
+
* (que ya existe exportado ahí: se reutiliza, no se duplica).
|
|
7
|
+
*/
|
|
8
|
+
import { langFromLocale } from "./fileI18n";
|
|
9
|
+
const DICT = {
|
|
10
|
+
en: {
|
|
11
|
+
swatches: 'Color presets',
|
|
12
|
+
groupNeutrals: 'Neutrals', groupBrand: 'Brand colors',
|
|
13
|
+
area: 'Saturation and brightness',
|
|
14
|
+
hue: 'Hue', hueValue: '{n} degrees',
|
|
15
|
+
saturation: 'Saturation', satValue: 'Saturation {n}%',
|
|
16
|
+
brightness: 'Brightness', briValue: 'Brightness {n}%',
|
|
17
|
+
area2D: '2D slider',
|
|
18
|
+
hexField: 'Hex code',
|
|
19
|
+
eyedropper: 'Pick a color from the screen',
|
|
20
|
+
copy: 'Copy',
|
|
21
|
+
},
|
|
22
|
+
es: {
|
|
23
|
+
swatches: 'Colores predefinidos',
|
|
24
|
+
groupNeutrals: 'Neutros', groupBrand: 'Colores de marca',
|
|
25
|
+
area: 'Saturación y brillo',
|
|
26
|
+
hue: 'Matiz', hueValue: '{n} grados',
|
|
27
|
+
saturation: 'Saturación', satValue: 'Saturación {n} %',
|
|
28
|
+
brightness: 'Brillo', briValue: 'Brillo {n} %',
|
|
29
|
+
area2D: 'Control 2D',
|
|
30
|
+
hexField: 'Código hexadecimal',
|
|
31
|
+
eyedropper: 'Elegir un color de la pantalla',
|
|
32
|
+
copy: 'Copiar',
|
|
33
|
+
},
|
|
34
|
+
pt: {
|
|
35
|
+
swatches: 'Cores predefinidas',
|
|
36
|
+
groupNeutrals: 'Neutros', groupBrand: 'Cores da marca',
|
|
37
|
+
area: 'Saturação e brilho',
|
|
38
|
+
hue: 'Matiz', hueValue: '{n} graus',
|
|
39
|
+
saturation: 'Saturação', satValue: 'Saturação {n} %',
|
|
40
|
+
brightness: 'Brilho', briValue: 'Brilho {n} %',
|
|
41
|
+
area2D: 'Controle 2D',
|
|
42
|
+
hexField: 'Código hexadecimal',
|
|
43
|
+
eyedropper: 'Escolher uma cor da tela',
|
|
44
|
+
copy: 'Copiar',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Resuelve los textos para un locale BCP-47. La resolución del idioma se
|
|
49
|
+
* reutiliza de `fileI18n` (mismo fallback a 'en'): tener dos implementaciones
|
|
50
|
+
* del mismo mapeo es exactamente la duplicación que el Step 0 vino a evitar
|
|
51
|
+
* cuando exigió reutilizar `fillTemplate` de ese archivo.
|
|
52
|
+
*/
|
|
53
|
+
export function getColorPickerStrings(locale) {
|
|
54
|
+
return DICT[langFromLocale(locale)];
|
|
55
|
+
}
|
|
@@ -39,6 +39,18 @@ const DICT = {
|
|
|
39
39
|
selectDateTime: 'Seleccionar fecha y hora',
|
|
40
40
|
setDateTime: 'Establecer fecha y hora',
|
|
41
41
|
clearDateTime: 'Limpiar fecha y hora',
|
|
42
|
+
shortcuts: 'Atajos',
|
|
43
|
+
timeExact: 'Hora exacta',
|
|
44
|
+
done: 'Listo',
|
|
45
|
+
morning: 'Mañana',
|
|
46
|
+
noon: 'Mediodía',
|
|
47
|
+
afternoon: 'Tarde',
|
|
48
|
+
endOfDay: 'Fin del día',
|
|
49
|
+
now: 'Ahora',
|
|
50
|
+
hourLabel: 'Hora',
|
|
51
|
+
minuteLabel: 'Minuto',
|
|
52
|
+
dayPeriodLabel: 'a. m./p. m.',
|
|
53
|
+
timeFieldLabel: 'Hora exacta',
|
|
42
54
|
},
|
|
43
55
|
en: {
|
|
44
56
|
prevMonth: 'Previous month',
|
|
@@ -71,6 +83,18 @@ const DICT = {
|
|
|
71
83
|
selectDateTime: 'Select date and time',
|
|
72
84
|
setDateTime: 'Set date and time',
|
|
73
85
|
clearDateTime: 'Clear date and time',
|
|
86
|
+
shortcuts: 'Shortcuts',
|
|
87
|
+
timeExact: 'Exact time',
|
|
88
|
+
done: 'Done',
|
|
89
|
+
morning: 'Morning',
|
|
90
|
+
noon: 'Noon',
|
|
91
|
+
afternoon: 'Afternoon',
|
|
92
|
+
endOfDay: 'End of day',
|
|
93
|
+
now: 'Now',
|
|
94
|
+
hourLabel: 'Hour',
|
|
95
|
+
minuteLabel: 'Minute',
|
|
96
|
+
dayPeriodLabel: 'AM/PM',
|
|
97
|
+
timeFieldLabel: 'Exact time',
|
|
74
98
|
},
|
|
75
99
|
pt: {
|
|
76
100
|
prevMonth: 'Mês anterior',
|
|
@@ -103,6 +127,18 @@ const DICT = {
|
|
|
103
127
|
selectDateTime: 'Selecionar data e hora',
|
|
104
128
|
setDateTime: 'Definir data e hora',
|
|
105
129
|
clearDateTime: 'Limpar data e hora',
|
|
130
|
+
shortcuts: 'Atalhos',
|
|
131
|
+
timeExact: 'Hora exata',
|
|
132
|
+
done: 'Pronto',
|
|
133
|
+
morning: 'Manhã',
|
|
134
|
+
noon: 'Meio-dia',
|
|
135
|
+
afternoon: 'Tarde',
|
|
136
|
+
endOfDay: 'Fim do dia',
|
|
137
|
+
now: 'Agora',
|
|
138
|
+
hourLabel: 'Hora',
|
|
139
|
+
minuteLabel: 'Minuto',
|
|
140
|
+
dayPeriodLabel: 'AM/PM',
|
|
141
|
+
timeFieldLabel: 'Hora exata',
|
|
106
142
|
},
|
|
107
143
|
};
|
|
108
144
|
/** Map any BCP-47 locale (e.g. "es-CO") to a supported language; fallback 'en'. */
|