@prolibu-suite/cobalt-core 0.9.5 → 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 +18 -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-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-8b4b3589.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-BZIB4JDs.js +0 -1
- package/dist/components/p-Bbny3WUc.js +0 -1
- package/dist/components/p-C1Kv3zYZ.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-DP0bbhfN.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-gI62K3Be.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
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { RequiredMark } from "../../utils/requiredMark";
|
|
3
|
+
import { formatAmountText, parseNumericText, stripAmountText } from "../../utils/amountText";
|
|
4
|
+
/**
|
|
5
|
+
* Todo lo que NO puede formar parte de un número escrito a mano. El input es
|
|
6
|
+
* `type="text"` a propósito (hace falta para pintar el valor formateado y el
|
|
7
|
+
* sufijo), y eso lo deja aceptar letras: sin este filtro, tipear "asd10" deja
|
|
8
|
+
* "asd10" A LA VISTA hasta que el blur repinta el valor canónico.
|
|
9
|
+
* No valida el número final —de eso se encargan `clamp()` y el repintado del
|
|
10
|
+
* blur—, solo impide que el campo muestre algo que no es un número.
|
|
11
|
+
*/
|
|
12
|
+
const NON_NUMERIC = /[^0-9.,-]/g;
|
|
13
|
+
/** Caracteres que CUENTAN para el caret en modo amount (la coma es decorado). */
|
|
14
|
+
const SIGNIFICANT = /[0-9.-]/;
|
|
15
|
+
const countSignificant = (text) => {
|
|
16
|
+
let count = 0;
|
|
17
|
+
for (const char of text)
|
|
18
|
+
if (SIGNIFICANT.test(char))
|
|
19
|
+
count++;
|
|
20
|
+
return count;
|
|
21
|
+
};
|
|
22
|
+
/** Posición del caret justo después de `count` caracteres significativos. */
|
|
23
|
+
const caretAfterSignificant = (text, count) => {
|
|
24
|
+
if (count <= 0)
|
|
25
|
+
return 0;
|
|
26
|
+
let seen = 0;
|
|
27
|
+
for (let i = 0; i < text.length; i++) {
|
|
28
|
+
if (SIGNIFICANT.test(text[i])) {
|
|
29
|
+
seen++;
|
|
30
|
+
if (seen === count)
|
|
31
|
+
return i + 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return text.length;
|
|
35
|
+
};
|
|
3
36
|
export class CoNumberField {
|
|
4
37
|
constructor() {
|
|
5
38
|
/** Whether the field is required (renders a required marker on the label). */
|
|
@@ -14,19 +47,46 @@ export class CoNumberField {
|
|
|
14
47
|
this.size = 'md';
|
|
15
48
|
/** Show clear button when the field has a value */
|
|
16
49
|
this.clearable = false;
|
|
50
|
+
/**
|
|
51
|
+
* Oculta los botones ± (campo numérico "plano": precio, tasa). Las flechas
|
|
52
|
+
* ↑↓ siguen escalonando. Reflejado para que el CSS del host lo lea.
|
|
53
|
+
*/
|
|
54
|
+
this.hideControls = false;
|
|
17
55
|
this.focused = false;
|
|
56
|
+
// Stepping/clear son mutaciones PROGRAMÁTICAS: con el campo enfocado ni el
|
|
57
|
+
// @Watch (guard `focused`) ni el vdom (que copia el texto vivo) repintan, así
|
|
58
|
+
// que cada path escribe el input él mismo — si no, ArrowUp emite y persiste
|
|
59
|
+
// valores que el usuario no ve hasta el blur.
|
|
18
60
|
this.handleDecrement = () => {
|
|
19
61
|
if (!this.canDecrement)
|
|
20
62
|
return;
|
|
21
63
|
this.emitValue(this.current - this.step);
|
|
64
|
+
this.syncInputText();
|
|
22
65
|
};
|
|
23
66
|
this.handleIncrement = () => {
|
|
24
67
|
if (!this.canIncrement)
|
|
25
68
|
return;
|
|
26
69
|
this.emitValue(this.current + this.step);
|
|
70
|
+
this.syncInputText();
|
|
27
71
|
};
|
|
28
72
|
this.handleInput = (e) => {
|
|
29
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
const input = e.target;
|
|
75
|
+
if (this.isAmount) {
|
|
76
|
+
this.handleAmountInput(input);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
let raw = input.value;
|
|
80
|
+
// Descarta los caracteres imposibles al tipearlos y al pegar, conservando
|
|
81
|
+
// la posición del cursor (reescribir `value` la mandaría al final).
|
|
82
|
+
const cleaned = raw.replace(NON_NUMERIC, '');
|
|
83
|
+
if (cleaned !== raw) {
|
|
84
|
+
const caret = ((_a = input.selectionStart) !== null && _a !== void 0 ? _a : raw.length) - (raw.length - cleaned.length);
|
|
85
|
+
input.value = cleaned;
|
|
86
|
+
const next = caret < 0 ? 0 : caret;
|
|
87
|
+
input.setSelectionRange(next, next);
|
|
88
|
+
raw = cleaned;
|
|
89
|
+
}
|
|
30
90
|
if (raw === '') {
|
|
31
91
|
// Deleting all content clears the field (parity with the clear button),
|
|
32
92
|
// but only when clearing is enabled — otherwise keep prior behavior.
|
|
@@ -43,9 +103,50 @@ export class CoNumberField {
|
|
|
43
103
|
this.emitValue(this.fromDisplay(num));
|
|
44
104
|
}
|
|
45
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* Pegar en modo amount: el texto llega con el formato de DONDE se copió
|
|
108
|
+
* (es-CO `1.234,56`, en-US `1,234.56`, la app `$ 34,640.00`), así que se
|
|
109
|
+
* interpreta con la heurística de separadores ANTES de empalmarlo con lo que
|
|
110
|
+
* ya había en el campo. Sin el preventDefault, el navegador escribiría el
|
|
111
|
+
* texto crudo y `parseFloat` cortaría en la primera coma (commit silencioso
|
|
112
|
+
* de 1 al pegar "1,234.56").
|
|
113
|
+
*/
|
|
114
|
+
this.handlePaste = (e) => {
|
|
115
|
+
var _a, _b, _c, _d;
|
|
116
|
+
if (!this.isAmount)
|
|
117
|
+
return;
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
const input = e.target;
|
|
120
|
+
const text = (_b = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) !== null && _b !== void 0 ? _b : '';
|
|
121
|
+
let parsed = parseNumericText(text);
|
|
122
|
+
if (parsed && this.allowNegative && /^\s*-/.test(text))
|
|
123
|
+
parsed = `-${parsed}`;
|
|
124
|
+
const start = (_c = input.selectionStart) !== null && _c !== void 0 ? _c : input.value.length;
|
|
125
|
+
const end = (_d = input.selectionEnd) !== null && _d !== void 0 ? _d : start;
|
|
126
|
+
const before = stripAmountText(input.value.slice(0, start), this.allowNegative);
|
|
127
|
+
const after = stripAmountText(input.value.slice(end));
|
|
128
|
+
const spliced = stripAmountText(before + parsed + after, this.allowNegative);
|
|
129
|
+
const formatted = formatAmountText(spliced);
|
|
130
|
+
input.value = formatted;
|
|
131
|
+
const caret = caretAfterSignificant(formatted, countSignificant(before + parsed));
|
|
132
|
+
input.setSelectionRange(caret, caret);
|
|
133
|
+
if (spliced === '' || spliced === '-') {
|
|
134
|
+
if (spliced === '' && this.clearable) {
|
|
135
|
+
this.value = null;
|
|
136
|
+
this.coChange.emit(null);
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const num = parseFloat(spliced);
|
|
141
|
+
if (!isNaN(num))
|
|
142
|
+
this.emitValue(num);
|
|
143
|
+
};
|
|
46
144
|
this.handleClear = () => {
|
|
47
145
|
var _a;
|
|
48
146
|
this.value = null;
|
|
147
|
+
// En Safari el click NO roba el foco al botón → `focused` sigue true y sin
|
|
148
|
+
// esto el texto viejo quedaba pintado con el valor ya emitido en null.
|
|
149
|
+
this.syncInputText();
|
|
49
150
|
this.coClear.emit();
|
|
50
151
|
this.coChange.emit(null);
|
|
51
152
|
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -55,6 +156,10 @@ export class CoNumberField {
|
|
|
55
156
|
// Re-clamp on blur, but keep an empty field empty.
|
|
56
157
|
if (!this.isEmpty)
|
|
57
158
|
this.emitValue(this.value);
|
|
159
|
+
// Repinta el texto canónico: si el clamp devolvió el MISMO valor que ya
|
|
160
|
+
// tenía el prop (tipear "-20" sobre 0 con min 0), el @Watch no dispara y el
|
|
161
|
+
// input se quedaba con lo tipeado.
|
|
162
|
+
this.syncInputText();
|
|
58
163
|
};
|
|
59
164
|
this.handleFocus = () => {
|
|
60
165
|
this.focused = true;
|
|
@@ -81,9 +186,8 @@ export class CoNumberField {
|
|
|
81
186
|
onValueChange() {
|
|
82
187
|
if (!this.inputEl || this.focused)
|
|
83
188
|
return;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.inputEl.value = next;
|
|
189
|
+
if (this.inputEl.value !== this.displayValue)
|
|
190
|
+
this.inputEl.value = this.displayValue;
|
|
87
191
|
}
|
|
88
192
|
/** True when there is no numeric value (cleared / empty). */
|
|
89
193
|
get isEmpty() {
|
|
@@ -125,6 +229,21 @@ export class CoNumberField {
|
|
|
125
229
|
get scaled() {
|
|
126
230
|
return this.format === 'rate' || this.format === 'percent';
|
|
127
231
|
}
|
|
232
|
+
/** Whether the live money mask (thousands separators, paste parsing) is on. */
|
|
233
|
+
get isAmount() {
|
|
234
|
+
return this.format === 'amount';
|
|
235
|
+
}
|
|
236
|
+
/** El signo entra sólo cuando el rango lo admite (sin `min`, o `min` < 0). */
|
|
237
|
+
get allowNegative() {
|
|
238
|
+
return this.min === undefined || this.min < 0;
|
|
239
|
+
}
|
|
240
|
+
/** Texto canónico del input para el valor actual (formateado en amount). */
|
|
241
|
+
get displayValue() {
|
|
242
|
+
if (this.isEmpty)
|
|
243
|
+
return '';
|
|
244
|
+
const plain = String(this.toDisplay(this.value));
|
|
245
|
+
return this.isAmount ? formatAmountText(plain) : plain;
|
|
246
|
+
}
|
|
128
247
|
/** Stored decimal → shown number (0.15 → 15). toFixed avoids FP artifacts. */
|
|
129
248
|
toDisplay(v) {
|
|
130
249
|
return this.scaled ? Number((v * 100).toFixed(6)) : v;
|
|
@@ -138,14 +257,63 @@ export class CoNumberField {
|
|
|
138
257
|
this.value = clamped;
|
|
139
258
|
this.coChange.emit(clamped);
|
|
140
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Modo amount: en cada input se rearma el display desde los dígitos (miles
|
|
262
|
+
* con coma, coma tipeada descartada, sólo un punto) y el caret se restituye
|
|
263
|
+
* contando caracteres significativos — reescribir `value` lo mandaría al
|
|
264
|
+
* final. El punto colgante ("1,234.") sobrevive porque se reformatea el
|
|
265
|
+
* TEXTO, no el número parseado.
|
|
266
|
+
*/
|
|
267
|
+
handleAmountInput(input) {
|
|
268
|
+
var _a;
|
|
269
|
+
const raw = input.value;
|
|
270
|
+
const caret = (_a = input.selectionStart) !== null && _a !== void 0 ? _a : raw.length;
|
|
271
|
+
const significantBefore = countSignificant(raw.slice(0, caret));
|
|
272
|
+
const cleaned = stripAmountText(raw, this.allowNegative);
|
|
273
|
+
const formatted = formatAmountText(cleaned);
|
|
274
|
+
if (input.value !== formatted) {
|
|
275
|
+
input.value = formatted;
|
|
276
|
+
const next = caretAfterSignificant(formatted, significantBefore);
|
|
277
|
+
input.setSelectionRange(next, next);
|
|
278
|
+
}
|
|
279
|
+
if (cleaned === '') {
|
|
280
|
+
if (this.clearable) {
|
|
281
|
+
this.value = null;
|
|
282
|
+
this.coChange.emit(null);
|
|
283
|
+
}
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (cleaned === '-')
|
|
287
|
+
return;
|
|
288
|
+
const num = parseFloat(cleaned);
|
|
289
|
+
if (!isNaN(num))
|
|
290
|
+
this.emitValue(num);
|
|
291
|
+
}
|
|
292
|
+
syncInputText() {
|
|
293
|
+
if (!this.inputEl)
|
|
294
|
+
return;
|
|
295
|
+
if (this.inputEl.value !== this.displayValue)
|
|
296
|
+
this.inputEl.value = this.displayValue;
|
|
297
|
+
}
|
|
298
|
+
/** Texto del afijo: `suffix` explícito manda; si no, el "%" de los formatos escalados. */
|
|
299
|
+
get affixText() {
|
|
300
|
+
if (this.suffix !== undefined)
|
|
301
|
+
return this.suffix || null;
|
|
302
|
+
return this.scaled && !this.isEmpty ? '%' : null;
|
|
303
|
+
}
|
|
141
304
|
render() {
|
|
142
|
-
return (h("div", { key: '
|
|
305
|
+
return (h("div", { key: 'd1b4cf4bbb6f9a01db718079c1e4686653d6cb69', class: {
|
|
143
306
|
'co-number-field': true,
|
|
144
307
|
'co-number-field--disabled': this.disabled,
|
|
145
308
|
'co-number-field--focused': this.focused,
|
|
146
309
|
[`co-number-field--${this.size}`]: true,
|
|
147
310
|
[`co-number-field--${this.status}`]: this.status !== 'default',
|
|
148
|
-
} }, (this.label || this.secondaryLabel) && (h("div", { key: '
|
|
311
|
+
} }, (this.label || this.secondaryLabel) && (h("div", { key: '972f6a811230bc8e919bb13d82b00b697ef849d3', class: "co-number-field__labels" }, this.label && h("label", { key: 'cca4de1e86a0066464b6dc71289ee174cc29e229', class: "co-number-field__label" }, this.label, h(RequiredMark, { key: '80a8266109c1cede57e32c706fb4c0e47eb33249', required: this.required })), this.secondaryLabel && h("span", { key: '082db322206fedfbcd2f9a6c0fd4c439a0a96fd6', class: "co-number-field__secondary-label" }, this.secondaryLabel))), h("div", { key: '88fba5f119dab3a4feb2ad2380cd5023d760e7e9', class: "co-number-field__row", part: "row" }, !this.hideControls && (h("button", { key: '28a2033ed8997597615edf6c6b591d4da205c888', class: "co-number-field__btn co-number-field__btn--minus", type: "button", tabIndex: -1, disabled: !this.canDecrement, onClick: this.handleDecrement, "aria-label": "Decrease" }, h("co-icon", { key: '4a562d696da337feeb4bb60b018b4a23024163ad', name: "minus", size: 16 }))), h("input", { key: 'f05ebf923249188da23edb73e6688ccd8ecf8233', ref: el => (this.inputEl = el), class: "co-number-field__input", type: "text", inputMode: "decimal",
|
|
312
|
+
// Mismo guard `focused` que el @Watch: mientras el usuario edita, su
|
|
313
|
+
// texto manda. Sin esto, el re-render que dispara emitValue repinta
|
|
314
|
+
// el input desde el NÚMERO y se come el texto en construcción
|
|
315
|
+
// ("34,640.00" pegado quedaba "34,640"; un "12." perdería el punto).
|
|
316
|
+
value: this.focused && this.inputEl ? this.inputEl.value : this.displayValue, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onPaste: this.handlePaste, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, part: "input" }), this.affixText && (h("span", { key: 'b10fe23b0e16df1a9abc121923175aef3568d987', class: "co-number-field__affix", "aria-hidden": "true" }, this.affixText)), this.clearable && !this.isEmpty && !this.disabled && (h("button", { key: 'c963c856ea592a259e506ce9cc37948b105e28d3', class: "co-number-field__clear", type: "button", tabIndex: -1, onClick: this.handleClear, "aria-label": "Clear" }, h("co-icon", { key: 'd88127405a552237b103f794f449be98840254d5', name: "x-circle", size: 16, weight: "fill" }))), h("slot", { key: '0809f93bae05abd88549ffc707d3c4e9126f6d96', name: "suffix" }), !this.hideControls && (h("button", { key: 'd10d3900942acb5016448a8b509173a15ca86d43', class: "co-number-field__btn co-number-field__btn--plus", type: "button", tabIndex: -1, disabled: !this.canIncrement, onClick: this.handleIncrement, "aria-label": "Increase" }, h("co-icon", { key: 'f346237b4df54f3182b1702b953a17e07cb0a1ca', name: "plus", size: 16 })))), this.helperText && (h("div", { key: 'b9771e896812e73ba940d49419ec2eee3ba28ba3', class: `co-number-field__helper co-number-field__helper--${this.status}` }, this.statusIcon && h("co-icon", { key: '08fa68bb3f9ad4efab6722d59c5df480a0454f02', name: this.statusIcon, size: 14, weight: "fill", class: "co-number-field__helper-icon" }), h("span", { key: 'f8dd3318d47684c9c5ff0d761155174fa14d98aa', class: "co-number-field__helper-text" }, this.helperText)))));
|
|
149
317
|
}
|
|
150
318
|
static get is() { return "co-number-field"; }
|
|
151
319
|
static get encapsulation() { return "shadow"; }
|
|
@@ -440,20 +608,59 @@ export class CoNumberField {
|
|
|
440
608
|
"type": "string",
|
|
441
609
|
"mutable": false,
|
|
442
610
|
"complexType": {
|
|
443
|
-
"original": "'rate' | 'percent'",
|
|
444
|
-
"resolved": "\"percent\" | \"rate\" | undefined",
|
|
611
|
+
"original": "'rate' | 'percent' | 'amount'",
|
|
612
|
+
"resolved": "\"amount\" | \"percent\" | \"rate\" | undefined",
|
|
445
613
|
"references": {}
|
|
446
614
|
},
|
|
447
615
|
"required": false,
|
|
448
616
|
"optional": true,
|
|
449
617
|
"docs": {
|
|
450
618
|
"tags": [],
|
|
451
|
-
"text": "Display format. With 'rate' | 'percent' the `value` stays a DECIMAL\n(e.g. 0.15) but the field shows/edits the PERCENT (15) with a \"%\" suffix.\nvalue/min/max/step are always in the underlying (decimal) unit.\nReflected so it survives lazy hydration when set via the Vue wrapper."
|
|
619
|
+
"text": "Display format. With 'rate' | 'percent' the `value` stays a DECIMAL\n(e.g. 0.15) but the field shows/edits the PERCENT (15) with a \"%\" suffix.\nvalue/min/max/step are always in the underlying (decimal) unit.\nWith 'amount' the field is a live money mask: thousands separators while\ntyping (1234.5 shows 1,234.5), typing restricted to digits and dot, and\npaste normalized whatever the source locale (\"1.234,56\" and \"1,234.56\"\nboth commit 1234.56). The emitted value is always the raw number.\nReflected so it survives lazy hydration when set via the Vue wrapper."
|
|
452
620
|
},
|
|
453
621
|
"getter": false,
|
|
454
622
|
"setter": false,
|
|
455
623
|
"reflect": true,
|
|
456
624
|
"attribute": "format"
|
|
625
|
+
},
|
|
626
|
+
"hideControls": {
|
|
627
|
+
"type": "boolean",
|
|
628
|
+
"mutable": false,
|
|
629
|
+
"complexType": {
|
|
630
|
+
"original": "boolean",
|
|
631
|
+
"resolved": "boolean",
|
|
632
|
+
"references": {}
|
|
633
|
+
},
|
|
634
|
+
"required": false,
|
|
635
|
+
"optional": false,
|
|
636
|
+
"docs": {
|
|
637
|
+
"tags": [],
|
|
638
|
+
"text": "Oculta los botones \u00B1 (campo num\u00E9rico \"plano\": precio, tasa). Las flechas\n\u2191\u2193 siguen escalonando. Reflejado para que el CSS del host lo lea."
|
|
639
|
+
},
|
|
640
|
+
"getter": false,
|
|
641
|
+
"setter": false,
|
|
642
|
+
"reflect": true,
|
|
643
|
+
"attribute": "hide-controls",
|
|
644
|
+
"defaultValue": "false"
|
|
645
|
+
},
|
|
646
|
+
"suffix": {
|
|
647
|
+
"type": "string",
|
|
648
|
+
"mutable": false,
|
|
649
|
+
"complexType": {
|
|
650
|
+
"original": "string",
|
|
651
|
+
"resolved": "string | undefined",
|
|
652
|
+
"references": {}
|
|
653
|
+
},
|
|
654
|
+
"required": false,
|
|
655
|
+
"optional": true,
|
|
656
|
+
"docs": {
|
|
657
|
+
"tags": [],
|
|
658
|
+
"text": "Sufijo de texto a la derecha del n\u00FAmero (moneda, unidad). Reemplaza al \"%\"\nautom\u00E1tico de `format`; cadena vac\u00EDa = sin sufijo (\u00FAtil cuando el slot\n`suffix` ya lleva el control que indica la unidad)."
|
|
659
|
+
},
|
|
660
|
+
"getter": false,
|
|
661
|
+
"setter": false,
|
|
662
|
+
"reflect": false,
|
|
663
|
+
"attribute": "suffix"
|
|
457
664
|
}
|
|
458
665
|
};
|
|
459
666
|
}
|
|
@@ -681,7 +681,15 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
681
681
|
* Figma original, 2026-07-29: a 12px el texto quedaba ilegible en paneles
|
|
682
682
|
* densos como el picker de campos del filtro avanzado).
|
|
683
683
|
* Todos los var() llevan fallback literal: el host puede tener un build de
|
|
684
|
-
* tokens viejo sin los tokens nuevos (font-size-12, spacing-sm2, mono…).
|
|
684
|
+
* tokens viejo sin los tokens nuevos (font-size-12, spacing-sm2, mono…).
|
|
685
|
+
* Overridables por host (además de `--co-option-list-max-height`, documentada
|
|
686
|
+
* junto a `.co-option-list__options`): `--co-option-list-item-min-height`
|
|
687
|
+
* (default 32px, fila más alta — p.ej. filas de dos líneas con precio),
|
|
688
|
+
* `--co-option-list-item-padding-y` (default `--co-spacing-xs`, padding
|
|
689
|
+
* vertical de la fila) y `--co-option-list-text-gap` (default
|
|
690
|
+
* `--co-spacing-xxs`, gap entre título y descripción). Ninguna afecta el
|
|
691
|
+
* pitch fijo 34 de `.co-option-list__spacer .co-option-list__option`
|
|
692
|
+
* (virtualización — ver comentario en esa regla). */
|
|
685
693
|
.co-option-list {
|
|
686
694
|
display: flex;
|
|
687
695
|
flex-direction: column;
|
|
@@ -775,9 +783,9 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
775
783
|
align-items: center;
|
|
776
784
|
gap: var(--co-spacing-sm2, 8px);
|
|
777
785
|
min-width: 0;
|
|
778
|
-
min-height: 32px;
|
|
786
|
+
min-height: var(--co-option-list-item-min-height, 32px);
|
|
779
787
|
box-sizing: border-box;
|
|
780
|
-
padding: var(--co-spacing-xs, 4px) var(--co-spacing-sm2, 8px) var(--co-spacing-xs, 4px) var(--co-spacing-xs, 4px);
|
|
788
|
+
padding: var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-spacing-sm2, 8px) var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-spacing-xs, 4px);
|
|
781
789
|
border-radius: var(--co-border-radius-xs, 8px);
|
|
782
790
|
cursor: pointer;
|
|
783
791
|
font-size: var(--co-font-size-14, 14px);
|
|
@@ -831,7 +839,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
831
839
|
.co-option-list__text {
|
|
832
840
|
display: flex;
|
|
833
841
|
flex-direction: column;
|
|
834
|
-
gap: var(--co-spacing-xxs, 2px);
|
|
842
|
+
gap: var(--co-option-list-text-gap, var(--co-spacing-xxs, 2px));
|
|
835
843
|
flex: 1;
|
|
836
844
|
min-width: 0;
|
|
837
845
|
}
|
|
@@ -859,6 +867,19 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
859
867
|
flex-shrink: 1;
|
|
860
868
|
}
|
|
861
869
|
|
|
870
|
+
/* suffixAlign="end": el suffix sale del título y pinta como columna a la
|
|
871
|
+
* derecha de la fila (precio/meta) — sin el guion inline, alineado y con
|
|
872
|
+
* cifras tabulares para que varias filas apiladas no "bailen". */
|
|
873
|
+
.co-option-list__suffix--end {
|
|
874
|
+
flex-shrink: 0;
|
|
875
|
+
margin-left: auto;
|
|
876
|
+
text-align: right;
|
|
877
|
+
white-space: nowrap;
|
|
878
|
+
font-size: var(--co-font-size-13, 13px);
|
|
879
|
+
color: var(--co-semantic-text-default, #1f1c1b);
|
|
880
|
+
font-variant-numeric: tabular-nums;
|
|
881
|
+
}
|
|
882
|
+
|
|
862
883
|
.co-option-list__badge {
|
|
863
884
|
flex-shrink: 0;
|
|
864
885
|
padding: 0 var(--co-spacing-xs, 4px);
|
|
@@ -60,6 +60,9 @@ export class CoOptionList {
|
|
|
60
60
|
/** Término externo para highlight (input en el host, p.ej. ⌘K). */
|
|
61
61
|
this.highlightTerm = '';
|
|
62
62
|
this.avatarShape = 'circle';
|
|
63
|
+
/** `end` pinta el suffix como columna a la derecha de la fila (precio/meta),
|
|
64
|
+
* sin el guion; `inline` = junto al label (default). */
|
|
65
|
+
this.suffixAlign = 'inline';
|
|
63
66
|
// ── Navegación ─────────────────────────────────────────────
|
|
64
67
|
/** Auto-resalta la primera fila navegable al montar y en cada cambio de
|
|
65
68
|
* items (paridad command-palette: tipear + Enter = primer resultado).
|
|
@@ -699,7 +702,7 @@ export class CoOptionList {
|
|
|
699
702
|
'co-option-list__option--lifted': !this.listDragActive && this.dragKey === item._id,
|
|
700
703
|
'co-option-list__option--drop-before': this.listDragActive && this.overKey === item._id && !this.dropAfter,
|
|
701
704
|
'co-option-list__option--drop-after': this.listDragActive && this.overKey === item._id && this.dropAfter,
|
|
702
|
-
}, key: item._id, id: `co-optlist-${index}`, "data-id": item._id, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": item.disabled ? 'true' : 'false', draggable: listDragRow && this.armedKey === item._id, onClick: () => !item.disabled && this.pick(item), onMouseEnter: () => { this.activeIndex = index; }, onDragStart: listDragRow ? (e) => this.handleRowDragStart(e, item._id) : undefined, onDragOver: listDragRow ? (e) => this.handleRowDragOver(e, item._id) : undefined, onDrop: listDragRow ? (e) => this.handleRowDrop(e, item._id) : undefined, onDragEnd: listDragRow ? this.handleRowDragEnd : undefined, onDragLeave: listDragRow ? (e) => this.handleRowDragLeave(e, item._id) : undefined }, (ptrDragRow || listDragRow) && (h("span", { class: "co-option-list__drag-handle", part: "drag-handle", title: "Drag to reorder", onMouseDown: listDragRow ? () => (this.armedKey = item._id) : undefined, onPointerDown: ptrDragRow ? (e) => this.startPointerDrag(e, item._id) : undefined, onClick: (e) => e.stopPropagation() }, h("co-icon", { name: "dots-six-vertical", size: 16 }))), this.renderLeading(item), h("div", { class: "co-option-list__text" }, h("span", { class: "co-option-list__title" }, h("span", { class: "co-option-list__label", style: item.labelColor ? { color: item.labelColor, fontWeight: '600' } : undefined }, this.renderLabelText(item.label)), item.suffix && h("span", { class: "co-option-list__suffix" }, "- ", item.suffix), item.badge && this.renderBadge(item.badge)), item.description && h("span", { class: "co-option-list__desc" }, item.description)), this.pinnable && (h("button", { class: { 'co-option-list__pin': true, 'co-option-list__pin--active': !!item.pinned }, type: "button", tabIndex: -1, "aria-label": item.pinned ? `Unpin ${item.label}` : `Pin ${item.label}`, "aria-pressed": item.pinned ? 'true' : 'false', onClick: (e) => { e.stopPropagation(); this.coPinToggle.emit({ item }); } }, h("co-icon", { name: "push-pin", size: 16, weight: item.pinned ? 'fill' : 'regular' }))), isSelected && this.removableItems && this.multiple && (h("button", { class: "co-option-list__row-action", type: "button", tabIndex: -1, "aria-label": `Remove ${item.label}`, onClick: (e) => { e.stopPropagation(); this.coRemoveItem.emit(item._id); } }, h("co-icon", { name: "x-circle", size: 16, weight: "fill" }))), isSelected && !this.removableItems && this.selectedAffordance === 'deselect' && (h("button", { class: "co-option-list__row-action", type: "button", tabIndex: -1, "aria-label": `Deselect ${item.label}`, onClick: (e) => { e.stopPropagation(); this.deselectItem(item); } }, h("co-icon", { name: "x-circle", size: 16, weight: "fill" }))), isSelected && !this.removableItems && this.selectedAffordance === 'check' && (h("co-icon", { name: "check", size: 16, class: "co-option-list__check" }))));
|
|
705
|
+
}, key: item._id, id: `co-optlist-${index}`, "data-id": item._id, role: "option", "aria-selected": isSelected ? 'true' : 'false', "aria-disabled": item.disabled ? 'true' : 'false', draggable: listDragRow && this.armedKey === item._id, onClick: () => !item.disabled && this.pick(item), onMouseEnter: () => { this.activeIndex = index; }, onDragStart: listDragRow ? (e) => this.handleRowDragStart(e, item._id) : undefined, onDragOver: listDragRow ? (e) => this.handleRowDragOver(e, item._id) : undefined, onDrop: listDragRow ? (e) => this.handleRowDrop(e, item._id) : undefined, onDragEnd: listDragRow ? this.handleRowDragEnd : undefined, onDragLeave: listDragRow ? (e) => this.handleRowDragLeave(e, item._id) : undefined }, (ptrDragRow || listDragRow) && (h("span", { class: "co-option-list__drag-handle", part: "drag-handle", title: "Drag to reorder", onMouseDown: listDragRow ? () => (this.armedKey = item._id) : undefined, onPointerDown: ptrDragRow ? (e) => this.startPointerDrag(e, item._id) : undefined, onClick: (e) => e.stopPropagation() }, h("co-icon", { name: "dots-six-vertical", size: 16 }))), this.renderLeading(item), h("div", { class: "co-option-list__text" }, h("span", { class: "co-option-list__title" }, h("span", { class: "co-option-list__label", style: item.labelColor ? { color: item.labelColor, fontWeight: '600' } : undefined }, this.renderLabelText(item.label)), item.suffix && this.suffixAlign !== 'end' && h("span", { class: "co-option-list__suffix" }, "- ", item.suffix), item.badge && this.renderBadge(item.badge)), item.description && h("span", { class: "co-option-list__desc" }, item.description)), item.suffix && this.suffixAlign === 'end' && h("span", { class: "co-option-list__suffix co-option-list__suffix--end" }, item.suffix), this.pinnable && (h("button", { class: { 'co-option-list__pin': true, 'co-option-list__pin--active': !!item.pinned }, type: "button", tabIndex: -1, "aria-label": item.pinned ? `Unpin ${item.label}` : `Pin ${item.label}`, "aria-pressed": item.pinned ? 'true' : 'false', onClick: (e) => { e.stopPropagation(); this.coPinToggle.emit({ item }); } }, h("co-icon", { name: "push-pin", size: 16, weight: item.pinned ? 'fill' : 'regular' }))), isSelected && this.removableItems && this.multiple && (h("button", { class: "co-option-list__row-action", type: "button", tabIndex: -1, "aria-label": `Remove ${item.label}`, onClick: (e) => { e.stopPropagation(); this.coRemoveItem.emit(item._id); } }, h("co-icon", { name: "x-circle", size: 16, weight: "fill" }))), isSelected && !this.removableItems && this.selectedAffordance === 'deselect' && (h("button", { class: "co-option-list__row-action", type: "button", tabIndex: -1, "aria-label": `Deselect ${item.label}`, onClick: (e) => { e.stopPropagation(); this.deselectItem(item); } }, h("co-icon", { name: "x-circle", size: 16, weight: "fill" }))), isSelected && !this.removableItems && this.selectedAffordance === 'check' && (h("co-icon", { name: "check", size: 16, class: "co-option-list__check" }))));
|
|
703
706
|
}
|
|
704
707
|
renderVirtual(items, selectedIds) {
|
|
705
708
|
const { totalHeight, startIdx, endIdx, offsetY } = virtualSlice(this.scrollTop, items.length);
|
|
@@ -710,11 +713,11 @@ export class CoOptionList {
|
|
|
710
713
|
const selectedIds = this.selectedIds;
|
|
711
714
|
const { hasMore, remaining } = deriveMore(this.parsedItems.length, this.total, this.hasMore);
|
|
712
715
|
const showClear = !!this.clearOptionLabel && selectedIds.length > 0;
|
|
713
|
-
return (h("div", { key: '
|
|
716
|
+
return (h("div", { key: 'fc7f56eb7837405c1c3c1addabb9748f4c955fed', class: "co-option-list", onKeyDown: this.onRootKeyDown }, this.searchable && (h("div", { key: '44a31021a6cd49ec0ddf169c2cf2a0cdd0088f1d', class: "co-option-list__search", part: "search" }, h("co-icon", { key: '4d375787abbc1dd93fda1200a8cfb76928775e6f', name: "magnifying-glass", size: 16 }), h("input", { key: 'ffcad867196edd9f8384eda74d215873f2b2f857', class: "co-option-list__search-input", type: "text", placeholder: this.searchPlaceholder, value: this.term, onInput: this.onSearchInput, ref: (el) => (this.searchInputEl = el), role: "combobox", "aria-expanded": "true", "aria-autocomplete": "list" }))), h("div", { key: 'a1d5b69d184accaf8ee4ff4b0674823cee4da659', class: "co-option-list__options", part: "options", role: "listbox", "aria-multiselectable": this.multiple ? 'true' : 'false', ref: (el) => (this.optionsEl = el), onScroll: this.onNativeScroll }, h("div", { key: '3b6761a9bd95bcdaea14dd13619024841e9b6e22', class: "co-option-list__inner" }, showClear && (h("button", { key: '0b9fce9a2439733e5a3bb0d74542eafcbb3754b9', class: "co-option-list__clear-row", type: "button", onClick: () => this.coClearSelection.emit() }, h("co-icon", { key: '6db442c304c7d36fa9e41befb78a1ee4ebe8a415', name: "x-circle", size: 14 }), h("span", { key: '12d6b290acc9789dea62cfd036f62eae2a28b33d' }, this.clearOptionLabel))), this.loading && items.length === 0 && (h("div", { key: 'cc358dc94a3db4208ef85f16f8dce2d0592d4193', class: "co-option-list__loading" }, h("co-loader", { key: '9373dbe39674b9e5b18d03cf540ffa83309ea3fe', size: "sm" }))), !this.loading && items.length === 0 && (h("div", { key: '732747e33e2ec29968eb7f19b050d89e4b2cca00', class: "co-option-list__empty" }, h("co-icon", { key: '6defcd47ad121509bea43da488382a47a846f728', name: "magnifying-glass", size: 20 }), h("span", { key: '73729f8c52962e522125b6c258b0f1fb04eff533' }, this.emptyMessage))), items.length > 0 && this.virtual
|
|
714
717
|
? this.renderVirtual(items, selectedIds)
|
|
715
718
|
: buildRows(items).map((row) => row.kind === 'header'
|
|
716
719
|
? h("div", { class: "co-option-list__group", role: "presentation" }, row.label)
|
|
717
|
-
: this.renderRow(row.item, row.index, selectedIds)), this.loading && items.length > 0 && (h("div", { key: '
|
|
720
|
+
: this.renderRow(row.item, row.index, selectedIds)), this.loading && items.length > 0 && (h("div", { key: '915e9c5dd03a7f77a2d680137b962e0f100fa903', class: "co-option-list__loading-more" }, h("co-loader", { key: 'dea515b0c90e0fac1f16fd4140ed38bddcd0cda4', size: "sm" }))), !this.loading && hasMore && remaining > 0 && (h("div", { key: '9f3be3b39ccc00a380c3d88d30ac8695102e22a4', class: "co-option-list__more" }, remaining, " more results")))), h("slot", { key: '6b6a06ef1819241ef5f5ff5870e79ab8b0765ed8', name: "footer" })));
|
|
718
721
|
}
|
|
719
722
|
static get is() { return "co-option-list"; }
|
|
720
723
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1204,6 +1207,26 @@ export class CoOptionList {
|
|
|
1204
1207
|
"attribute": "avatar-shape",
|
|
1205
1208
|
"defaultValue": "'circle'"
|
|
1206
1209
|
},
|
|
1210
|
+
"suffixAlign": {
|
|
1211
|
+
"type": "string",
|
|
1212
|
+
"mutable": false,
|
|
1213
|
+
"complexType": {
|
|
1214
|
+
"original": "'inline' | 'end'",
|
|
1215
|
+
"resolved": "\"end\" | \"inline\"",
|
|
1216
|
+
"references": {}
|
|
1217
|
+
},
|
|
1218
|
+
"required": false,
|
|
1219
|
+
"optional": false,
|
|
1220
|
+
"docs": {
|
|
1221
|
+
"tags": [],
|
|
1222
|
+
"text": "`end` pinta el suffix como columna a la derecha de la fila (precio/meta),\nsin el guion; `inline` = junto al label (default)."
|
|
1223
|
+
},
|
|
1224
|
+
"getter": false,
|
|
1225
|
+
"setter": false,
|
|
1226
|
+
"reflect": true,
|
|
1227
|
+
"attribute": "suffix-align",
|
|
1228
|
+
"defaultValue": "'inline'"
|
|
1229
|
+
},
|
|
1207
1230
|
"autoHighlight": {
|
|
1208
1231
|
"type": "boolean",
|
|
1209
1232
|
"mutable": false,
|
|
@@ -106,8 +106,10 @@ export class CoOverlay {
|
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Promote the scrim to the browser top layer so it covers the whole viewport
|
|
109
|
-
* regardless of ancestor `
|
|
110
|
-
*
|
|
109
|
+
* regardless of ancestor containing blocks — `contain: layout` on the
|
|
110
|
+
* app-shell `.main` / `.co-drawer` / `.co-modal__frame` (which replaced the
|
|
111
|
+
* old ancestor `filter`/`mask`), or any `transform` — that would otherwise
|
|
112
|
+
* make `position: fixed` resolve against that ancestor, confining the scrim.
|
|
111
113
|
* The Popover API promotes WITHOUT moving the DOM node, so slots and Stencil
|
|
112
114
|
* reconciliation are untouched. No-ops gracefully where unsupported.
|
|
113
115
|
*/
|
|
@@ -187,7 +189,7 @@ export class CoOverlay {
|
|
|
187
189
|
focusables[nextIndex].focus();
|
|
188
190
|
}
|
|
189
191
|
render() {
|
|
190
|
-
return (h("div", { key: '
|
|
192
|
+
return (h("div", { key: '1664f81264046991c4d66285489001c4783138ec', class: { 'co-overlay': true, 'co-overlay--open': this.open }, part: "overlay", popover: "manual", tabindex: this.trapFocus ? -1 : undefined, ref: (el) => (this.overlayEl = el), onClick: this.handleClick, onTransitionEnd: this.handleTransitionEnd }, h("slot", { key: 'fc220441149e20eb8b2ca1dcb7131d77e25dcdb3' })));
|
|
191
193
|
}
|
|
192
194
|
static get is() { return "co-overlay"; }
|
|
193
195
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,7 +6,7 @@ import { h } from "@stencil/core";
|
|
|
6
6
|
*/
|
|
7
7
|
export class CoPageHeader {
|
|
8
8
|
render() {
|
|
9
|
-
return (h("div", { key: '
|
|
9
|
+
return (h("div", { key: '305f42c88d10f238351f362b72283abe82eaeb20', class: "co-page-header", part: "page-header" }, h("div", { key: '10185fe127049bfece585c59f92824888113861e', class: "co-page-header__left" }, this.icon && (h("span", { key: '017bc4f2aed8d05999c581ce0d7a4797aa84eff6', class: "co-page-header__icon" }, h("co-icon", { key: '7d5863437875aa09ad3bbe9e12c0b5d5c9f5c0c7', name: this.icon, size: 24 }))), h("span", { key: 'e62ead8cb061045d8995689dce3009e9843e3997', class: "co-page-header__title" }, h("slot", { key: '9e1d01a94942daeeb1c56f1d0f05534b45125422' }, this.heading))), h("div", { key: '5a2dd08e5b11ab33e64ddb581196d8535deb0925', class: "co-page-header__actions" }, h("slot", { key: '7fd3a5ea06593c9208a59ba2812bb827f1d39815', name: "actions" }))));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "co-page-header"; }
|
|
12
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -159,7 +159,7 @@ export class CoPhoneField {
|
|
|
159
159
|
render() {
|
|
160
160
|
const entry = this.selectedEntry;
|
|
161
161
|
const statusClass = this.status !== 'default' ? `co-phone-field--${this.status}` : '';
|
|
162
|
-
return (h("div", { key: '
|
|
162
|
+
return (h("div", { key: '44113c6d2a4845b96b185bc1a291335ad099491b', class: `co-phone-field co-phone-field--${this.size} ${statusClass} ${this.disabled ? 'co-phone-field--disabled' : ''}` }, this.label && (h("label", { key: 'aee2eced519f996ebf8941210e5151ebe32429d3', class: "co-phone-field__label" }, this.label, h(RequiredMark, { key: '85b8d50b8062d0041b0f416beb7a140d29d06b1f', required: this.required }))), h("div", { key: '381313d069536477ded093cd236ff740dc534ae4', class: "co-phone-field__container" }, h("button", { key: '4aa81cd26e4824c45b9fd0530a4ff1016acbc877', type: "button", class: "co-phone-field__selector", disabled: this.disabled, onClick: () => this.handleToggleDropdown(), "aria-expanded": String(this.isOpen), "aria-haspopup": "listbox" }, entry ? (h("img", { class: "co-phone-field__flag", src: `https://flagcdn.com/w40/${entry.iso2.toLowerCase()}.png`, alt: entry.iso2 })) : (h("co-icon", { name: "phone", size: 16 })), h("span", { key: 'd8ba9bbaae902853d97c37892ea2094a3a05c2ed', class: "co-phone-field__dial-code" }, entry ? entry.dialCode : ''), h("span", { key: '065c2daf2b277fd870204c989b3eb359aa68dec4', class: "co-phone-field__chevron" }, h("co-icon", { key: '53761d275d9f98010c197e7d8b8f5b20abf753fd', name: "caret-down", size: 14 }))), h("input", { key: '8340a483e8deaf24fd7b03d2239195064d392eb4', class: "co-phone-field__input", type: "tel", placeholder: this.placeholder, value: this.numberPart, disabled: this.disabled, onInput: (e) => this.handleNumberInput(e) })), this.isOpen && (h("div", { key: '6e736fb24707feb8faf373a403b192670698a043', class: "co-phone-field__dropdown", role: "listbox" }, h("div", { key: 'f0750d83d3da8cebc3c1b39d21a35b31bc17bd4a', class: "co-phone-field__search" }, h("input", { key: '546c432e6e11010e2d685780e2f5eddfbf3ad73d', class: "co-phone-field__search-input", type: "text", placeholder: "Search country...", value: this.searchQuery, onInput: (e) => this.handleSearchInput(e), autoFocus: true })), h("div", { key: '5960b2979fbedf66ea197ff7f37093b6240242bc', class: "co-phone-field__options" }, this.filteredCountries.map((d) => (h("button", { type: "button", key: d.iso2, class: `co-phone-field__option ${d.iso2 === this.selectedIso2 ? 'co-phone-field__option--selected' : ''}`, role: "option", "aria-selected": d.iso2 === this.selectedIso2 ? 'true' : 'false', onClick: () => this.handleCountrySelect(d) }, h("img", { class: "co-phone-field__option-flag", src: `https://flagcdn.com/w40/${d.iso2.toLowerCase()}.png`, alt: d.iso2 }), h("span", { class: "co-phone-field__option-name" }, this.renderName(d.name)), h("span", { class: "co-phone-field__option-code" }, d.dialCode))))))), this.helperText && (h("div", { key: 'fa9e15ba4f08abf2caff8b1b196ce25ce2e89bb9', class: "co-phone-field__helper" }, this.statusIcon && (h("co-icon", { key: '122a32febae2d6f86e32d8b3d1f2ec2df9e573c7', name: this.statusIcon, size: 14, weight: "fill", class: "co-phone-field__helper-icon" })), h("span", { key: '6117ecd58a0c2ddefca94237f7c5d815fd5c3c79', class: "co-phone-field__helper-text" }, this.helperText)))));
|
|
163
163
|
}
|
|
164
164
|
static get is() { return "co-phone-field"; }
|
|
165
165
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
exactamente igual de invisible que antes — sin estado nuevo que limpiar. */
|
|
44
44
|
visibility: hidden;
|
|
45
45
|
opacity: 0;
|
|
46
|
-
transform: scale(0.
|
|
46
|
+
transform: scale(0.97);
|
|
47
47
|
background: var(--co-semantic-surface-page, #fff);
|
|
48
48
|
border: 1px solid var(--co-semantic-border-subtle);
|
|
49
49
|
border-radius: var(--co-border-radius-sm, 12px);
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
overflow: visible;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/* La
|
|
55
|
-
|
|
54
|
+
/* Transición de entrada. La de salida vive en --closing, declarada DESPUÉS
|
|
55
|
+
(misma especificidad, gana por orden de cascada) — el nodo sigue montado
|
|
56
|
+
durante el cierre (tsx difiere el unmount hasta transitionend). */
|
|
56
57
|
.co-popover__panel--positioned {
|
|
57
58
|
visibility: visible;
|
|
58
59
|
opacity: 1;
|
|
@@ -62,6 +63,20 @@
|
|
|
62
63
|
transform var(--co-motion-duration-base) var(--co-motion-ease-out);
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
/* Fase de salida: el nodo sigue montado (tsx difiere el unmount hasta transitionend).
|
|
67
|
+
Debe declararse después de --positioned: misma especificidad, gana por orden.
|
|
68
|
+
pointer-events: none — el panel moribundo sigue :popover-open en el top layer
|
|
69
|
+
~150ms; sin esto, un click durante el exit aterriza en el menú fantasma. */
|
|
70
|
+
.co-popover__panel--closing {
|
|
71
|
+
visibility: visible;
|
|
72
|
+
opacity: 0;
|
|
73
|
+
transform: scale(0.99);
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
transition:
|
|
76
|
+
opacity var(--co-motion-duration-fast) var(--co-motion-ease-in),
|
|
77
|
+
transform var(--co-motion-duration-fast) var(--co-motion-ease-in);
|
|
78
|
+
}
|
|
79
|
+
|
|
65
80
|
/* Origen según el lado resuelto (post-flip) por el que abre el panel. */
|
|
66
81
|
.co-popover__panel--bottom {
|
|
67
82
|
transform-origin: top center;
|