@prolibu-suite/cobalt-core 0.10.0 → 0.10.1
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 +395 -29
- package/dist/cjs/co-accordion.cjs.entry.js +4 -4
- package/dist/cjs/co-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-audio-player.cjs.entry.js +82 -12
- package/dist/cjs/co-avatar.cjs.entry.js +72 -0
- package/dist/cjs/co-button.cjs.entry.js +1 -1
- package/dist/cjs/co-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/co-chip_2.cjs.entry.js +62 -10
- package/dist/cjs/co-color-picker.cjs.entry.js +40 -10
- package/dist/cjs/co-data-table.cjs.entry.js +82 -4
- package/dist/cjs/co-input.cjs.entry.js +6 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/co-modal.cjs.entry.js +7 -3
- package/dist/cjs/co-navbar.cjs.entry.js +2 -2
- package/dist/cjs/co-number-field.cjs.entry.js +3 -3
- package/dist/cjs/co-overlay.cjs.entry.js +1 -1
- package/dist/cjs/co-page-header.cjs.entry.js +1 -1
- package/dist/cjs/co-phone-field.cjs.entry.js +1 -1
- package/dist/cjs/co-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/co-progress-circle.cjs.entry.js +2 -2
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +1 -1
- package/dist/cjs/co-radio.cjs.entry.js +3 -3
- package/dist/cjs/co-rating.cjs.entry.js +3 -3
- package/dist/cjs/co-ref-field.cjs.entry.js +100 -9
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/co-row.cjs.entry.js +2 -2
- package/dist/cjs/co-select.cjs.entry.js +4 -4
- package/dist/cjs/co-separator.cjs.entry.js +1 -1
- package/dist/cjs/co-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/co-slider.cjs.entry.js +2 -2
- package/dist/cjs/co-switch.cjs.entry.js +3 -3
- package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/co-tab.cjs.entry.js +2 -2
- package/dist/cjs/co-tags-field.cjs.entry.js +5 -5
- package/dist/cjs/co-textarea.cjs.entry.js +4 -4
- package/dist/cjs/co-time-field.cjs.entry.js +1 -1
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +3 -3
- package/dist/cjs/co-toggle-button.cjs.entry.js +3 -3
- package/dist/cjs/{co-avatar_2.cjs.entry.js → co-tooltip.cjs.entry.js} +2 -70
- package/dist/cjs/co-video.cjs.entry.js +2 -2
- package/dist/cjs/cobalt.cjs.js +1 -1
- package/dist/cjs/index-MDAnKsze.js +12 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-82266f11.entry.js → p-000a15b8.entry.js} +1 -1
- package/dist/cobalt/{p-fe7e8813.entry.js → p-148d4aa6.entry.js} +1 -1
- package/dist/cobalt/p-16f8cee6.entry.js +1 -0
- package/dist/cobalt/p-239c5c5f.entry.js +1 -0
- package/dist/cobalt/{p-4d897896.entry.js → p-28764b8e.entry.js} +1 -1
- package/dist/cobalt/{p-73c6d735.entry.js → p-2a30c143.entry.js} +1 -1
- package/dist/cobalt/{p-85501c6a.entry.js → p-2f0f3bb1.entry.js} +1 -1
- package/dist/cobalt/{p-e01f9b9a.entry.js → p-2fba312b.entry.js} +1 -1
- package/dist/cobalt/p-354d5089.entry.js +1 -0
- package/dist/cobalt/{p-5298c030.entry.js → p-383a998e.entry.js} +1 -1
- package/dist/cobalt/{p-325b91b6.entry.js → p-3c4f7026.entry.js} +1 -1
- package/dist/cobalt/p-416795f5.entry.js +1 -0
- package/dist/cobalt/{p-54c987d7.entry.js → p-5a3e4c81.entry.js} +1 -1
- package/dist/cobalt/p-5adf117c.entry.js +1 -0
- package/dist/cobalt/{p-83a9a05a.entry.js → p-5ca394b1.entry.js} +1 -1
- package/dist/cobalt/{p-1a589c8e.entry.js → p-5e4973a6.entry.js} +1 -1
- package/dist/cobalt/{p-b565104d.entry.js → p-6c82a892.entry.js} +1 -1
- package/dist/cobalt/{p-83ea631d.entry.js → p-789c4b3e.entry.js} +1 -1
- package/dist/cobalt/{p-ea20f048.entry.js → p-7e8e6907.entry.js} +1 -1
- package/dist/cobalt/{p-10b82207.entry.js → p-8471abe2.entry.js} +1 -1
- package/dist/cobalt/p-8f2199ff.entry.js +1 -0
- package/dist/cobalt/p-9246e09c.entry.js +1 -0
- package/dist/cobalt/{p-eb063cc0.entry.js → p-93fe45fd.entry.js} +1 -1
- package/dist/cobalt/{p-ad33c40e.entry.js → p-95cfcb34.entry.js} +1 -1
- package/dist/cobalt/{p-bd683db3.entry.js → p-9cf738ed.entry.js} +1 -1
- package/dist/cobalt/p-a2462d7a.entry.js +1 -0
- package/dist/cobalt/p-a325ea0c.entry.js +1 -0
- package/dist/cobalt/{p-e8a4e6b0.entry.js → p-b5bba7fe.entry.js} +1 -1
- package/dist/cobalt/{p-6bf6bc3e.entry.js → p-b821d9de.entry.js} +1 -1
- package/dist/cobalt/{p-92b092db.entry.js → p-be34e447.entry.js} +1 -1
- package/dist/cobalt/p-c7d7d7f7.entry.js +1 -0
- package/dist/cobalt/{p-aae86f96.entry.js → p-d0b2c418.entry.js} +1 -1
- package/dist/cobalt/{p-50bcc76f.entry.js → p-d3344187.entry.js} +1 -1
- package/dist/cobalt/p-d375014b.entry.js +1 -0
- package/dist/cobalt/p-d9d9e8ae.entry.js +1 -0
- package/dist/cobalt/p-e371ec7a.entry.js +1 -0
- package/dist/cobalt/p-eadfd661.entry.js +1 -0
- package/dist/cobalt/p-ef301976.entry.js +1 -0
- package/dist/cobalt/{p-f68dd124.entry.js → p-fb2d1144.entry.js} +1 -1
- package/dist/collection/components/co-accordion/co-accordion.css +2 -2
- package/dist/collection/components/co-accordion/co-accordion.js +4 -4
- package/dist/collection/components/co-action-bar/co-action-bar.css +9 -2
- package/dist/collection/components/co-audio-player/co-audio-player.js +138 -12
- 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-button/co-button.css +6 -3
- package/dist/collection/components/co-checkbox/co-checkbox.js +22 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-picker/co-color-picker.js +40 -10
- 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.css +63 -2
- package/dist/collection/components/co-data-table/co-data-table.js +59 -4
- package/dist/collection/components/co-data-table/headerTruncationLogic.js +34 -0
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-input/co-input.js +17 -5
- package/dist/collection/components/co-menu-item/co-menu-item.css +9 -0
- package/dist/collection/components/co-modal/co-modal.css +6 -0
- package/dist/collection/components/co-modal/co-modal.js +33 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.js +3 -3
- package/dist/collection/components/co-option-list/co-option-list.js +32 -3
- package/dist/collection/components/co-option-list/optionListLogic.js +31 -8
- package/dist/collection/components/co-overlay/co-overlay.js +1 -1
- 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.js +1 -1
- 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.css +40 -0
- package/dist/collection/components/co-ref-field/co-ref-field.js +207 -11
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +3 -3
- 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 +24 -5
- 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.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- 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.js +1 -1
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +6 -5
- 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 +9 -5
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.js +2 -2
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-video/co-video.js +2 -2
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.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-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-checkbox.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.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-event-calendar.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-item.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-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.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-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.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-video.js +1 -1
- package/dist/components/p-7TncUlLN.js +1 -0
- package/dist/components/{p-BxP8OBw6.js → p-B9xitpGU.js} +1 -1
- package/dist/components/{p-x4grh-eZ.js → p-CBTGN490.js} +1 -1
- package/dist/components/{p-CXPRaTuo.js → p-CLsAo0-A.js} +1 -1
- package/dist/components/{p-B1QFLcY9.js → p-D2ldYZo1.js} +1 -1
- package/dist/components/{p-Bv6U5y3d.js → p-D3mVYO-G.js} +1 -1
- package/dist/components/{p-DkDTmHCg.js → p-DDV_bRcU.js} +1 -1
- package/dist/components/{p-Be_kyNRE.js → p-DSnJWzQw.js} +1 -1
- package/dist/components/{p-BBP5__CY.js → p-DTi2O4O8.js} +1 -1
- package/dist/components/p-De7w9k6_.js +1 -0
- package/dist/components/{p-Cl3AdEQJ.js → p-DoHLTC0n.js} +1 -1
- package/dist/components/{p-CnX3L8aF.js → p-DxtNejr2.js} +1 -1
- package/dist/components/p-wjt4IAGZ.js +1 -0
- package/dist/components/{p-DIo66nBr.js → p-zuhal3IZ.js} +1 -1
- package/dist/esm/co-accordion.entry.js +4 -4
- package/dist/esm/co-action-bar.entry.js +1 -1
- package/dist/esm/co-audio-player.entry.js +82 -12
- package/dist/esm/co-avatar.entry.js +70 -0
- package/dist/esm/co-button.entry.js +1 -1
- package/dist/esm/co-checkbox.entry.js +3 -3
- package/dist/esm/co-chip_2.entry.js +62 -10
- package/dist/esm/co-color-picker.entry.js +40 -10
- package/dist/esm/co-data-table.entry.js +82 -4
- package/dist/esm/co-input.entry.js +6 -2
- package/dist/esm/co-menu-item.entry.js +1 -1
- package/dist/esm/co-modal.entry.js +7 -3
- package/dist/esm/co-navbar.entry.js +2 -2
- package/dist/esm/co-number-field.entry.js +3 -3
- package/dist/esm/co-overlay.entry.js +1 -1
- package/dist/esm/co-page-header.entry.js +1 -1
- package/dist/esm/co-phone-field.entry.js +1 -1
- package/dist/esm/co-progress-bar.entry.js +2 -2
- package/dist/esm/co-progress-circle.entry.js +2 -2
- package/dist/esm/co-provider-logo_2.entry.js +1 -1
- package/dist/esm/co-radio.entry.js +3 -3
- package/dist/esm/co-rating.entry.js +3 -3
- package/dist/esm/co-ref-field.entry.js +100 -9
- package/dist/esm/co-rich-text-editor.entry.js +3 -3
- package/dist/esm/co-row.entry.js +2 -2
- package/dist/esm/co-select.entry.js +4 -4
- package/dist/esm/co-separator.entry.js +1 -1
- package/dist/esm/co-sidebar.entry.js +2 -2
- package/dist/esm/co-slider.entry.js +2 -2
- package/dist/esm/co-switch.entry.js +3 -3
- package/dist/esm/co-tab-group.entry.js +2 -2
- package/dist/esm/co-tab.entry.js +2 -2
- package/dist/esm/co-tags-field.entry.js +5 -5
- package/dist/esm/co-textarea.entry.js +4 -4
- package/dist/esm/co-time-field.entry.js +1 -1
- package/dist/esm/co-toggle-button-group.entry.js +3 -3
- package/dist/esm/co-toggle-button.entry.js +3 -3
- package/dist/esm/{co-avatar_2.entry.js → co-tooltip.entry.js} +3 -70
- package/dist/esm/co-video.entry.js +2 -2
- package/dist/esm/cobalt.js +1 -1
- package/dist/esm/index-DH5lfRNj.js +12 -8
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/co-accordion/co-accordion.d.ts +6 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +25 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +4 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +4 -2
- package/dist/types/components/co-data-table/co-data-table.d.ts +15 -0
- package/dist/types/components/co-data-table/headerTruncationLogic.d.ts +24 -0
- package/dist/types/components/co-input/co-input.d.ts +5 -1
- package/dist/types/components/co-modal/co-modal.d.ts +10 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +13 -0
- package/dist/types/components/co-option-list/optionListLogic.d.ts +23 -6
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +38 -0
- package/dist/types/components/co-select/co-select.d.ts +6 -0
- package/dist/types/components.d.ts +79 -3
- package/package.json +2 -2
- package/dist/cobalt/p-15d59169.entry.js +0 -1
- package/dist/cobalt/p-1788aab5.entry.js +0 -1
- package/dist/cobalt/p-20a39218.entry.js +0 -1
- package/dist/cobalt/p-3cc3ff93.entry.js +0 -1
- package/dist/cobalt/p-4908f33f.entry.js +0 -1
- package/dist/cobalt/p-63825d7f.entry.js +0 -1
- package/dist/cobalt/p-6f700f0d.entry.js +0 -1
- package/dist/cobalt/p-88195a63.entry.js +0 -1
- package/dist/cobalt/p-8fa5dc4a.entry.js +0 -1
- package/dist/cobalt/p-b1e8d69e.entry.js +0 -1
- package/dist/cobalt/p-b48917c9.entry.js +0 -1
- package/dist/cobalt/p-c32c176a.entry.js +0 -1
- package/dist/cobalt/p-e48f4e45.entry.js +0 -1
- package/dist/cobalt/p-ef5ca521.entry.js +0 -1
- package/dist/components/p-9ceBPSd1.js +0 -1
- package/dist/components/p-B2IsXte7.js +0 -1
- package/dist/components/p-BsTO1uUA.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { measureTruncatedHeaders } from "./headerTruncationLogic";
|
|
1
2
|
import { h } from "@stencil/core";
|
|
2
3
|
import { edgeAutoScrollSpeed, resizeWidth } from "../../utils/columnResize";
|
|
3
4
|
/**
|
|
@@ -50,6 +51,9 @@ export class CoDataTable {
|
|
|
50
51
|
this.parsedFilteredFields = [];
|
|
51
52
|
this.parsedIndirectFields = [];
|
|
52
53
|
this.columnWidths = new Map();
|
|
54
|
+
/** Columnas cambiadas → re-medir tras el render (un cambio de texto con el
|
|
55
|
+
* mismo ancho no dispara el ResizeObserver). */
|
|
56
|
+
this.headerMeasurePending = false;
|
|
53
57
|
this.resizingColumn = null;
|
|
54
58
|
this.resizeStartX = 0;
|
|
55
59
|
this.resizeStartWidth = 0;
|
|
@@ -71,6 +75,7 @@ export class CoDataTable {
|
|
|
71
75
|
}
|
|
72
76
|
/* ─── WATCHERS ──────────────────────────────────────────── */
|
|
73
77
|
parseColumns() {
|
|
78
|
+
this.headerMeasurePending = true;
|
|
74
79
|
try {
|
|
75
80
|
const cols = typeof this.columns === 'string' ? JSON.parse(this.columns) : this.columns;
|
|
76
81
|
this.parsedColumns = cols;
|
|
@@ -119,13 +124,39 @@ export class CoDataTable {
|
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
componentWillLoad() {
|
|
127
|
+
// Recursos por instancia acá y no en inicializadores de campo: la instancia
|
|
128
|
+
// envuelta de @stencil/vitest los omite (ver nota en co-data-table.spec.tsx).
|
|
129
|
+
this.headerLabelEls = new Map();
|
|
130
|
+
this.truncatedHeaders = {};
|
|
122
131
|
this.parseColumns();
|
|
123
132
|
this.parseRows();
|
|
124
133
|
this.parseSelectedKeys();
|
|
125
134
|
this.parseFilteredFields();
|
|
126
135
|
this.parseIndirectFields();
|
|
127
136
|
}
|
|
137
|
+
componentDidLoad() {
|
|
138
|
+
// Tooltip del header SOLO cuando el label trunca (patrón co-list-item). El
|
|
139
|
+
// estado tiene que estar correcto ANTES del hover: Stencil re-renderiza en
|
|
140
|
+
// rAF, así que una medida en el pointerenter del <th> llega después de que
|
|
141
|
+
// co-tooltip leyó `disabled` al agendar su show (verificado headless
|
|
142
|
+
// 2026-09-07). Un ResizeObserver re-mide cuando el label cambia de ancho
|
|
143
|
+
// (resize de columna, panel que se muestra, viewport) — y en la carga.
|
|
144
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
145
|
+
this.headerResizeObserver = new ResizeObserver(() => this.measureHeaderTruncation());
|
|
146
|
+
this.headerLabelEls.forEach((el) => this.headerResizeObserver.observe(el));
|
|
147
|
+
}
|
|
148
|
+
this.measureHeaderTruncation();
|
|
149
|
+
}
|
|
150
|
+
disconnectedCallback() {
|
|
151
|
+
var _a;
|
|
152
|
+
(_a = this.headerResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
153
|
+
this.headerResizeObserver = undefined;
|
|
154
|
+
}
|
|
128
155
|
componentDidRender() {
|
|
156
|
+
if (this.headerMeasurePending) {
|
|
157
|
+
this.headerMeasurePending = false;
|
|
158
|
+
this.measureHeaderTruncation();
|
|
159
|
+
}
|
|
129
160
|
// Auto-scroll parity: the resize tick grew the column (async @State render)
|
|
130
161
|
// and owes the container the same px of scroll. Here the DOM already has
|
|
131
162
|
// the new table width, so the advance can't clamp — width and scroll land
|
|
@@ -277,6 +308,29 @@ export class CoDataTable {
|
|
|
277
308
|
handleRowDblClick(row, index) {
|
|
278
309
|
this.coRowDblClick.emit({ row, index });
|
|
279
310
|
}
|
|
311
|
+
/** Escritura guardada: misma referencia = sin re-render de la tabla. */
|
|
312
|
+
measureHeaderTruncation() {
|
|
313
|
+
const next = measureTruncatedHeaders(this.truncatedHeaders, this.headerLabelEls);
|
|
314
|
+
if (next !== this.truncatedHeaders)
|
|
315
|
+
this.truncatedHeaders = next;
|
|
316
|
+
}
|
|
317
|
+
/** ref del label: registra/observa al montar, limpia al desmontar (ref null). */
|
|
318
|
+
registerHeaderLabel(field, el) {
|
|
319
|
+
var _a, _b, _c;
|
|
320
|
+
const prev = this.headerLabelEls.get(field);
|
|
321
|
+
if (el) {
|
|
322
|
+
if (prev === el)
|
|
323
|
+
return;
|
|
324
|
+
if (prev)
|
|
325
|
+
(_a = this.headerResizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(prev);
|
|
326
|
+
this.headerLabelEls.set(field, el);
|
|
327
|
+
(_b = this.headerResizeObserver) === null || _b === void 0 ? void 0 : _b.observe(el);
|
|
328
|
+
}
|
|
329
|
+
else if (prev) {
|
|
330
|
+
(_c = this.headerResizeObserver) === null || _c === void 0 ? void 0 : _c.unobserve(prev);
|
|
331
|
+
this.headerLabelEls.delete(field);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
280
334
|
handleColumnPin(field, e) {
|
|
281
335
|
e.stopPropagation();
|
|
282
336
|
this.coColumnPin.emit({ field });
|
|
@@ -386,7 +440,7 @@ export class CoDataTable {
|
|
|
386
440
|
: undefined }, h("span", { class: "co-data-table__th-content" }, h("span", { class: {
|
|
387
441
|
'co-data-table__pin-icon': true,
|
|
388
442
|
'co-data-table__pin-icon--active': !!col.sticky,
|
|
389
|
-
}, title: col.sticky ? 'Unpin column' : 'Pin column', onClick: (e) => this.handleColumnPin(col.field, e) }, h("co-icon", { name: "push-pin", size: 14, weight: col.sticky ? 'fill' : 'regular' })), col.sortable ? (h("button", { type: "button", class: "co-data-table__sort-button", "aria-label": `Sort by ${col.label}`, onClick: () => this.handleSort(col.field) }, h("span", { class: "co-data-table__th-label" }, col.label), this.renderSortIcon(col))) : (h("span", { class: "co-data-table__th-label" }, col.label)), col.filterable && (h("span", { class: {
|
|
443
|
+
}, title: col.sticky ? 'Unpin column' : 'Pin column', onClick: (e) => this.handleColumnPin(col.field, e) }, h("co-icon", { name: "push-pin", size: 14, weight: col.sticky ? 'fill' : 'regular' })), col.sortable ? (h("button", { type: "button", class: "co-data-table__sort-button", "aria-label": `Sort by ${col.label}`, onClick: () => this.handleSort(col.field) }, h("co-tooltip", { block: true, class: "co-data-table__th-tip", content: col.label, placement: "top", disabled: !this.truncatedHeaders[col.field] }, h("span", { class: "co-data-table__th-label", ref: (el) => this.registerHeaderLabel(col.field, el) }, col.label)), this.renderSortIcon(col))) : (h("co-tooltip", { block: true, class: "co-data-table__th-tip", content: col.label, placement: "top", disabled: !this.truncatedHeaders[col.field] }, h("span", { class: "co-data-table__th-label", ref: (el) => this.registerHeaderLabel(col.field, el) }, col.label))), col.filterable && (h("span", { class: {
|
|
390
444
|
'co-data-table__filter-icon': true,
|
|
391
445
|
'co-data-table__filter-icon--active': this.parsedFilteredFields.includes(col.field),
|
|
392
446
|
'co-data-table__filter-icon--indirect': !this.parsedFilteredFields.includes(col.field) && this.parsedIndirectFields.includes(col.field),
|
|
@@ -421,12 +475,12 @@ export class CoDataTable {
|
|
|
421
475
|
: h("slot", { name: "empty-action" }))));
|
|
422
476
|
}
|
|
423
477
|
render() {
|
|
424
|
-
return (h("div", { key: '
|
|
478
|
+
return (h("div", { key: '6f71533676a2c66ae46b1ee9940b405744cef174', class: {
|
|
425
479
|
'co-data-table': true,
|
|
426
480
|
'co-data-table--resizing': this.resizingColumn !== null,
|
|
427
481
|
'co-data-table--loading': this.loading,
|
|
428
482
|
'co-data-table--empty': !this.loading && this.parsedRows.length === 0,
|
|
429
|
-
} }, h("div", { key: '
|
|
483
|
+
} }, h("div", { key: '8176dca34858e32ba2ce008ac44cf444ea952f08', class: "co-data-table__scroll" }, h("table", { key: 'f285815728244a7161d91dbed6ca87b158db4de6', class: "co-data-table__table", style: { width: `${this.getTableWidth()}px`, minWidth: '100%' } }, this.renderColgroup(), this.renderHeader(), h("slot", { key: '97f4ed9020a7bdb8b262313a10451e9aff754a8e' }), this.loading ? this.renderSkeletonBody() : null)), this.renderEmpty()));
|
|
430
484
|
}
|
|
431
485
|
static get is() { return "co-data-table"; }
|
|
432
486
|
static get originalStyleUrls() {
|
|
@@ -450,7 +504,7 @@ export class CoDataTable {
|
|
|
450
504
|
"references": {
|
|
451
505
|
"CoDataTableColumn": {
|
|
452
506
|
"location": "local",
|
|
453
|
-
"path": "/Users/agox/
|
|
507
|
+
"path": "/Users/agox/worktrees/cobalt-release/packages/core/src/components/co-data-table/co-data-table.tsx",
|
|
454
508
|
"id": "src/components/co-data-table/co-data-table.tsx::CoDataTableColumn"
|
|
455
509
|
}
|
|
456
510
|
}
|
|
@@ -815,6 +869,7 @@ export class CoDataTable {
|
|
|
815
869
|
"parsedFilteredFields": {},
|
|
816
870
|
"parsedIndirectFields": {},
|
|
817
871
|
"columnWidths": {},
|
|
872
|
+
"truncatedHeaders": {},
|
|
818
873
|
"resizingColumn": {},
|
|
819
874
|
"resizeStartX": {},
|
|
820
875
|
"resizeStartWidth": {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lógica pura del tooltip de header truncado (sin DOM real: testeable en vitest).
|
|
3
|
+
* Misma regla que co-list-item y `useEllipsisTooltip` de suite-v2: +1px de
|
|
4
|
+
* tolerancia porque el navegador redondea a enteros y 1px de más NO es corte.
|
|
5
|
+
*/
|
|
6
|
+
export function isEllipsisTruncated(node) {
|
|
7
|
+
return !!node && node.scrollWidth > node.clientWidth + 1;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Próximo mapa field → truncado. Devuelve el MISMO objeto si nada cambió (un
|
|
11
|
+
* @State de Stencil se compara por referencia: escribir siempre re-renderiza la
|
|
12
|
+
* tabla entera en cada hover de header).
|
|
13
|
+
*/
|
|
14
|
+
export function nextTruncatedHeaders(prev, field, truncated) {
|
|
15
|
+
if (!!prev[field] === truncated)
|
|
16
|
+
return prev;
|
|
17
|
+
return Object.assign(Object.assign({}, prev), { [field]: truncated });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Mide TODOS los labels registrados (field → nodo) en una pasada y devuelve el
|
|
21
|
+
* próximo mapa; la MISMA referencia si ningún field cambió. Un field que ya no
|
|
22
|
+
* está registrado (columna quitada) desaparece del mapa.
|
|
23
|
+
*/
|
|
24
|
+
export function measureTruncatedHeaders(prev, labels) {
|
|
25
|
+
let changed = Object.keys(prev).some((field) => !labels.has(field));
|
|
26
|
+
const next = {};
|
|
27
|
+
labels.forEach((node, field) => {
|
|
28
|
+
const truncated = isEllipsisTruncated(node);
|
|
29
|
+
next[field] = truncated;
|
|
30
|
+
if (!!prev[field] !== truncated)
|
|
31
|
+
changed = true;
|
|
32
|
+
});
|
|
33
|
+
return changed ? next : prev;
|
|
34
|
+
}
|
|
@@ -1039,7 +1039,7 @@ export class CoDateRangePicker {
|
|
|
1039
1039
|
"references": {
|
|
1040
1040
|
"DateRangeValue": {
|
|
1041
1041
|
"location": "local",
|
|
1042
|
-
"path": "/Users/agox/
|
|
1042
|
+
"path": "/Users/agox/worktrees/cobalt-release/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
|
|
1043
1043
|
"id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
@@ -1060,7 +1060,7 @@ export class CoDateRangePicker {
|
|
|
1060
1060
|
"references": {
|
|
1061
1061
|
"DateRangeValue": {
|
|
1062
1062
|
"location": "local",
|
|
1063
|
-
"path": "/Users/agox/
|
|
1063
|
+
"path": "/Users/agox/worktrees/cobalt-release/packages/core/src/components/co-date-range-picker/co-date-range-picker.tsx",
|
|
1064
1064
|
"id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue"
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
@@ -120,9 +120,13 @@ export class CoInput {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
/** Programmatically focus the inner input (post-hydration safe). */
|
|
123
|
-
|
|
123
|
+
/** Enfoca el input nativo. `options` se reenvía a `focus()` — p. ej.
|
|
124
|
+
* `{ preventScroll: true }` para un buscador que vive en un panel
|
|
125
|
+
* top-layer (co-popover): el scroll nativo hacia el foco trepa por los
|
|
126
|
+
* ancestros del light DOM y arrastra al host (drawer) sin necesidad. */
|
|
127
|
+
async setFocus(options) {
|
|
124
128
|
var _a;
|
|
125
|
-
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
129
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus(options);
|
|
126
130
|
}
|
|
127
131
|
componentDidLoad() {
|
|
128
132
|
var _a;
|
|
@@ -742,18 +746,26 @@ export class CoInput {
|
|
|
742
746
|
return {
|
|
743
747
|
"setFocus": {
|
|
744
748
|
"complexType": {
|
|
745
|
-
"signature": "() => Promise<void>",
|
|
746
|
-
"parameters": [
|
|
749
|
+
"signature": "(options?: FocusOptions) => Promise<void>",
|
|
750
|
+
"parameters": [{
|
|
751
|
+
"name": "options",
|
|
752
|
+
"type": "FocusOptions | undefined",
|
|
753
|
+
"docs": ""
|
|
754
|
+
}],
|
|
747
755
|
"references": {
|
|
748
756
|
"Promise": {
|
|
749
757
|
"location": "global",
|
|
750
758
|
"id": "global::Promise"
|
|
759
|
+
},
|
|
760
|
+
"FocusOptions": {
|
|
761
|
+
"location": "global",
|
|
762
|
+
"id": "global::FocusOptions"
|
|
751
763
|
}
|
|
752
764
|
},
|
|
753
765
|
"return": "Promise<void>"
|
|
754
766
|
},
|
|
755
767
|
"docs": {
|
|
756
|
-
"text": "
|
|
768
|
+
"text": "Enfoca el input nativo. `options` se reenv\u00EDa a `focus()` \u2014 p. ej.\n`{ preventScroll: true }` para un buscador que vive en un panel\ntop-layer (co-popover): el scroll nativo hacia el foco trepa por los\nancestros del light DOM y arrastra al host (drawer) sin necesidad.",
|
|
757
769
|
"tags": []
|
|
758
770
|
}
|
|
759
771
|
}
|
|
@@ -122,6 +122,15 @@
|
|
|
122
122
|
|
|
123
123
|
.co-menu-item__trigger-wrap { display: block; }
|
|
124
124
|
|
|
125
|
+
/* El trigger de un submenú va envuelto en co-popover, cuyo :host es inline-block:
|
|
126
|
+
sin esto la fila se encoge a su contenido y la flecha queda pegada al texto en
|
|
127
|
+
vez de al borde derecho del panel (las filas hoja no pasan por co-popover). Una
|
|
128
|
+
regla del scope exterior sobre el host gana a su :host. */
|
|
129
|
+
.co-menu-item__wrap--submenu > co-popover {
|
|
130
|
+
display: block;
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
|
|
125
134
|
.co-menu-item__submenu {
|
|
126
135
|
/* surface-secondary = base-blanco. NOT surface-primary (that's base-negro). */
|
|
127
136
|
background: var(--co-semantic-surface-secondary, #fff);
|
|
@@ -3,7 +3,14 @@ import { afterEventFor } from "../co-overlay/overlayAfterClose";
|
|
|
3
3
|
import { slotHasContent } from "../../utils/slotContent";
|
|
4
4
|
/**
|
|
5
5
|
* @slot - Modal body content
|
|
6
|
+
* @slot header-leading - Control before the heading (e.g. a back arrow on a
|
|
7
|
+
* second screen of the same modal)
|
|
8
|
+
* @slot header-actions - Controls at the right end of the header (e.g. a settings
|
|
9
|
+
* icon-button), before the close button
|
|
6
10
|
* @slot footer - Footer with action buttons
|
|
11
|
+
* @part modal | header | header-text | heading | description | body | footer -
|
|
12
|
+
* layout/typography hooks for a consumer that must match a specific spec
|
|
13
|
+
* (paddings, heading weight); colors stay on semantic tokens
|
|
7
14
|
*/
|
|
8
15
|
export class CoModal {
|
|
9
16
|
constructor() {
|
|
@@ -36,6 +43,9 @@ export class CoModal {
|
|
|
36
43
|
this.size = 'md';
|
|
37
44
|
/** Hide body section and all border dividers (compact confirm dialogs) */
|
|
38
45
|
this.noDividers = false;
|
|
46
|
+
/** Hairline between header and body. `false` lets the body run straight
|
|
47
|
+
* under the heading (Figma modals whose first row is a segmented control). */
|
|
48
|
+
this.headerDivider = true;
|
|
39
49
|
/* `:empty` can't see across a <slot>, so slotted presence is tracked in JS */
|
|
40
50
|
this.hasFooter = false;
|
|
41
51
|
this.handleFooterSlotChange = (e) => {
|
|
@@ -68,7 +78,7 @@ export class CoModal {
|
|
|
68
78
|
this.coClose.emit();
|
|
69
79
|
}
|
|
70
80
|
render() {
|
|
71
|
-
return (h("co-overlay", { key: '
|
|
81
|
+
return (h("co-overlay", { key: '9b796364a697af4d4a0ede50e5dd5516ccaa299f', open: this.open, onCoClose: this.handleOverlayClick }, h("div", { key: 'bea863aedb405cdc492277add25e2c08ea7ef258', class: "co-modal__frame co-sq-elevation-fallback" }, h("div", { key: '05f9e86f7a813243913f60c6a042fb93ed65a463', class: {
|
|
72
82
|
'co-modal': true,
|
|
73
83
|
'co-sq-clip': true,
|
|
74
84
|
'co-sq-elevation': true,
|
|
@@ -77,7 +87,8 @@ export class CoModal {
|
|
|
77
87
|
'co-modal--lg': this.size === 'lg',
|
|
78
88
|
'co-modal--full': this.size === 'full',
|
|
79
89
|
'co-modal--no-dividers': this.noDividers,
|
|
80
|
-
|
|
90
|
+
'co-modal--no-header-divider': !this.headerDivider,
|
|
91
|
+
}, part: "modal", ref: (el) => (this.modalEl = el), role: "dialog", "aria-modal": "true", "aria-labelledby": this.heading ? 'modal-heading' : undefined, onClick: this.stopPropagation, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '8ecd9f7f4413339e484710e2abef1c21fc7f25d0', class: "co-modal__header", part: "header" }, h("slot", { key: '09df61b3aac8a26e0eb85a6a6aa48f9a7f547dbf', name: "header-leading" }), h("div", { key: '8e9a55561a1b5615f77eb3eb96284ddc68eddbc3', class: "co-modal__header-text", part: "header-text" }, h("h2", { key: '65c083247543448d9f527592cd8614a4c713cf4c', class: "co-modal__heading", part: "heading", id: "modal-heading" }, this.heading), this.description && (h("p", { key: 'c871aa6549cf56265a02048ca18f736d92d1a482', class: "co-modal__description", part: "description" }, this.description))), h("slot", { key: '106a5be71c8c03736313c1084c61d3b836ebb495', name: "header-actions" }), this.closable && (h("button", { key: 'a0df67cd09e5f414c58f9f67f6a92c58b9f4773b', class: "co-modal__close", type: "button", "aria-label": "Close", onClick: this.handleCloseClick }, h("co-icon", { key: 'e766981fff30de0c79599756dde74c5981d5c9fd', name: "x", size: 20 })))), !this.noDividers && (h("div", { key: '355e455c19cbc4a0783c0e0c2689265e6f599484', class: "co-modal__body", part: "body" }, h("slot", { key: 'fa6d3310464ff33de17618561182736bc6cef0e5' }))), h("div", { key: '43b89751fac3fd1b707a284d260e91dd7d7ea8a6', class: { 'co-modal__footer': true, 'co-modal__footer--empty': !this.hasFooter }, part: "footer" }, h("slot", { key: 'e9821b0712a6903c923f9bb50393e4b85545c211', name: "footer", onSlotchange: this.handleFooterSlotChange }))))));
|
|
81
92
|
}
|
|
82
93
|
static get is() { return "co-modal"; }
|
|
83
94
|
static get encapsulation() { return "shadow"; }
|
|
@@ -251,6 +262,26 @@ export class CoModal {
|
|
|
251
262
|
"reflect": true,
|
|
252
263
|
"attribute": "no-dividers",
|
|
253
264
|
"defaultValue": "false"
|
|
265
|
+
},
|
|
266
|
+
"headerDivider": {
|
|
267
|
+
"type": "boolean",
|
|
268
|
+
"mutable": false,
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "boolean",
|
|
271
|
+
"resolved": "boolean",
|
|
272
|
+
"references": {}
|
|
273
|
+
},
|
|
274
|
+
"required": false,
|
|
275
|
+
"optional": false,
|
|
276
|
+
"docs": {
|
|
277
|
+
"tags": [],
|
|
278
|
+
"text": "Hairline between header and body. `false` lets the body run straight\nunder the heading (Figma modals whose first row is a segmented control)."
|
|
279
|
+
},
|
|
280
|
+
"getter": false,
|
|
281
|
+
"setter": false,
|
|
282
|
+
"reflect": false,
|
|
283
|
+
"attribute": "header-divider",
|
|
284
|
+
"defaultValue": "true"
|
|
254
285
|
}
|
|
255
286
|
};
|
|
256
287
|
}
|
|
@@ -14,12 +14,12 @@ export class CoNavbar {
|
|
|
14
14
|
this.rounded = false;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return (h("div", { key: '
|
|
17
|
+
return (h("div", { key: '9899b395fdf793bf9b7e47509b81eb559aac0b56', class: {
|
|
18
18
|
'co-navbar': true,
|
|
19
19
|
[`co-navbar--${this.variant}`]: true,
|
|
20
20
|
[`co-navbar--${this.size}`]: true,
|
|
21
21
|
'co-navbar--rounded': this.rounded,
|
|
22
|
-
}, part: "navbar", role: "toolbar" }, h("slot", { key: '
|
|
22
|
+
}, part: "navbar", role: "toolbar" }, h("slot", { key: 'c863bcf8dc9eddab771922a81e11c1966bfe8d2e' })));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "co-navbar"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -302,18 +302,18 @@ export class CoNumberField {
|
|
|
302
302
|
return this.scaled && !this.isEmpty ? '%' : null;
|
|
303
303
|
}
|
|
304
304
|
render() {
|
|
305
|
-
return (h("div", { key: '
|
|
305
|
+
return (h("div", { key: '1bcd7e60596bc28f5159f86a026d69d0d053f038', class: {
|
|
306
306
|
'co-number-field': true,
|
|
307
307
|
'co-number-field--disabled': this.disabled,
|
|
308
308
|
'co-number-field--focused': this.focused,
|
|
309
309
|
[`co-number-field--${this.size}`]: true,
|
|
310
310
|
[`co-number-field--${this.status}`]: this.status !== 'default',
|
|
311
|
-
} }, (this.label || this.secondaryLabel) && (h("div", { key: '
|
|
311
|
+
} }, (this.label || this.secondaryLabel) && (h("div", { key: 'aca2d9958374940304e05495ae05e74d627154c7', class: "co-number-field__labels" }, this.label && h("label", { key: '8cf05675830ad181005430526785984acc793d0b', class: "co-number-field__label" }, this.label, h(RequiredMark, { key: '36aed2cf48890cf79506416d0c45f272ed329664', required: this.required })), this.secondaryLabel && h("span", { key: '636111436e1e3fff8d74fb4b9412c2192c93495a', class: "co-number-field__secondary-label" }, this.secondaryLabel))), h("div", { key: '6cbbb87a304cd9e415aafda276daede8dbe0b6a7', class: "co-number-field__row", part: "row" }, !this.hideControls && (h("button", { key: 'e11dfc41ee97b3287908877aa74f732a4cbe31fe', 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: '3f369b4d8293e9e987d18ba58fa1f010bd538016', name: "minus", size: 16 }))), h("input", { key: '8144b563cd4ae46774adbf224c45fa59378da4c7', ref: el => (this.inputEl = el), class: "co-number-field__input", type: "text", inputMode: "decimal",
|
|
312
312
|
// Mismo guard `focused` que el @Watch: mientras el usuario edita, su
|
|
313
313
|
// texto manda. Sin esto, el re-render que dispara emitValue repinta
|
|
314
314
|
// el input desde el NÚMERO y se come el texto en construcción
|
|
315
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: '
|
|
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: '56e8b3a225f2332f9c3974ec195b63b3681d5b09', class: "co-number-field__affix", "aria-hidden": "true" }, this.affixText)), this.clearable && !this.isEmpty && !this.disabled && (h("button", { key: 'ea8325f7097c5b0b87bd51554163d44bdfe379ff', class: "co-number-field__clear", type: "button", tabIndex: -1, onClick: this.handleClear, "aria-label": "Clear" }, h("co-icon", { key: 'c72d4e3a039752fbcf7cf4594421d24bc2f0570a', name: "x-circle", size: 16, weight: "fill" }))), h("slot", { key: '2a3dc1b5a3e22ade3db02389178dd4ae3b1d3295', name: "suffix" }), !this.hideControls && (h("button", { key: '3b9bf39d86c7aacb212576dc4cf4af548b56fbed', 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: '1655aaca9e66b51c0d97fc128c132326d3c740ad', name: "plus", size: 16 })))), this.helperText && (h("div", { key: '397b37569cabdf68072d870b5e5781f7d39da8fe', class: `co-number-field__helper co-number-field__helper--${this.status}` }, this.statusIcon && h("co-icon", { key: 'b574fddca9813af3e208ea3e9258480a992fd4f2', name: this.statusIcon, size: 14, weight: "fill", class: "co-number-field__helper-icon" }), h("span", { key: 'd17a39a82108f12100dee523d7754b50f147bb63', class: "co-number-field__helper-text" }, this.helperText)))));
|
|
317
317
|
}
|
|
318
318
|
static get is() { return "co-number-field"; }
|
|
319
319
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { highlightMatch } from "../../utils/normalizeText";
|
|
3
3
|
import { initOverlayScroll } from "../../utils/overlayScroll";
|
|
4
|
-
import { buildRows, deriveMore, listReorderIds, liveSelectedOrder, nextActiveIndex, orderItems, parseItems, parseValue, selectedActiveIndex, virtualSlice, VIRTUAL_ITEM_HEIGHT, VIRTUAL_VIEWPORT_ITEMS, } from "./optionListLogic";
|
|
4
|
+
import { buildRows, deriveMore, listReorderIds, liveSelectedOrder, nextActiveIndex, orderItems, parseItems, parseValue, selectedActiveIndex, shouldResnapshotOnTerm, virtualSlice, VIRTUAL_ITEM_HEIGHT, VIRTUAL_VIEWPORT_ITEMS, } from "./optionListLogic";
|
|
5
5
|
/**
|
|
6
6
|
* Núcleo de lista de opciones — la única fuente del look & behavior de los
|
|
7
7
|
* dropdowns Cobalt (co-ref-field, co-combobox, co-autocomplete,
|
|
@@ -106,10 +106,15 @@ export class CoOptionList {
|
|
|
106
106
|
};
|
|
107
107
|
this.onSearchInput = (e) => {
|
|
108
108
|
const v = e.target.value;
|
|
109
|
+
// Al volver a la lista completa el bloque selected-first se rearma con lo que
|
|
110
|
+
// se seleccionó durante la sesión del panel (ver shouldResnapshotOnTerm).
|
|
111
|
+
const resnapshot = shouldResnapshotOnTerm(this.term, v);
|
|
109
112
|
this.term = v;
|
|
110
113
|
this.activeIndex = -1;
|
|
111
114
|
// Resultset nuevo: re-habilita fillViewport aunque venga del mismo largo.
|
|
112
115
|
this.lastFillLen = -1;
|
|
116
|
+
if (resnapshot)
|
|
117
|
+
this.takeSnapshot();
|
|
113
118
|
if (this.debounceTimer)
|
|
114
119
|
clearTimeout(this.debounceTimer);
|
|
115
120
|
this.debounceTimer = setTimeout(() => this.coSearch.emit(v), this.searchDebounce);
|
|
@@ -280,6 +285,27 @@ export class CoOptionList {
|
|
|
280
285
|
this.scrollTop = maxScrollTop;
|
|
281
286
|
}
|
|
282
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Selected-first VIVO (decisión de producto 2026-09-14, campo Colaboradores):
|
|
290
|
+
* la partición sigue a `value` — marcar un ítem lo sube al bloque de
|
|
291
|
+
* seleccionados al instante y desmarcarlo lo devuelve a su lugar del orden del
|
|
292
|
+
* server. Reemplaza el snapshot congelado al abrir (evitaba saltos, pero se
|
|
293
|
+
* leía como "no pasó nada" al elegir). El reacomodo se anima con el mismo FLIP
|
|
294
|
+
* del reorder: tops capturados ANTES de re-particionar, runFlip corre en
|
|
295
|
+
* componentDidRender. El highlight de teclado se queda sobre el MISMO ítem
|
|
296
|
+
* (Enter sobre una fila la mueve; el índice viejo apuntaría a otra fila).
|
|
297
|
+
* Tras un drop del reorder el host manda el value en el orden del preview:
|
|
298
|
+
* mismo orden → deltas 0 → no-op visual.
|
|
299
|
+
*/
|
|
300
|
+
onValueChange() {
|
|
301
|
+
var _a;
|
|
302
|
+
if (!this.selectedFirst)
|
|
303
|
+
return;
|
|
304
|
+
const activeId = this.activeIndex >= 0 ? (_a = this.orderedItems[this.activeIndex]) === null || _a === void 0 ? void 0 : _a._id : undefined;
|
|
305
|
+
this.pendingFlip = { tops: this.captureRowTops(), movedId: '', spring: false };
|
|
306
|
+
this.takeSnapshot();
|
|
307
|
+
this.activeIndex = activeId ? this.orderedItems.findIndex((i) => i._id === activeId) : -1;
|
|
308
|
+
}
|
|
283
309
|
// ── Métodos públicos ───────────────────────────────────────
|
|
284
310
|
/** Re-toma el snapshot selected-first. El host la llama al abrir su panel. */
|
|
285
311
|
async snapshotOrder() {
|
|
@@ -713,11 +739,11 @@ export class CoOptionList {
|
|
|
713
739
|
const selectedIds = this.selectedIds;
|
|
714
740
|
const { hasMore, remaining } = deriveMore(this.parsedItems.length, this.total, this.hasMore);
|
|
715
741
|
const showClear = !!this.clearOptionLabel && selectedIds.length > 0;
|
|
716
|
-
return (h("div", { key: '
|
|
742
|
+
return (h("div", { key: '3d1df259b90836a6a125627e850ff2d2e1556d4c', class: "co-option-list", onKeyDown: this.onRootKeyDown }, this.searchable && (h("div", { key: '181a0c89ff38821301c0728f4eb5edb9c4e11b2d', class: "co-option-list__search", part: "search" }, h("co-icon", { key: 'cac54346c457d884fbbc1257b00dbe932e5419ca', name: "magnifying-glass", size: 16 }), h("input", { key: 'bbc27b7821651189718cf763e689dd08e6fa0050', 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: '993c2308c9d6e1958f8f3ddc73b08e9ebc0bd409', 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: '458e04427d5dd6a4e74537483b18d8e4ba9c71a5', class: "co-option-list__inner" }, showClear && (h("button", { key: '03d067e6a79dfb51f39aa52ad8b7b6464aa2f37d', class: "co-option-list__clear-row", type: "button", onClick: () => this.coClearSelection.emit() }, h("co-icon", { key: '394b7c318f942d74cb7d68859aa54fce5ed2dc58', name: "x-circle", size: 14 }), h("span", { key: '3dd47de0ed422bb5dd3a3c63ac7dc3936578fdaa' }, this.clearOptionLabel))), this.loading && items.length === 0 && (h("div", { key: '02dae3b4322ce67325617870c090fd3f3946f8c1', class: "co-option-list__loading" }, h("co-loader", { key: 'aaa67b4cf0f37be7364cbd00f2b156bed4018c13', size: "sm" }))), !this.loading && items.length === 0 && (h("div", { key: 'caa5a5b33817577084b9e82a40f97632972e5068', class: "co-option-list__empty" }, h("co-icon", { key: '0cd622efe4ea8bc4483322b4a81c5e3a254f08ab', name: "magnifying-glass", size: 20 }), h("span", { key: 'ca1fb6cf98eacba682f308f610befe6f9da9edd2' }, this.emptyMessage))), items.length > 0 && this.virtual
|
|
717
743
|
? this.renderVirtual(items, selectedIds)
|
|
718
744
|
: buildRows(items).map((row) => row.kind === 'header'
|
|
719
745
|
? h("div", { class: "co-option-list__group", role: "presentation" }, row.label)
|
|
720
|
-
: this.renderRow(row.item, row.index, selectedIds)), this.loading && items.length > 0 && (h("div", { key: '
|
|
746
|
+
: this.renderRow(row.item, row.index, selectedIds)), this.loading && items.length > 0 && (h("div", { key: '7e9ce17adba91610cf8c2b4c7c1d544db4879122', class: "co-option-list__loading-more" }, h("co-loader", { key: '974bc5404e175c89f6a1972900f2e3b8e2d95373', size: "sm" }))), !this.loading && hasMore && remaining > 0 && (h("div", { key: '34261e4bf8349cd4973a642d7137e72f80c2a867', class: "co-option-list__more" }, remaining, " more results")))), h("slot", { key: 'e350a3a8e731f6d2bb609c84cd0e601e93e6b063', name: "footer" })));
|
|
721
747
|
}
|
|
722
748
|
static get is() { return "co-option-list"; }
|
|
723
749
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1501,6 +1527,9 @@ export class CoOptionList {
|
|
|
1501
1527
|
return [{
|
|
1502
1528
|
"propName": "items",
|
|
1503
1529
|
"methodName": "onItemsChange"
|
|
1530
|
+
}, {
|
|
1531
|
+
"propName": "value",
|
|
1532
|
+
"methodName": "onValueChange"
|
|
1504
1533
|
}];
|
|
1505
1534
|
}
|
|
1506
1535
|
}
|
|
@@ -28,12 +28,13 @@ export function parseValue(raw) {
|
|
|
28
28
|
* snapshotDisplay los que la página actual no contiene) + resto en orden de
|
|
29
29
|
* server; buscando → solo resultados reales, seleccionados primero.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
31
|
+
* El bloque idle se recorre por `snapshotIds` (Set ordenado por selección, igual
|
|
32
|
+
* que `snapshotDisplay`) resolviendo cada id contra la página primero y contra el
|
|
33
|
+
* display después. Así un seleccionado AUSENTE de `snapshotDisplay` pero presente
|
|
34
|
+
* en `items` sigue en la lista: `rest` filtra todo id del snapshot, así que sin
|
|
35
|
+
* esa resolución desaparecía de la lista entera, no sólo del bloque de arriba.
|
|
36
|
+
* Un id que no está en ninguna de las dos fuentes no tiene nada que pintar y se
|
|
37
|
+
* ignora (no hay label que mostrar).
|
|
37
38
|
*/
|
|
38
39
|
export function orderItems(items, snapshotIds, snapshotDisplay, searching) {
|
|
39
40
|
var _a;
|
|
@@ -42,8 +43,12 @@ export function orderItems(items, snapshotIds, snapshotDisplay, searching) {
|
|
|
42
43
|
const byId = new Map(items.map((i) => [i._id, i]));
|
|
43
44
|
const selectedBlock = [];
|
|
44
45
|
if (!searching) {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const displayById = new Map(snapshotDisplay.map((d) => [d._id, d]));
|
|
47
|
+
for (const id of snapshotIds) {
|
|
48
|
+
const resolved = (_a = byId.get(id)) !== null && _a !== void 0 ? _a : displayById.get(id);
|
|
49
|
+
if (resolved)
|
|
50
|
+
selectedBlock.push(resolved);
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
53
|
else {
|
|
49
54
|
for (const i of items)
|
|
@@ -53,6 +58,24 @@ export function orderItems(items, snapshotIds, snapshotDisplay, searching) {
|
|
|
53
58
|
const rest = items.filter((i) => !snapshotIds.has(i._id));
|
|
54
59
|
return [...selectedBlock, ...rest];
|
|
55
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* ¿Hay que re-tomar el snapshot selected-first por el cambio del término?
|
|
63
|
+
*
|
|
64
|
+
* Sólo en el flanco "había búsqueda → ya no": volver a la lista completa es un
|
|
65
|
+
* contexto de listado nuevo, y ahí el bloque de arriba tiene que incluir lo que
|
|
66
|
+
* se seleccionó DURANTE la sesión del panel. Sin esto, un panel abierto sin nada
|
|
67
|
+
* seleccionado se quedaba con el snapshot VACÍO para siempre (`orderItems`
|
|
68
|
+
* cortocircuita en `size === 0`): lo elegido mientras se buscaba desaparecía de
|
|
69
|
+
* la lista al limpiar el término, porque el servidor devuelve la página 1 y esos
|
|
70
|
+
* registros casi nunca están ahí. Se leía como "se deselecciona solo".
|
|
71
|
+
*
|
|
72
|
+
* El re-snapshot por SELECCIÓN no pasa por acá: vive en el componente
|
|
73
|
+
* (`@Watch('value')`, selected-first vivo desde 2026-09-14 — marcar sube la fila
|
|
74
|
+
* al instante). Esta función solo decide el flanco del TÉRMINO.
|
|
75
|
+
*/
|
|
76
|
+
export function shouldResnapshotOnTerm(prevTerm, nextTerm) {
|
|
77
|
+
return !!prevTerm && !nextTerm;
|
|
78
|
+
}
|
|
56
79
|
/** Aplana a filas de render insertando un header cuando `group` cambia
|
|
57
80
|
* (groupItems de co-command-search). `index` cuenta solo items. */
|
|
58
81
|
export function buildRows(items) {
|
|
@@ -189,7 +189,7 @@ export class CoOverlay {
|
|
|
189
189
|
focusables[nextIndex].focus();
|
|
190
190
|
}
|
|
191
191
|
render() {
|
|
192
|
-
return (h("div", { key: '
|
|
192
|
+
return (h("div", { key: '4fafc87768eca581018ff578875b2362cf5297d2', 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: '2d18410bb6774701806101d38b6d41293b0e7ff9' })));
|
|
193
193
|
}
|
|
194
194
|
static get is() { return "co-overlay"; }
|
|
195
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: '0f064f7e659103d8f679f23242492a5e9a869a88', class: "co-page-header", part: "page-header" }, h("div", { key: '4ccd5682d2d6872a5fa771b2779a8f7e0ab8b6f7', class: "co-page-header__left" }, this.icon && (h("span", { key: '10bc9aa126f8b9932b1e4247d7c3c3c04d89c425', class: "co-page-header__icon" }, h("co-icon", { key: '42f2cda7ec8ee4e0e4a51069606492647d13f690', name: this.icon, size: 24 }))), h("span", { key: '368633ff1b213286d5f6bdf5716e3acb1cbe2f71', class: "co-page-header__title" }, h("slot", { key: 'c74f2dcde7cfc0c0384f6a10a9f069a9ff94f78d' }, this.heading))), h("div", { key: '6666c103a2e6e826837091658ce1e4e4b1704215', class: "co-page-header__actions" }, h("slot", { key: '7df47ea333491b960bc1faff7fd0b6431aba56e5', 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: 'a9c32c0be0ebd40ed647e76522424eb7e5e9aa18', class: `co-phone-field co-phone-field--${this.size} ${statusClass} ${this.disabled ? 'co-phone-field--disabled' : ''}` }, this.label && (h("label", { key: '37178a06aab45e8254fd0a366758e5302f2eaa46', class: "co-phone-field__label" }, this.label, h(RequiredMark, { key: '03a342ae39b5f17ba154b5c41f38c68ed3b017ba', required: this.required }))), h("div", { key: '1ec715b8334d174369e2cf84c1599d98f99e0a46', class: "co-phone-field__container" }, h("button", { key: '4570d47ae1b5f29777ef83934f29238f41f39c72', 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: 'eeea700daa0921575451e84229f756a8b07ba2bc', class: "co-phone-field__dial-code" }, entry ? entry.dialCode : ''), h("span", { key: '8a255cbcdd177d2c3df85e70cd533977401b4331', class: "co-phone-field__chevron" }, h("co-icon", { key: 'b7b7f8ae9ff2faa4aced5387cbdcafbdca3ab850', name: "caret-down", size: 14 }))), h("input", { key: '5c22124cf3b89be951b241dc5414ecfaa914f311', 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: '58a86dd712fff37ae8a15aa814ecffe68872c546', class: "co-phone-field__dropdown", role: "listbox" }, h("div", { key: '7641be732c29f0cb601b05a185ea10219fc45bae', class: "co-phone-field__search" }, h("input", { key: 'd77b2e9acb00dcf28babbc203b65692fb5b9c8e7', class: "co-phone-field__search-input", type: "text", placeholder: "Search country...", value: this.searchQuery, onInput: (e) => this.handleSearchInput(e), autoFocus: true })), h("div", { key: 'a80b7fbe6ac444f44ea802d8820b0dabff943885', 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: 'c24516916b7d78d89eb18d03c8b70363567db9cf', class: "co-phone-field__helper" }, this.statusIcon && (h("co-icon", { key: 'e76e608653f1b45c7904bbfe0325a2813fe6aff1', name: this.statusIcon, size: 14, weight: "fill", class: "co-phone-field__helper-icon" })), h("span", { key: 'b7f14cc4ad48df862eee0ba4b45e19fe29e26baa', 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"; }
|
|
@@ -358,7 +358,7 @@ export class CoPopover {
|
|
|
358
358
|
"references": {
|
|
359
359
|
"PopoverPlacement": {
|
|
360
360
|
"location": "local",
|
|
361
|
-
"path": "/Users/agox/
|
|
361
|
+
"path": "/Users/agox/worktrees/cobalt-release/packages/core/src/components/co-popover/co-popover.tsx",
|
|
362
362
|
"id": "src/components/co-popover/co-popover.tsx::PopoverPlacement"
|
|
363
363
|
}
|
|
364
364
|
}
|
|
@@ -18,12 +18,12 @@ export class CoProgressBar {
|
|
|
18
18
|
render() {
|
|
19
19
|
const clamped = Math.max(0, Math.min(100, this.value));
|
|
20
20
|
const indeterminate = this.indeterminate;
|
|
21
|
-
return (h("div", { key: '
|
|
21
|
+
return (h("div", { key: 'bcf5e566cfa6726eac8578288797d1004e4003fb', class: {
|
|
22
22
|
'co-progress-bar': true,
|
|
23
23
|
[`co-progress-bar--${this.status}`]: true,
|
|
24
24
|
[`co-progress-bar--${this.variant}`]: true,
|
|
25
25
|
'co-progress-bar--indeterminate': indeterminate,
|
|
26
|
-
}, role: "progressbar", "aria-valuenow": indeterminate ? undefined : clamped, "aria-valuemin": 0, "aria-valuemax": 100, part: "bar", style: { height: `${this.thickness}px` } }, h("div", { key: '
|
|
26
|
+
}, role: "progressbar", "aria-valuenow": indeterminate ? undefined : clamped, "aria-valuemin": 0, "aria-valuemax": 100, part: "bar", style: { height: `${this.thickness}px` } }, h("div", { key: '932537ab1521b2d7fcd0e1bb57c027a276dacaf3', class: "co-progress-bar__fill", style: indeterminate ? undefined : { width: `${clamped}%` } })));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "co-progress-bar"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|